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

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

Issue 12041009: [Android WebView] Migrate the rendering code to a separate set of classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated and rebased. Created 7 years, 10 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
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 9d98d6e65d273c63b059a93195212f448e0e05d8..d28a403e449f49066588b136fb4f2a65e068723f 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -317,8 +317,8 @@ public class AwContents {
public int getAwDrawGLViewContext() {
// Using the native pointer as the returned viewContext. This is matched by the
- // reinterpret_cast back to AwContents pointer in the native DrawGLFunction.
- return mNativeAwContents;
+ // reinterpret_cast back to BrowserViewRenderer pointer in the native DrawGLFunction.
+ return nativeGetAwDrawGLViewContext(mNativeAwContents);
}
public boolean onPrepareDrawGL(Canvas canvas) {
@@ -974,38 +974,6 @@ public class AwContents {
return null;
}
- /**
- * Provides a Bitmap object with a given width and height used for auxiliary rasterization.
- */
- @CalledByNative
- private static Bitmap createBitmap(int width, int height) {
- return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- }
-
- /**
- * Draws a provided bitmap into a canvas.
- * Used for convenience from the native side and other static helper methods.
- */
- @CalledByNative
- private static void drawBitmapIntoCanvas(Bitmap bitmap, Canvas canvas) {
- canvas.drawBitmap(bitmap, 0, 0, null);
- }
-
- /**
- * Creates a new Picture that records drawing a provided bitmap.
- * Will return an empty Picture if the Bitmap is null.
- */
- @CalledByNative
- private static Picture recordBitmapIntoPicture(Bitmap bitmap) {
- Picture picture = new Picture();
- if (bitmap != null) {
- Canvas recordingCanvas = picture.beginRecording(bitmap.getWidth(), bitmap.getHeight());
- drawBitmapIntoCanvas(bitmap, recordingCanvas);
- picture.endRecording();
- }
- return picture;
- }
-
@CalledByNative
private void handleJsAlert(String url, String message, JsResultReceiver receiver) {
mContentsClient.handleJsAlert(url, message, receiver);
@@ -1051,8 +1019,6 @@ public class AwContents {
private native void nativeAddVisitedLinks(int nativeAwContents, String[] visitedLinks);
- private native boolean nativeDrawSW(int nativeAwContents, Canvas canvas, int clipX, int clipY,
- int clipW, int clipH);
private native void nativeSetScrollForHWFrame(int nativeAwContents, int scrollX, int scrollY);
private native int nativeFindAllSync(int nativeAwContents, String searchString);
private native void nativeFindAllAsync(int nativeAwContents, String searchString);
@@ -1081,6 +1047,9 @@ public class AwContents {
private native void nativeSetWebContents(int nativeAwContents, int nativeNewWebContents);
private native void nativeFocusFirstNode(int nativeAwContents);
+ private native boolean nativeDrawSW(int nativeAwContents, Canvas canvas, int clipX, int clipY,
+ int clipW, int clipH);
+ private native int nativeGetAwDrawGLViewContext(int nativeAwContents);
private native Picture nativeCapturePicture(int nativeAwContents);
private native void nativeEnableOnNewPicture(int nativeAwContents, boolean enabled,
boolean invalidationOnly);

Powered by Google App Engine
This is Rietveld 408576698