diff options
author | egraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 21:26:54 +0000 |
---|---|---|
committer | egraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 21:26:54 +0000 |
commit | 7a5673c91345ea1bbc6f177fc0a877a01b13d725 (patch) | |
tree | a3f64f1a8dc38b12ca7781593f596308834c4e4d /cc | |
parent | b5b60d6240ce465ed6b88c66e6ef4f87fd443e8d (diff) | |
download | chromium_src-7a5673c91345ea1bbc6f177fc0a877a01b13d725.zip chromium_src-7a5673c91345ea1bbc6f177fc0a877a01b13d725.tar.gz chromium_src-7a5673c91345ea1bbc6f177fc0a877a01b13d725.tar.bz2 |
cc: fix HudLayer to be sized by device
This change switches the HudLayer to be sized based on deviceViewPort
and deviceScaleFactor instead of layoutViewPort. This way the hudLayer's
content does not go offscreen in case --enable-fixed-layout is used.
BUG=173603
Review URL: https://chromiumcodereview.appspot.com/12316005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/heads_up_display_layer.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cc/heads_up_display_layer.cc b/cc/heads_up_display_layer.cc index cfbfea7..ceec6a0 100644 --- a/cc/heads_up_display_layer.cc +++ b/cc/heads_up_display_layer.cc @@ -30,17 +30,20 @@ void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; + int deviceViewportInLayoutPixelsWidth = layerTreeHost()->deviceViewportSize().width() / layerTreeHost()->deviceScaleFactor(); + int deviceViewportInLayoutPixelsHeight = layerTreeHost()->deviceViewportSize().height() / layerTreeHost()->deviceScaleFactor(); + gfx::Size bounds; gfx::Transform matrix; matrix.MakeIdentity(); if (debugState.showPlatformLayerTree || debugState.showHudRects()) { - int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize().width()); - int height = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize().height()); + int width = std::min(maxTextureSize, deviceViewportInLayoutPixelsWidth); + int height = std::min(maxTextureSize, deviceViewportInLayoutPixelsHeight); bounds = gfx::Size(width, height); } else { bounds = gfx::Size(256, 256); - matrix.Translate(layerTreeHost()->layoutViewportSize().width() - 256, 0); + matrix.Translate(deviceViewportInLayoutPixelsWidth - 256, 0); } setBounds(bounds); |