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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 136753015: aw: Move clearView implementaiton to native (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: invalidate to native too Created 6 years, 11 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 | « android_webview/browser/in_process_view_renderer.cc ('k') | android_webview/native/aw_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index d8c1708e4753d5293474702bdffb943f786f91b5..408b8ccc109a4d14a3e8387b54ee4199eaeca21e 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -182,9 +182,6 @@ public class AwContents {
private boolean mContainerViewFocused;
private boolean mWindowFocused;
- private boolean mClearViewActive;
- private boolean mPictureListenerEnabled;
-
// These come from the compositor and are updated immediately (in contrast to the values in
// ContentViewCore, which are updated at end of every frame).
private float mPageScaleFactor = 1.0f;
@@ -742,13 +739,12 @@ public class AwContents {
mScrollOffsetManager.syncScrollOffsetFromOnDraw();
canvas.getClipBounds(mClipBoundsTemporary);
- if (mClearViewActive) {
- canvas.drawColor(getEffectiveBackgroundColor());
- } else if (!nativeOnDraw(mNativeAwContents, canvas, canvas.isHardwareAccelerated(),
+ if (!nativeOnDraw(mNativeAwContents, canvas, canvas.isHardwareAccelerated(),
mContainerView.getScrollX(), mContainerView.getScrollY(),
mClipBoundsTemporary.left, mClipBoundsTemporary.top,
mClipBoundsTemporary.right, mClipBoundsTemporary.bottom)) {
- Log.w(TAG, "nativeOnDraw failed; clearing to background color.");
+ // Can happen during initialization when compositor is not set up. Or when clearView
+ // is in effect. Just draw background color instead.
canvas.drawColor(getEffectiveBackgroundColor());
}
@@ -779,9 +775,8 @@ public class AwContents {
}
public void clearView() {
- mClearViewActive = true;
- syncOnNewPictureStateToNative();
- mContainerView.invalidate();
+ if (mNativeAwContents == 0) return;
+ nativeClearView(mNativeAwContents);
}
/**
@@ -801,13 +796,7 @@ public class AwContents {
}
};
}
- mPictureListenerEnabled = enabled;
- syncOnNewPictureStateToNative();
- }
-
- private void syncOnNewPictureStateToNative() {
- if (mNativeAwContents == 0) return;
- nativeEnableOnNewPicture(mNativeAwContents, mPictureListenerEnabled || mClearViewActive);
+ nativeEnableOnNewPicture(mNativeAwContents, enabled);
}
public void findAllAsync(String searchString) {
@@ -1835,13 +1824,6 @@ public class AwContents {
@CalledByNative
public void onNewPicture() {
- // Clear up any results from a previous clearView call
- if (mClearViewActive) {
- mClearViewActive = false;
- mContainerView.invalidate();
- syncOnNewPictureStateToNative();
- }
-
// Don't call capturePicture() here but instead defer it until the posted task runs within
// the callback helper, to avoid doubling back into the renderer compositor in the middle
// of the notification it is sending up to here.
@@ -2066,6 +2048,7 @@ public class AwContents {
private native int nativeGetAwDrawGLViewContext(long nativeAwContents);
private native long nativeCapturePicture(long nativeAwContents, int width, int height);
private native void nativeEnableOnNewPicture(long nativeAwContents, boolean enabled);
+ private native void nativeClearView(long nativeAwContents);
private native void nativeSetExtraHeadersForUrl(long nativeAwContents,
String url, String extraHeaders);
« no previous file with comments | « android_webview/browser/in_process_view_renderer.cc ('k') | android_webview/native/aw_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698