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

Unified Diff: cc/heads_up_display_layer_impl.cc

Issue 11415208: cc: Fix hudLayer size and paint rects scale for deviceScaleFactor != 1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 170476 Created 8 years, 1 month 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 | « cc/heads_up_display_layer.cc ('k') | 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_impl.cc
diff --git a/cc/heads_up_display_layer_impl.cc b/cc/heads_up_display_layer_impl.cc
index fd57449e64ff5f2cde1f418130f6bea882dae56f..0ca7fe5ea60873d6c0128dfdd0f950a941826818 100644
--- a/cc/heads_up_display_layer_impl.cc
+++ b/cc/heads_up_display_layer_impl.cc
@@ -311,6 +311,10 @@ void HeadsUpDisplayLayerImpl::drawFPSCounterGraphAndHistogram(SkCanvas* canvas,
void HeadsUpDisplayLayerImpl::drawDebugRects(SkCanvas* canvas, DebugRectHistory* debugRectHistory)
{
const std::vector<DebugRect>& debugRects = debugRectHistory->debugRects();
+ float rectScale = 1 / layerTreeHostImpl()->deviceScaleFactor();
+
+ canvas->save();
+ canvas->scale(rectScale, rectScale);
for (size_t i = 0; i < debugRects.size(); ++i) {
SkColor strokeColor = 0;
@@ -366,6 +370,8 @@ void HeadsUpDisplayLayerImpl::drawDebugRects(SkCanvas* canvas, DebugRectHistory*
paint.setStrokeWidth(SkFloatToScalar(strokeWidth));
canvas->drawRect(skRect, paint);
}
+
+ canvas->restore();
}
const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
« no previous file with comments | « cc/heads_up_display_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698