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

Unified Diff: cc/tiles/tile_draw_info.h

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: addressed comments Created 3 years, 9 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
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..16e718b0dfde6ce87212c714bf521c2a510025f6 100644
--- a/cc/tiles/tile_draw_info.h
+++ b/cc/tiles/tile_draw_info.h
@@ -77,6 +77,12 @@ 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 +93,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 +121,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.cc ('k') | cc/tiles/tile_draw_info.cc » ('j') | cc/tiles/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698