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

Unified Diff: cc/tiles/tile_draw_info.h

Issue 2555743004: Delay activation/draw on GPU tile work completion (Closed)
Patch Set: rebase compile fix Created 3 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/tiles/picture_layer_tiling.h ('k') | cc/tiles/tile_draw_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_draw_info.h
diff --git a/cc/tiles/tile_draw_info.h b/cc/tiles/tile_draw_info.h
index a51d27b9916df2e3b6aa73c0983f9f95f2005d5d..0a4db7586e1746227945bcb8b17448bc3f3992a6 100644
--- a/cc/tiles/tile_draw_info.h
+++ b/cc/tiles/tile_draw_info.h
@@ -27,7 +27,7 @@ class CC_EXPORT TileDrawInfo {
bool IsReadyToDraw() const {
switch (mode_) {
case RESOURCE_MODE:
- return !!resource_;
+ return is_resource_ready_to_draw_;
case SOLID_COLOR_MODE:
case OOM_MODE:
return true;
@@ -81,7 +81,6 @@ class CC_EXPORT TileDrawInfo {
void AsValueInto(base::trace_event::TracedValue* state) const;
- void set_was_ever_ready_to_draw() { was_ever_ready_to_draw_ = true; }
void set_was_ever_used_to_draw() { was_ever_used_to_draw_ = true; }
void set_was_a_prepaint_tile() { was_a_prepaint_tile_ = true; }
@@ -89,19 +88,34 @@ class CC_EXPORT TileDrawInfo {
friend class Tile;
friend class TileManager;
- void set_use_resource() { mode_ = RESOURCE_MODE; }
+ const Resource* resource() const { return resource_; }
+
+ void set_resource(Resource* resource) {
+ mode_ = RESOURCE_MODE;
+ is_resource_ready_to_draw_ = false;
+ resource_ = resource;
+ }
+
+ void set_resource_ready_for_draw() {
+ is_resource_ready_to_draw_ = true;
+ was_ever_ready_to_draw_ = true;
+ }
+
+ Resource* TakeResource();
void set_solid_color(const SkColor& color) {
mode_ = SOLID_COLOR_MODE;
solid_color_ = color;
+ was_ever_ready_to_draw_ = true;
}
void set_oom() { mode_ = OOM_MODE; }
- Mode mode_;
- SkColor solid_color_;
- Resource* resource_;
- bool contents_swizzled_;
+ Mode mode_ = RESOURCE_MODE;
+ SkColor solid_color_ = SK_ColorWHITE;
+ Resource* resource_ = nullptr;
+ bool contents_swizzled_ = false;
+ bool is_resource_ready_to_draw_ = false;
// Used for gathering UMA stats.
bool was_ever_ready_to_draw_ : 1;
« no previous file with comments | « cc/tiles/picture_layer_tiling.h ('k') | cc/tiles/tile_draw_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698