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

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: WIP:Handle Left out paths on Android/Aura for Async ReadBack Created 6 years, 11 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 c1aa70b52ef90ce1733e1576ad58885982f04060..6f88860333583fcc244a887a1dbb5050b77e46c9 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -670,7 +670,8 @@ 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;
@@ -680,6 +681,7 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface(
request = cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
&RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult,
dst_size_in_pixel,
+ bitmap_config,
start_time,
callback));
} else {
@@ -908,7 +910,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());
@@ -918,7 +921,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();
@@ -1466,9 +1469,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) {
+ //We have to draw to a new 565 bitmap and return that.
no sievers 2014/01/25 00:18:23 Do we just need to force it through the texture co
sivag 2014/01/25 17:38:46 You mean to say, when the src_subrect_in_pixel.siz
sivag 2014/01/27 15:12:16 Done.
sivag 2014/01/27 15:12:16 Done.
+ if (config != SkBitmap::kARGB_8888_Config) {
+ NOTIMPLEMENTED();
+ callback.Run(false, SkBitmap());
+ }
DCHECK(result->HasBitmap());
base::ScopedClosureRunner scoped_callback_runner(
base::Bind(callback, false, SkBitmap()));

Powered by Google App Engine
This is Rietveld 408576698