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

Side by Side Diff: cc/resources/picture_layer_tiling.h

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 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 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void SetLayerBounds(const gfx::Size& layer_bounds); 124 void SetLayerBounds(const gfx::Size& layer_bounds);
125 void Invalidate(const Region& layer_region); 125 void Invalidate(const Region& layer_region);
126 void CreateMissingTilesInLiveTilesRect(); 126 void CreateMissingTilesInLiveTilesRect();
127 127
128 void SetCanUseLCDText(bool can_use_lcd_text); 128 void SetCanUseLCDText(bool can_use_lcd_text);
129 129
130 void SetClient(PictureLayerTilingClient* client); 130 void SetClient(PictureLayerTilingClient* client);
131 void set_resolution(TileResolution resolution) { resolution_ = resolution; } 131 void set_resolution(TileResolution resolution) { resolution_ = resolution; }
132 TileResolution resolution() const { return resolution_; } 132 TileResolution resolution() const { return resolution_; }
133 133
134 gfx::Rect ContentRect() const; 134 gfx::Rect TilingRect() const;
135 gfx::SizeF ContentSizeF() const;
136 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } 135 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; }
137 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } 136 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); }
138 float contents_scale() const { return contents_scale_; } 137 float contents_scale() const { return contents_scale_; }
139 138
140 Tile* TileAt(int i, int j) const { 139 Tile* TileAt(int i, int j) const {
141 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); 140 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j));
142 return (iter == tiles_.end()) ? NULL : iter->second.get(); 141 return (iter == tiles_.end()) ? NULL : iter->second.get();
143 } 142 }
144 143
145 void CreateAllTilesForTesting() { 144 void CreateAllTilesForTesting() {
146 SetLiveTilesRect(gfx::Rect(tiling_data_.total_size())); 145 SetLiveTilesRect(tiling_data_.tiling_rect());
147 } 146 }
148 147
149 std::vector<Tile*> AllTilesForTesting() const { 148 std::vector<Tile*> AllTilesForTesting() const {
150 std::vector<Tile*> all_tiles; 149 std::vector<Tile*> all_tiles;
151 for (TileMap::const_iterator it = tiles_.begin(); 150 for (TileMap::const_iterator it = tiles_.begin();
152 it != tiles_.end(); ++it) 151 it != tiles_.end(); ++it)
153 all_tiles.push_back(it->second.get()); 152 all_tiles.push_back(it->second.get());
154 return all_tiles; 153 return all_tiles;
155 } 154 }
156 155
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 300
302 private: 301 private:
303 DISALLOW_ASSIGN(PictureLayerTiling); 302 DISALLOW_ASSIGN(PictureLayerTiling);
304 303
305 RectExpansionCache expansion_cache_; 304 RectExpansionCache expansion_cache_;
306 }; 305 };
307 306
308 } // namespace cc 307 } // namespace cc
309 308
310 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ 309 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698