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

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

Issue 1145273003: aw: Force auxiliary bitmap on android emulators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | android_webview/native/aw_contents.cc » ('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 ca024f95035d1d8731ad61803d947d59b16c5d0f..7a176a06f98c619abd8ad9c9bc5998d11332d48d 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -100,6 +100,9 @@ public class AwContents implements SmartClipProvider,
// produce little visible difference.
private static final float ZOOM_CONTROLS_EPSILON = 0.007f;
+ private static final boolean FORCE_AUXILIARY_BITMAP_RENDERING =
+ "goldfish".equals(Build.HARDWARE);
+
/**
* WebKit hit test related data structure. These are used to implement
* getHitTestResult, requestFocusNodeHref, requestImageRef methods in WebView.
@@ -1114,6 +1117,8 @@ public class AwContents implements SmartClipProvider,
public static void setAwDrawSWFunctionTable(long functionTablePointer) {
nativeSetAwDrawSWFunctionTable(functionTablePointer);
+ // Force auxiliary bitmap rendering in emulators.
+ nativeSetForceAuxiliaryBitmapRendering(FORCE_AUXILIARY_BITMAP_RENDERING);
}
public static void setAwDrawGLFunctionTable(long functionTablePointer) {
@@ -2714,7 +2719,7 @@ public class AwContents implements SmartClipProvider,
mContainerView.getScrollX(), mContainerView.getScrollY(),
globalVisibleRect.left, globalVisibleRect.top,
globalVisibleRect.right, globalVisibleRect.bottom);
- if (did_draw && canvas.isHardwareAccelerated()) {
+ if (did_draw && canvas.isHardwareAccelerated() && !FORCE_AUXILIARY_BITMAP_RENDERING) {
did_draw = mNativeGLDelegate.requestDrawGL(canvas, false, mContainerView);
}
if (!did_draw) {
@@ -2990,6 +2995,8 @@ public class AwContents implements SmartClipProvider,
private static native long nativeInit(AwBrowserContext browserContext);
private static native void nativeDestroy(long nativeAwContents);
+ private static native void nativeSetForceAuxiliaryBitmapRendering(
+ boolean forceAuxiliaryBitmapRendering);
private static native void nativeSetAwDrawSWFunctionTable(long functionTablePointer);
private static native void nativeSetAwDrawGLFunctionTable(long functionTablePointer);
private static native long nativeGetAwDrawGLFunction();
« no previous file with comments | « no previous file | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698