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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java

Issue 1943963003: WIP Handle AwContents needing multiple live functors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from PS17 Created 4 years, 7 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/native/aw_contents.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java b/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
index da0009eb9f184705d73b28f68d93883c2ebcad35..916c58e3cd6868e5c7f9dde17dd34fc92df05828 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
@@ -57,6 +57,8 @@ public class AwTestContainerView extends FrameLayout {
private int mLastScrollX = 0;
private int mLastScrollY = 0;
+ // Only used by drawGL on render thread to store the value of scroll offsets at most recent
+ // sync for subsequent draws.
private int mCommittedScrollX = 0;
private int mCommittedScrollY = 0;
@@ -146,7 +148,6 @@ public class AwTestContainerView extends FrameLayout {
public void requestRender(long viewContext, Canvas canvas, boolean waitForCompletion) {
synchronized (mSyncLock) {
assert viewContext != 0;
- assert mViewContext == 0 || mViewContext == viewContext;
mViewContext = viewContext;
super.requestRender();
mFunctorAttached = true;
@@ -183,6 +184,7 @@ public class AwTestContainerView extends FrameLayout {
final boolean draw;
final boolean process;
final boolean waitForCompletion;
+ final long viewContext;
synchronized (mSyncLock) {
if (!mFunctorAttached) {
@@ -193,9 +195,9 @@ public class AwTestContainerView extends FrameLayout {
draw = mNeedsDrawGL;
process = mNeedsProcessGL;
waitForCompletion = mWaitForCompletion;
-
+ viewContext = mViewContext;
if (draw) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height, 0, 0, MODE_SYNC);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, 0, 0, MODE_SYNC);
mCommittedScrollX = mLastScrollX;
mCommittedScrollY = mLastScrollY;
}
@@ -206,11 +208,11 @@ public class AwTestContainerView extends FrameLayout {
}
}
if (process) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height, 0, 0, MODE_PROCESS);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, 0, 0, MODE_PROCESS);
}
if (process || draw) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height,
- mCommittedScrollX, mCommittedScrollY, MODE_DRAW);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, mCommittedScrollX,
+ mCommittedScrollY, MODE_DRAW);
}
if (waitForCompletion) {
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698