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

Unified Diff: content/browser/devtools/protocol/color_picker.cc

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: REBASE Created 3 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/devtools/protocol/color_picker.cc
diff --git a/content/browser/devtools/protocol/color_picker.cc b/content/browser/devtools/protocol/color_picker.cc
index ac04aa4ac5378c56ac4d18874325df7f90e52b95..722df3358a6a27aefc045d62cb1c4350616de24e 100644
--- a/content/browser/devtools/protocol/color_picker.cc
+++ b/content/browser/devtools/protocol/color_picker.cc
@@ -83,11 +83,14 @@ void ColorPicker::UpdateFrame() {
if (!view)
return;
- gfx::Size size = view->GetViewBounds().size();
- view->CopyFromCompositingSurface(
- gfx::Rect(size), size,
- base::Bind(&ColorPicker::FrameUpdated,
- weak_factory_.GetWeakPtr()),
+ // TODO(miu): This is the wrong size. It's the size of the view on-screen, and
dgozman 2017/02/28 19:13:52 Does cc::CompositorFrameMetadata work? We have it
miu 2017/03/01 01:17:02 Possibly. Here, I'm not making any functional chan
+ // not the rendering size of the view. The latter is what is wanted here, so
+ // that the resulting bitmap's pixel coordinates line-up with the
+ // blink::WebMouseEvent coordinates. http://crbug.com/73362
+ gfx::Size should_be_rendering_size = view->GetViewBounds().size();
+ view->CopyFromSurface(
+ gfx::Rect(), should_be_rendering_size,
+ base::Bind(&ColorPicker::FrameUpdated, weak_factory_.GetWeakPtr()),
kN32_SkColorType);
}

Powered by Google App Engine
This is Rietveld 408576698