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

Unified Diff: cc/tiles/tile_draw_info.h

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: rebase Created 3 years, 8 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/tile.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 8ba08857dd22b5ac3113473320828598990e544c..dc1a88555069a284d0fb0d4d81c1116cda71ed27 100644
--- a/cc/tiles/tile_draw_info.h
+++ b/cc/tiles/tile_draw_info.h
@@ -77,6 +77,11 @@ class CC_EXPORT TileDrawInfo {
return resource_ ? IsResourceFormatCompressed(resource_->format()) : false;
}
+ bool is_checker_imaged() const {
+ DCHECK(!resource_is_checker_imaged_ || resource_);
+ return resource_is_checker_imaged_;
+ }
+
void SetSolidColorForTesting(SkColor color) { set_solid_color(color); }
void AsValueInto(base::trace_event::TracedValue* state) const;
@@ -87,9 +92,13 @@ class CC_EXPORT TileDrawInfo {
const Resource* resource() const { return resource_; }
- void set_resource(Resource* resource) {
+ void set_resource(Resource* resource, bool resource_is_checker_imaged) {
+ DCHECK(!resource_is_checker_imaged || resource)
+ << "Need to have a resource for it to be checker-imaged";
+
mode_ = RESOURCE_MODE;
is_resource_ready_to_draw_ = false;
+ resource_is_checker_imaged_ = resource_is_checker_imaged;
resource_ = resource;
}
@@ -111,6 +120,10 @@ class CC_EXPORT TileDrawInfo {
Resource* resource_ = nullptr;
bool contents_swizzled_ = false;
bool is_resource_ready_to_draw_ = false;
+
+ // Set to true if |resource_| was rasterized with checker-imaged content. The
+ // flag can only be true iff we have a valid |resource_|.
+ bool resource_is_checker_imaged_ = false;
};
} // namespace cc
« no previous file with comments | « cc/tiles/tile.h ('k') | cc/tiles/tile_draw_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698