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

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

Issue 286513002: Revert of Make ContentViewRenderView::CompositeToBitmap not CompositeAndReadback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « content/browser/android/content_view_render_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
index 445f4223e947b1b5829901c62692c0b1336be90f..67596976c6aa6ad03cc8ac0e18da1a403533acd7 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
@@ -167,7 +167,18 @@
* @return The created SurfaceView object.
*/
protected SurfaceView createSurfaceView(Context context) {
- return new SurfaceView(context);
+ return new SurfaceView(context) {
+ @Override
+ public void onDraw(Canvas canvas) {
+ // We only need to draw to software canvases, which are used for taking screenshots.
+ if (canvas.isHardwareAccelerated()) return;
+ Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(),
+ Bitmap.Config.ARGB_8888);
+ if (nativeCompositeToBitmap(mNativeContentViewRenderView, bitmap)) {
+ canvas.drawBitmap(bitmap, 0, 0, null);
+ }
+ }
+ };
}
/**
@@ -258,6 +269,7 @@
private native void nativeSurfaceChanged(long nativeContentViewRenderView,
int format, int width, int height, Surface surface);
private native boolean nativeComposite(long nativeContentViewRenderView);
+ private native boolean nativeCompositeToBitmap(long nativeContentViewRenderView, Bitmap bitmap);
private native void nativeSetOverlayVideoMode(long nativeContentViewRenderView,
boolean enabled);
}
« no previous file with comments | « content/browser/android/content_view_render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698