blob: d1fbd1b7bce1f04f424290a6d5372b8eea34d545 [file] [log] [blame]
magjed59a677a2015-06-24 03:59:37 -07001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
magjed59a677a2015-06-24 03:59:37 -07003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
magjed59a677a2015-06-24 03:59:37 -07009 */
10
11package org.webrtc;
12
Magnus Jedvert65c61dc2018-06-15 09:33:20 +020013/** Simplest possible GL shader that just draws frames as opaque quads. */
14public class GlRectDrawer extends GlGenericDrawer {
15 private static final String FRAGMENT_SHADER = "void main() {\n"
16 + " gl_FragColor = sample(tc);\n"
magjed59a677a2015-06-24 03:59:37 -070017 + "}\n";
18
Magnus Jedvert65c61dc2018-06-15 09:33:20 +020019 private static class ShaderCallbacks implements GlGenericDrawer.ShaderCallbacks {
20 @Override
21 public void onNewShader(GlShader shader) {}
magjed59a677a2015-06-24 03:59:37 -070022
Magnus Jedvert65c61dc2018-06-15 09:33:20 +020023 @Override
24 public void onPrepareShader(GlShader shader, float[] texMatrix, int frameWidth, int frameHeight,
25 int viewportWidth, int viewportHeight) {}
Magnus Jedvert7afc12f2015-09-03 12:40:38 +020026 }
magjed59a677a2015-06-24 03:59:37 -070027
Magnus Jedvert65c61dc2018-06-15 09:33:20 +020028 public GlRectDrawer() {
29 super(FRAGMENT_SHADER, new ShaderCallbacks());
magjed59a677a2015-06-24 03:59:37 -070030 }
31}