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

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: Style 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()) {
+ // The root layer may have the transform set. As we still want to be shown
aelias_OOO_until_Jul13 2013/09/13 23:51:44 This should be addressed on the Blink side instead
dgozman 2013/09/19 10:17:11 AFAIK, blink doesn't know about the HUD layer. Ide
+ // 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());
+ }
+ }
+
gfx::Size bounds;
gfx::Transform matrix;
matrix.MakeIdentity();

Powered by Google App Engine
This is Rietveld 408576698