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

Side by Side Diff: cc/test/tiled_layer_test_common.cc

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/tiled_layer_test_common.h" 5 #include "cc/test/tiled_layer_test_common.h"
6 6
7 using cc::LayerTilingData; 7 using cc::LayerTilingData;
8 using cc::LayerUpdater; 8 using cc::LayerUpdater;
9 using cc::PriorityCalculator; 9 using cc::PriorityCalculator;
10 using cc::PrioritizedResource; 10 using cc::PrioritizedResource;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 cc::PrioritizedResourceManager* FakeTiledLayer::resourceManager() const 132 cc::PrioritizedResourceManager* FakeTiledLayer::resourceManager() const
133 { 133 {
134 return m_resourceManager; 134 return m_resourceManager;
135 } 135 }
136 136
137 cc::LayerUpdater* FakeTiledLayer::updater() const 137 cc::LayerUpdater* FakeTiledLayer::updater() const
138 { 138 {
139 return m_fakeUpdater.get(); 139 return m_fakeUpdater.get();
140 } 140 }
141 141
142 gfx::Size FakeTiledLayerWithScaledBounds::contentBounds() const 142 void FakeTiledLayerWithScaledBounds::setContentBounds(const gfx::Size& contentBo unds)
143 { 143 {
144 return m_forcedContentBounds; 144 m_forcedContentBounds = contentBounds;
145 didUpdateBounds();
145 } 146 }
146 147
147 float FakeTiledLayerWithScaledBounds::contentsScaleX() const 148 void FakeTiledLayerWithScaledBounds::setIdealContentsScale(float scale)
148 { 149 {
149 return static_cast<float>(m_forcedContentBounds.width()) / bounds().width(); 150 m_drawProperties.ideal_contents_scale = scale;
151 m_drawProperties.contents_scale_x = static_cast<float>(m_forcedContentBounds .width()) / bounds().width();
152 m_drawProperties.contents_scale_y = static_cast<float>(m_forcedContentBounds .height()) / bounds().height();
153 didUpdateBounds();
150 } 154 }
151 155
152 float FakeTiledLayerWithScaledBounds::contentsScaleY() const 156 void FakeTiledLayerWithScaledBounds::didUpdateBounds()
153 { 157 {
154 return static_cast<float>(m_forcedContentBounds.height()) / bounds().height( ); 158 m_drawProperties.content_bounds = m_forcedContentBounds;
155 }
156
157 void FakeTiledLayerWithScaledBounds::setContentsScale(float)
158 {
159 NOTREACHED();
160 } 159 }
161 160
162 } // namespace 161 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698