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

Unified Diff: cc/layers/heads_up_display_layer.cc

Issue 23364004: Implementation of device metrics emulation in render view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Moved helper class to cc Created 7 years, 3 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: cc/layers/heads_up_display_layer.cc
===================================================================
--- cc/layers/heads_up_display_layer.cc (revision 221161)
+++ cc/layers/heads_up_display_layer.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/debug/trace_event.h"
#include "cc/layers/heads_up_display_layer_impl.h"
#include "cc/trees/layer_tree_host.h"
+#include "ui/gfx/size_conversions.h"
namespace cc {
@@ -26,6 +27,16 @@
device_viewport.width() / device_scale_factor,
device_viewport.height() / device_scale_factor);
+ if (parent()) {
danakj 2013/09/19 17:07:45 I don't know how you'd get a HUD layer without a p
dgozman 2013/09/19 18:42:18 I saw some code like this around hud layer. I'm pr
+ // The root layer may have the transform set. As we still want to be shown
+ // at the corner of visible viewport, apply inverted transform to it.
+ gfx::Transform invert;
+ gfx::RectF rect(device_viewport_in_layout_pixels);
+ if (parent()->transform().TransformRectReverse(&rect)) {
+ device_viewport_in_layout_pixels = gfx::ToFlooredSize(rect.size());
danakj 2013/09/19 17:07:45 You're projecting from the root surface to the roo
dgozman 2013/09/19 18:42:18 Yep, root layer has a scale transform. I'm not sur
aelias_OOO_until_Jul13 2013/09/19 21:35:28 The Blink-supplied root layer is the one and only
dgozman 2013/09/27 19:02:03 Filed a separate bug for this. I will look into mo
+ }
+ }
+
gfx::Size bounds;
gfx::Transform matrix;
matrix.MakeIdentity();
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.h » ('j') | content/renderer/render_view_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698