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

Unified Diff: cc/tiles/checker_image_tracker.h

Issue 2817473002: cc: Use an enum for tracking images vetoed for async decodes. (Closed)
Patch Set: addressed comments 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 | « no previous file | cc/tiles/checker_image_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/checker_image_tracker.h
diff --git a/cc/tiles/checker_image_tracker.h b/cc/tiles/checker_image_tracker.h
index 3bc29f55294421ede816ae4debcfdc02d8be642c..06ebd1785e46f44d635659d0e800a2dd29ad3625 100644
--- a/cc/tiles/checker_image_tracker.h
+++ b/cc/tiles/checker_image_tracker.h
@@ -54,14 +54,25 @@ class CC_EXPORT CheckerImageTracker {
void DidActivateSyncTree();
private:
+ enum class DecodePolicy {
+ // The image can be decoded asynchronously from raster. When set, the image
+ // is always skipped during rasterization of content that includes this
+ // image until it has been decoded using the decode service.
+ ASYNC,
+ // The image has been decoded asynchronously once and should now be
+ // synchronously rasterized with the content.
+ SYNC_DECODED_ONCE,
+ // The image has been permanently vetoed from being decoded async.
+ SYNC_PERMANENT,
+ };
+
void DidFinishImageDecode(ImageId image_id,
ImageController::ImageDecodeRequestId request_id,
ImageController::ImageDecodeResult result);
// Returns true if the decode for |image| will be deferred to the image decode
// service and it should be be skipped during raster.
- bool ShouldCheckerImage(const sk_sp<const SkImage>& image,
- WhichTree tree) const;
+ bool ShouldCheckerImage(const sk_sp<const SkImage>& image, WhichTree tree);
void ScheduleImageDecodeIfNecessary(const sk_sp<const SkImage>& image);
@@ -82,12 +93,11 @@ class CC_EXPORT CheckerImageTracker {
// do a PrepareTiles? See crbug.com/689184.
ImageIdFlatSet pending_image_decodes_;
- // A set of images which have been decoded at least once from the
- // ImageDecodeService and should not be checkered again.
+ // A map of ImageId to its DecodePolicy.
// TODO(khushalsagar): Limit the size of this set.
// TODO(khushalsagar): Plumb navigation changes here to reset this. See
// crbug.com/693228.
- std::unordered_set<ImageId> images_decoded_once_;
+ std::unordered_map<ImageId, DecodePolicy> image_async_decode_state_;
// A map of image id to image decode request id for images to be unlocked.
std::unordered_map<ImageId, ImageController::ImageDecodeRequestId>
« no previous file with comments | « no previous file | cc/tiles/checker_image_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698