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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 146873002: Handle Left out paths on Android/Aura for Async ReadBack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 6881a155b0518292309f0744f2d8b405c522061f..34819ab3fc881362cf88c60fb3b3cd8da412b140 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -670,16 +670,19 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface(
ConvertRectToPixel(device_scale_factor, src_subrect);
if (using_synchronous_compositor_) {
- SynchronousCopyContents(src_subrect_in_pixel, dst_size_in_pixel, callback);
+ SynchronousCopyContents(src_subrect_in_pixel, dst_size_in_pixel, callback,
+ bitmap_config);
UMA_HISTOGRAM_TIMES("Compositing.CopyFromSurfaceTimeSynchronous",
base::TimeTicks::Now() - start_time);
return;
}
scoped_ptr<cc::CopyOutputRequest> request;
- if (src_subrect_in_pixel.size() == dst_size_in_pixel) {
+ if ((src_subrect_in_pixel.size() == dst_size_in_pixel) &&
+ (bitmap_config == SkBitmap::kARGB_8888_Config)) {
request = cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
&RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult,
dst_size_in_pixel,
+ bitmap_config,
start_time,
callback));
} else {
@@ -924,7 +927,8 @@ void RenderWidgetHostViewAndroid::SetOverlayVideoMode(bool enabled) {
void RenderWidgetHostViewAndroid::SynchronousCopyContents(
const gfx::Rect& src_subrect_in_pixel,
const gfx::Size& dst_size_in_pixel,
- const base::Callback<void(bool, const SkBitmap&)>& callback) {
+ const base::Callback<void(bool, const SkBitmap&)>& callback,
+ const SkBitmap::Config config) {
SynchronousCompositor* compositor =
SynchronousCompositorImpl::FromID(host_->GetProcess()->GetID(),
host_->GetRoutingID());
@@ -934,7 +938,7 @@ void RenderWidgetHostViewAndroid::SynchronousCopyContents(
}
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config,
+ bitmap.setConfig(config,
dst_size_in_pixel.width(),
dst_size_in_pixel.height());
bitmap.allocPixels();
@@ -1460,9 +1464,15 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
// static
void RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult(
const gfx::Size& dst_size_in_pixel,
+ const SkBitmap::Config config,
const base::TimeTicks& start_time,
const base::Callback<void(bool, const SkBitmap&)>& callback,
scoped_ptr<cc::CopyOutputResult> result) {
+ if (config != SkBitmap::kARGB_8888_Config) {
+ NOTIMPLEMENTED();
+ callback.Run(false, SkBitmap());
+ return;
+ }
DCHECK(result->HasBitmap());
base::ScopedClosureRunner scoped_callback_runner(
base::Bind(callback, false, SkBitmap()));

Powered by Google App Engine
This is Rietveld 408576698