2015-06-24 03:59:37 -07:00
|
|
|
/*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
2015-06-24 03:59:37 -07:00
|
|
|
*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2015-06-24 03:59:37 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package org.webrtc;
|
|
|
|
|
|
2018-06-15 09:33:20 +02:00
|
|
|
/** Simplest possible GL shader that just draws frames as opaque quads. */
|
|
|
|
|
public class GlRectDrawer extends GlGenericDrawer {
|
|
|
|
|
private static final String FRAGMENT_SHADER = "void main() {\n"
|
|
|
|
|
+ " gl_FragColor = sample(tc);\n"
|
2015-09-02 12:52:03 +02:00
|
|
|
+ "}\n";
|
|
|
|
|
|
2018-06-15 09:33:20 +02:00
|
|
|
private static class ShaderCallbacks implements GlGenericDrawer.ShaderCallbacks {
|
|
|
|
|
@Override
|
|
|
|
|
public void onNewShader(GlShader shader) {}
|
2015-06-24 03:59:37 -07:00
|
|
|
|
2018-06-15 09:33:20 +02:00
|
|
|
@Override
|
|
|
|
|
public void onPrepareShader(GlShader shader, float[] texMatrix, int frameWidth, int frameHeight,
|
|
|
|
|
int viewportWidth, int viewportHeight) {}
|
2015-09-02 12:52:03 +02:00
|
|
|
}
|
|
|
|
|
|
2018-06-15 09:33:20 +02:00
|
|
|
public GlRectDrawer() {
|
|
|
|
|
super(FRAGMENT_SHADER, new ShaderCallbacks());
|
2015-06-24 03:59:37 -07:00
|
|
|
}
|
|
|
|
|
}
|