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

Unified Diff: cc/tiles/checker_image_tracker.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
« no previous file with comments | « no previous file | cc/tiles/checker_image_tracker.cc » ('j') | cc/tiles/checker_image_tracker.cc » ('J')
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 b2a16ecf9b2d60c9e4b9cc1371c47329c9fd406e..ac7161293ccecf35b65e3522c344793e1a1e562e 100644
--- a/cc/tiles/checker_image_tracker.h
+++ b/cc/tiles/checker_image_tracker.h
@@ -51,6 +51,12 @@ class CC_EXPORT CheckerImageTracker {
// Returns the set of images to invalidate on the sync tree.
const ImageIdFlatSet& TakeImagesToInvalidateOnSyncTree();
+ // Resets any pending image decode requests that have not been scheduled for
+ // decode already. Note that calling this means that tiles which have already
+ // been checker-imaged need to be filtered on the tracker again to
+ // re-rasterize them.
+ void ResetImageDecodeQueue();
+
void DidActivateSyncTree();
private:
@@ -65,6 +71,10 @@ class CC_EXPORT CheckerImageTracker {
void ScheduleImageDecodeIfNecessary(const sk_sp<const SkImage>& image);
+ // Called when the next request in the |image_decode_queue_| should be
+ // scheduled with the image decode service.
+ void ScheduleNextImageDecode();
+
ImageController* image_controller_;
CheckerImageTrackerClient* client_;
const bool enable_checker_imaging_;
@@ -76,12 +86,16 @@ class CC_EXPORT CheckerImageTracker {
// A set of images which were invalidated on the current sync tree.
ImageIdFlatSet invalidated_images_on_current_sync_tree_;
- // A set of images which are currently pending decode from the image decode
- // service.
- // TODO(khushalsagar): This should be a queue that gets re-built each time we
- // do a PrepareTiles? See crbug.com/689184.
+ // The set of images in the image decode queue.
ImageIdFlatSet pending_image_decodes_;
+ // The queue of images pending decode. We maintain a queue to ensure that the
+ // order in which images are decoded is aligned with the priority of the tiles
+ // dependent on these images.
+ // The first image in this queue, if any, is the currently outstanding decode
+ // request given to the queue.
+ std::list<sk_sp<const SkImage>> image_decode_request_queue_;
vmpstr 2017/03/07 19:25:08 Can you write a cc_perftest for repeated schedules
Khushal 2017/03/13 20:35:08 I guess not necessary anymore. We iterate through
+
// A set of images which have been decoded at least once from the
// ImageDecodeService and should not be checkered again.
// TODO(khushalsagar): Limit the size of this set.
« no previous file with comments | « no previous file | cc/tiles/checker_image_tracker.cc » ('j') | cc/tiles/checker_image_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698