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

Unified Diff: cc/resources/tile_draw_info.h

Issue 1139673008: cc: Make IsReadyToDraw/NeedsRaster usage consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/resources/tile.cc ('k') | cc/resources/tile_draw_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_draw_info.h
diff --git a/cc/resources/tile_draw_info.h b/cc/resources/tile_draw_info.h
index 0c6bbf61286b5d8f57f7e2fefe5d3579da608dd0..7db805fbe9b721ab065fefd2f35aa4486c954129 100644
--- a/cc/resources/tile_draw_info.h
+++ b/cc/resources/tile_draw_info.h
@@ -24,7 +24,29 @@ class CC_EXPORT TileDrawInfo {
Mode mode() const { return mode_; }
- bool IsReadyToDraw() const;
+ bool IsReadyToDraw() const {
+ switch (mode_) {
+ case RESOURCE_MODE:
+ return !!resource_;
+ case SOLID_COLOR_MODE:
+ case OOM_MODE:
+ return true;
+ }
+ NOTREACHED();
+ return false;
+ }
+ bool NeedsRaster() const {
+ switch (mode_) {
+ case RESOURCE_MODE:
+ return !resource_;
+ case SOLID_COLOR_MODE:
+ return false;
+ case OOM_MODE:
+ return true;
+ }
+ NOTREACHED();
+ return false;
+ }
ResourceProvider::ResourceId resource_id() const {
DCHECK(mode_ == RESOURCE_MODE);
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/resources/tile_draw_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698