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

Unified Diff: cc/heads_up_display_layer.cc

Issue 12316005: cc: fix HudLayer to be sized by device (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/heads_up_display_layer.cc
diff --git a/cc/heads_up_display_layer.cc b/cc/heads_up_display_layer.cc
index cfbfea7af0825b4548419bb670eb20f270f0fb4e..72a8a6b014e0d11cee23b3d9db6dc584735ab28e 100644
--- a/cc/heads_up_display_layer.cc
+++ b/cc/heads_up_display_layer.cc
@@ -35,12 +35,12 @@ void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
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, static_cast<int>(layerTreeHost()->deviceViewportSize().width() / layerTreeHost()->deviceScaleFactor()));
danakj 2013/02/20 02:46:08 split these "static_cast<>(dVS.width/lTH.dSF)" par
+ int height = std::min(maxTextureSize, static_cast<int>(layerTreeHost()->deviceViewportSize().height() / layerTreeHost()->deviceScaleFactor()));
bounds = gfx::Size(width, height);
} else {
bounds = gfx::Size(256, 256);
- matrix.Translate(layerTreeHost()->layoutViewportSize().width() - 256, 0);
+ matrix.Translate(static_cast<int>(layerTreeHost()->deviceViewportSize().width() / layerTreeHost()->deviceScaleFactor()) - 256, 0);
}
setBounds(bounds);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698