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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java

Issue 62333022: Avoid compositing when the surface texture is still empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combine didCompositeAndDraw and render Created 7 years, 1 month 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: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
index 3c7f70bbfed632537eb6bbe7851df3f8718ac582..16e5bd4d56a3825498620a010612842a3bc398f0 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
@@ -264,29 +264,28 @@ public class ContentViewRenderView extends FrameLayout {
if (mPendingSwapBuffers > 0) mPendingSwapBuffers--;
}
- private void didCompositeAndDraw() {
+ private void render() {
+ if (mPendingRenders > 0) mPendingRenders--;
+
+ // Waiting for the content view contents to be ready avoids compositing
+ // when the surface texture is still empty.
if (mCurrentContentView == null) return;
ContentViewCore contentViewCore = mCurrentContentView.getContentViewCore();
- if (contentViewCore == null || !contentViewCore.isReady() || getBackground() == null) {
+ if (contentViewCore == null || !contentViewCore.isReady()) {
return;
}
- if (getBackground() != null) {
- post(new Runnable() {
- @Override
- public void run() {
- setBackgroundResource(0);
- }
- });
- }
- }
-
- private void render() {
- if (mPendingRenders > 0) mPendingRenders--;
boolean didDraw = nativeComposite(mNativeContentViewRenderView);
if (didDraw) {
mPendingSwapBuffers++;
- didCompositeAndDraw();
+ if (getBackground() != null) {
+ post(new Runnable() {
bulach 2013/11/15 15:54:02 while at it then.... is churning out new Runnable(
Sami 2013/11/15 16:06:28 This runnable is just removing the static backgrou
bulach 2013/11/15 16:07:40 got it, thanks!
+ @Override
+ public void run() {
+ setBackgroundResource(0);
+ }
+ });
+ }
}
}
« 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