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

Unified Diff: cc/scrollbar_layer.cc

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/scrollbar_layer.h ('k') | cc/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer.cc
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc
index 8ebfc89346eba2fa07507f04f4474df47e5a0ff4..9fb96ff616cb500838ffc846af6ad4630dd1410d 100644
--- a/cc/scrollbar_layer.cc
+++ b/cc/scrollbar_layer.cc
@@ -68,11 +68,19 @@ float ScrollbarLayer::clampScaleToMaxTextureSize(float scale) {
return scale;
}
-void ScrollbarLayer::setContentsScale(float contentsScale) {
- contentsScale = clampScaleToMaxTextureSize(contentsScale);
- ContentsScalingLayer::setContentsScale(contentsScale);
- DCHECK_LE(contentBounds().width(), maxTextureSize());
- DCHECK_LE(contentBounds().height(), maxTextureSize());
+void ScrollbarLayer::calculateContentsScale(
+ float idealContentsScale,
+ float* contentsScaleX,
+ float* contentsScaleY,
+ gfx::Size* contentBounds)
+{
+ ContentsScalingLayer::calculateContentsScale(
+ clampScaleToMaxTextureSize(idealContentsScale),
+ contentsScaleX,
+ contentsScaleY,
+ contentBounds);
+ DCHECK_LE(contentBounds->width(), maxTextureSize());
+ DCHECK_LE(contentBounds->height(), maxTextureSize());
}
void ScrollbarLayer::pushPropertiesTo(LayerImpl* layer)
« no previous file with comments | « cc/scrollbar_layer.h ('k') | cc/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698