| 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. |
| 9 | */ |
| 10 |
| 11 | package org.webrtc; |
| 12 |
| 13 | /** Simplest possible GL shader that just draws frames as opaque quads. */ |
| 14 | public class GlRectDrawer extends GlGenericDrawer { |
| 15 | private static final String FRAGMENT_SHADER = "void main() {\n" |
| 16 | + " gl_FragColor = sample(tc);\n" |
| 17 | + "}\n"; |
| 18 |
| 19 | private static class ShaderCallbacks implements GlGenericDrawer.ShaderCallbacks { |
| 20 | @Override |
| 21 | public void onNewShader(GlShader shader) {} |
| 22 |
| 23 | @Override |
| 24 | public void onPrepareShader(GlShader shader, float[] texMatrix, int frameWidth, int frameHeight, |
| 25 | int viewportWidth, int viewportHeight) {} |
| 26 | } |
| 27 |
| 28 | public GlRectDrawer() { |
| 29 | super(FRAGMENT_SHADER, new ShaderCallbacks()); |
| 30 | } |
| 31 | } |
| 32 |