Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: webrtc/sdk/android/api/org/webrtc/EglRenderer.java

Issue 2857363002: Add functionality to clear surface to a specific color in EglRenderer. (Closed)
Patch Set: Fix. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/android/api/org/webrtc/EglRenderer.java
diff --git a/webrtc/sdk/android/api/org/webrtc/EglRenderer.java b/webrtc/sdk/android/api/org/webrtc/EglRenderer.java
index 9b09256071e1ae0b7f188246c0aac12111839f3c..3d65b72b90930ccaa8933cd12b713275c5da0629 100644
--- a/webrtc/sdk/android/api/org/webrtc/EglRenderer.java
+++ b/webrtc/sdk/android/api/org/webrtc/EglRenderer.java
@@ -481,19 +481,26 @@ public class EglRenderer implements VideoRenderer.Callbacks {
}
}
- private void clearSurfaceOnRenderThread() {
+ private void clearSurfaceOnRenderThread(float r, float g, float b, float a) {
if (eglBase != null && eglBase.hasSurface()) {
logD("clearSurface");
- GLES20.glClearColor(0 /* red */, 0 /* green */, 0 /* blue */, 0 /* alpha */);
+ GLES20.glClearColor(r, g, b, a);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
eglBase.swapBuffers();
}
}
/**
- * Post a task to clear the TextureView to a transparent uniform color.
+ * Post a task to clear the surface to a transparent uniform color.
*/
public void clearImage() {
+ clearImage(0 /* red */, 0 /* green */, 0 /* blue */, 0 /* alpha */);
+ }
+
+ /**
+ * Post a task to clear the surface to a specific color.
+ */
+ public void clearImage(final float r, final float g, final float b, final float a) {
synchronized (handlerLock) {
if (renderThreadHandler == null) {
return;
@@ -501,7 +508,7 @@ public class EglRenderer implements VideoRenderer.Callbacks {
renderThreadHandler.postAtFrontOfQueue(new Runnable() {
@Override
public void run() {
- clearSurfaceOnRenderThread();
+ clearSurfaceOnRenderThread(r, g, b, a);
}
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698