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

Unified Diff: cc/tile_drawing_info.cc

Issue 12353003: cc: Refactored Tile::GetResourceId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed forward declare Created 7 years, 10 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
« cc/tile_drawing_info.h ('K') | « cc/tile_drawing_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_drawing_info.cc
diff --git a/cc/tile_drawing_info.cc b/cc/tile_drawing_info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..381f225775561c1a8aeee763f8a6b18ad8120565
--- /dev/null
+++ b/cc/tile_drawing_info.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/tile_drawing_info.h"
+#include "cc/tile.h"
+
+namespace cc {
+
+bool TileDrawingInfo::is_ready_to_draw() const {
+ switch(mode_) {
+ case TEXTURE_MODE:
+ return tile_->managed_state_.resource &&
enne (OOO) 2013/02/27 22:13:57 This conditional should just call GetResourceId().
+ !tile_->managed_state_.resource_is_being_initialized &&
+ tile_->managed_state_.resource->id();
+ case SOLID_COLOR_MODE:
+ case TRANSPARENT_MODE:
+ case PICTURE_PILE_MODE:
+ return true;
+ default:
+ return false;
enne (OOO) 2013/02/27 22:13:57 Maybe also NOTREACHED()?
+ }
+}
+
+ResourceProvider::ResourceId TileDrawingInfo::get_resource_id() const {
+ DCHECK(mode_ == TEXTURE_MODE);
+ DCHECK(tile_->managed_state_.resource);
+ DCHECK(!tile_->managed_state_.resource_is_being_initialized);
+
+ return tile_->managed_state_.resource->id();
+}
+
+} // namespace cc
« cc/tile_drawing_info.h ('K') | « cc/tile_drawing_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698