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

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

Issue 687803009: aw: Add test to ensure hardware mode works (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blank line Created 6 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 | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java ('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 3f99e9bfa37aa406d85d98b3d291e7c16468635a..9d40ddcb0dc301af934fa72b621c937e1089383d 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
@@ -39,7 +39,7 @@ public class AwTestContainerView extends FrameLayout {
private AwContents.NativeGLDelegate mNativeGLDelegate;
private AwContents.InternalAccessDelegate mInternalAccessDelegate;
- HardwareView mHardwareView = null;
+ private HardwareView mHardwareView = null;
private boolean mAttachedContents = false;
private class HardwareView extends GLSurfaceView {
@@ -232,7 +232,7 @@ public class AwTestContainerView extends FrameLayout {
if (allowHardwareAcceleration) {
mHardwareView = createHardwareViewOnlyOnce(context);
}
- if (mHardwareView != null) {
+ if (isBackedByHardwareView()) {
addView(mHardwareView,
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
@@ -249,12 +249,16 @@ public class AwTestContainerView extends FrameLayout {
public void initialize(AwContents awContents) {
mAwContents = awContents;
- if (mHardwareView != null) {
+ if (isBackedByHardwareView()) {
mHardwareView.initialize(
mAwContents.getAwDrawGLFunction(), mAwContents.getAwDrawGLViewContext());
}
}
+ public boolean isBackedByHardwareView() {
+ return mHardwareView != null;
+ }
+
public ContentViewCore getContentViewCore() {
return mAwContents.getContentViewCore();
}
@@ -380,7 +384,7 @@ public class AwTestContainerView extends FrameLayout {
@Override
public void onDraw(Canvas canvas) {
- if (mHardwareView != null) {
+ if (isBackedByHardwareView()) {
mHardwareView.updateScroll(getScrollX(), getScrollY());
}
mAwContents.onDraw(canvas);
@@ -417,14 +421,14 @@ public class AwTestContainerView extends FrameLayout {
@Override
public boolean requestDrawGL(Canvas canvas, boolean waitForCompletion,
View containerview) {
- if (mHardwareView == null) return false;
+ if (!isBackedByHardwareView()) return false;
mHardwareView.requestRender(canvas, waitForCompletion);
return true;
}
@Override
public void detachGLFunctor() {
- if (mHardwareView != null) mHardwareView.detachGLFunctor();
+ if (isBackedByHardwareView()) mHardwareView.detachGLFunctor();
}
}
@@ -466,7 +470,7 @@ public class AwTestContainerView extends FrameLayout {
public void super_scrollTo(int scrollX, int scrollY) {
// We're intentionally not calling super.scrollTo here to make testing easier.
AwTestContainerView.this.scrollTo(scrollX, scrollY);
- if (mHardwareView != null) {
+ if (isBackedByHardwareView()) {
// Undo the scroll that will be applied because of mHardwareView
// being a child of |this|.
mHardwareView.setTranslationX(scrollX);
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698