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

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

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Git cl format 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
« no previous file with comments | « cc/layers/tiled_layer_impl_unittest.cc ('k') | cc/resources/layer_tiling_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_LAYER_TILING_DATA_H_ 5 #ifndef CC_RESOURCES_LAYER_TILING_DATA_H_
6 #define CC_RESOURCES_LAYER_TILING_DATA_H_ 6 #define CC_RESOURCES_LAYER_TILING_DATA_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 DISALLOW_COPY_AND_ASSIGN(Tile); 74 DISALLOW_COPY_AND_ASSIGN(Tile);
75 }; 75 };
76 typedef std::pair<int, int> TileMapKey; 76 typedef std::pair<int, int> TileMapKey;
77 typedef base::ScopedPtrHashMap<TileMapKey, Tile> TileMap; 77 typedef base::ScopedPtrHashMap<TileMapKey, Tile> TileMap;
78 78
79 void AddTile(scoped_ptr<Tile> tile, int i, int j); 79 void AddTile(scoped_ptr<Tile> tile, int i, int j);
80 scoped_ptr<Tile> TakeTile(int i, int j); 80 scoped_ptr<Tile> TakeTile(int i, int j);
81 Tile* TileAt(int i, int j) const; 81 Tile* TileAt(int i, int j) const;
82 const TileMap& tiles() const { return tiles_; } 82 const TileMap& tiles() const { return tiles_; }
83 83
84 void SetBounds(const gfx::Size& size); 84 void SetTilingRect(const gfx::Rect& tiling_rect);
85 gfx::Size bounds() const { return tiling_data_.total_size(); } 85 gfx::Rect tiling_rect() const { return tiling_data_.tiling_rect(); }
86 86
87 void ContentRectToTileIndices(const gfx::Rect& rect, 87 void ContentRectToTileIndices(const gfx::Rect& rect,
88 int* left, 88 int* left,
89 int* top, 89 int* top,
90 int* right, 90 int* right,
91 int* bottom) const; 91 int* bottom) const;
92 gfx::Rect TileRect(const Tile* tile) const; 92 gfx::Rect TileRect(const Tile* tile) const;
93 93
94 Region OpaqueRegionInContentRect(const gfx::Rect& rect) const; 94 Region OpaqueRegionInContentRect(const gfx::Rect& rect) const;
95 95
96 void reset() { tiles_.clear(); } 96 void reset() { tiles_.clear(); }
97 97
98 protected: 98 protected:
99 LayerTilingData(const gfx::Size& tile_size, BorderTexelOption option); 99 LayerTilingData(const gfx::Size& tile_size, BorderTexelOption option);
100 100
101 TileMap tiles_; 101 TileMap tiles_;
102 TilingData tiling_data_; 102 TilingData tiling_data_;
103 103
104 DISALLOW_COPY(LayerTilingData); 104 DISALLOW_COPY(LayerTilingData);
105 }; 105 };
106 106
107 } // namespace cc 107 } // namespace cc
108 108
109 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_ 109 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_impl_unittest.cc ('k') | cc/resources/layer_tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698