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

Unified Diff: cc/tiles/tile.cc

Issue 1318733006: cc: Do the math for a tile's content rect in layer space once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/tiles/tile.cc
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc
index ad50dd1c91f502d2033a3fabab00d482d3a06175..421c045b8576e801663671a9317a1ab4476edb42 100644
--- a/cc/tiles/tile.cc
+++ b/cc/tiles/tile.cc
@@ -17,27 +17,24 @@ namespace cc {
Tile::Id Tile::s_next_id_ = 1;
Tile::Tile(TileManager* tile_manager,
- const gfx::Size& desired_texture_size,
- const gfx::Rect& content_rect,
- float contents_scale,
+ const CreateInfo& info,
vmpstr 2015/08/28 21:05:30 Also, why not just store the info?
danakj 2015/08/31 21:12:12 Well, that would add a lot of indirections/typing
vmpstr 2015/08/31 21:15:10 Makes sense.
int layer_id,
int source_frame_number,
int flags)
: tile_manager_(tile_manager),
- desired_texture_size_(desired_texture_size),
- content_rect_(content_rect),
- contents_scale_(contents_scale),
+ content_rect_(info.content_rect),
+ enclosing_layer_rect_(info.enclosing_layer_rect),
+ contents_scale_(info.contents_scale),
layer_id_(layer_id),
source_frame_number_(source_frame_number),
flags_(flags),
- tiling_i_index_(-1),
- tiling_j_index_(-1),
+ tiling_i_index_(info.tiling_i_index),
+ tiling_j_index_(info.tiling_j_index),
required_for_activation_(false),
required_for_draw_(false),
id_(s_next_id_++),
invalidated_id_(0),
- scheduled_priority_(0) {
-}
+ scheduled_priority_(0) {}
Tile::~Tile() {
TRACE_EVENT_OBJECT_DELETED_WITH_ID(
@@ -78,8 +75,7 @@ size_t Tile::GPUMemoryUsageInBytes() const {
}
void Tile::Deleter::operator()(Tile* tile) const {
- TileManager* tile_manager = tile->tile_manager_;
- tile_manager->Release(tile);
+ tile->tile_manager_->Release(tile);
}
} // namespace cc
« cc/tiles/picture_layer_tiling.cc ('K') | « cc/tiles/tile.h ('k') | cc/tiles/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698