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

Unified Diff: cc/damage_tracker.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/damage_tracker.cc
diff --git a/cc/damage_tracker.cc b/cc/damage_tracker.cc
index 4c27d4d559e30607e45741e232aabd8879e75ee1..d36cbc00b02553cceb667c56e9a3a3ae29c812d4 100644
--- a/cc/damage_tracker.cc
+++ b/cc/damage_tracker.cc
@@ -268,9 +268,7 @@ void DamageTracker::extendDamageForLayer(LayerImpl* layer, FloatRect& targetDama
// If the layer properties havent changed, then the the target surface is only
// affected by the layer's update area, which could be empty.
FloatRect updateContentRect = layer->updateRect();
- float widthScale = layer->contentBounds().width() / static_cast<float>(layer->bounds().width());
- float heightScale = layer->contentBounds().height() / static_cast<float>(layer->bounds().height());
- updateContentRect.scale(widthScale, heightScale);
+ updateContentRect.scale(layer->contentsScaleX(), layer->contentsScaleY());
danakj 2012/10/29 20:06:51 Can we use Layer::layerRectToContentRect() here? T
wangxianzhu 2012/10/30 02:14:21 Done. However, I'm wondering if enclosingIntRect()
danakj 2012/10/30 15:56:19 Right, but part of a pixel can't be invalid, so I
FloatRect updateRectInTargetSpace = MathUtil::mapClippedRect(layer->drawTransform(), updateContentRect);
targetDamageRect.uniteIfNonZero(updateRectInTargetSpace);

Powered by Google App Engine
This is Rietveld 408576698