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

Unified Diff: cc/tile.h

Issue 12084031: A host of micro-optimizations and a refactor of TimeForBoundsToIntersect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasing to tip of tree Created 7 years, 11 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
« no previous file with comments | « cc/picture_layer_tiling.cc ('k') | cc/tile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile.h
diff --git a/cc/tile.h b/cc/tile.h
index fb0c3f3ca9b7c89c9ea99a305dbb54fa4db4014a..d438d8ef94408ab933df259a0f1f839d3b3ed2a6 100644
--- a/cc/tile.h
+++ b/cc/tile.h
@@ -42,10 +42,20 @@ class CC_EXPORT Tile : public base::RefCounted<Tile> {
priority_[PENDING_TREE]);
}
- void set_priority(WhichTree tree, const TilePriority& priority);
+ void set_priority(WhichTree tree, const TilePriority& priority) {
+ tile_manager_->WillModifyTilePriority(this, tree, priority);
+ priority_[tree] = priority;
+ }
// Returns 0 if not drawable.
- ResourceProvider::ResourceId GetResourceId() const;
+ ResourceProvider::ResourceId GetResourceId() const {
+ if (!managed_state_.resource)
+ return 0;
+ if (managed_state_.resource_is_being_initialized)
+ return 0;
+
+ return managed_state_.resource->id();
+ }
const gfx::Rect& opaque_rect() const { return opaque_rect_; }
@@ -66,7 +76,12 @@ class CC_EXPORT Tile : public base::RefCounted<Tile> {
friend class BinComparator;
ManagedTileState& managed_state() { return managed_state_; }
const ManagedTileState& managed_state() const { return managed_state_; }
- size_t bytes_consumed_if_allocated() const;
+
+ inline size_t bytes_consumed_if_allocated() const {
+ DCHECK(format_ == GL_RGBA);
+ return 4 * tile_size_.width() * tile_size_.height();
+ }
+
// Normal private methods.
friend class base::RefCounted<Tile>;
« no previous file with comments | « cc/picture_layer_tiling.cc ('k') | cc/tile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698