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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 176943004: [Android] Implement asynchronous zero-copy bitmap capture API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 83a974da9d8d20ca33eab34d38b9dbe2914e9888..f1a017f12b25f68f6778a79f4f621e57a51d1448 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1063,6 +1063,16 @@ public class ContentViewCore
return null;
}
+ public void getBitmapAsync(int x, int y, int width, int height,
+ float scale, Bitmap.Config bitmapConfig) {
+ if (mNativeContentViewCore == 0 || width == 0 || height == 0
+ || getViewportWidthPix() == 0 || getViewportHeightPix() == 0) {
+ return;
+ }
+ nativePopulateBitmapFromCompositorAsync(mNativeContentViewCore,
+ x, y, width, height, scale, bitmapConfig);
+ }
+
/**
* Generates a bitmap of the content that is performance optimized based on capture time.
*
@@ -1233,6 +1243,12 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
+ private void onBitmapReady(boolean result, Bitmap bitmap) {
+
+ }
+
+ @SuppressWarnings("unused")
+ @CalledByNative
private void onFlingStartEventConsumed(int vx, int vy) {
temporarilyHideTextHandles();
for (mGestureStateListenersIterator.rewind();
@@ -3446,6 +3462,9 @@ public class ContentViewCore
private native boolean nativePopulateBitmapFromCompositor(long nativeContentViewCoreImpl,
Bitmap bitmap);
+ private native void nativePopulateBitmapFromCompositorAsync(long nativeContentViewCoreImpl,
+ int x, int y, int width, int height, float scale, Bitmap.Config bitmapConfig);
+
private native void nativeWasResized(long nativeContentViewCoreImpl);
private native boolean nativeIsRenderWidgetHostViewReady(long nativeContentViewCoreImpl);

Powered by Google App Engine
This is Rietveld 408576698