Chromium Code Reviews| 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..fc0513cf3074f8a07121c518612e4aaab9e09757 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 |
| @@ -146,7 +146,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 +182,7 @@ public class AwTestContainerView extends FrameLayout { |
| final boolean draw; |
| final boolean process; |
| final boolean waitForCompletion; |
| + long viewContext = 0; |
|
boliu
2016/05/05 14:09:35
you can follow the same pattern as above, final wi
Tobias Sargeant
2016/05/05 19:06:46
Done.
|
| synchronized (mSyncLock) { |
| if (!mFunctorAttached) { |
| @@ -193,9 +193,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 +206,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, |
|
boliu
2016/05/05 14:09:34
so mViewContext wasn't thread safe
is mCommittedS
Tobias Sargeant
2016/05/05 19:06:46
The move to two functors/view contexts made it uns
boliu
2016/05/05 21:40:32
Oh good point.
And mCommittedScrollX/Y are save b
|
| + mCommittedScrollY, MODE_DRAW); |
| } |
| if (waitForCompletion) { |