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

Unified Diff: cc/tiles/checker_image_tracker.h

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: .. 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..7c4ed22006cd34a8ca46a4e8a78ee98cdafad1f8 100644
--- a/cc/tiles/checker_image_tracker.h
+++ b/cc/tiles/checker_image_tracker.h
@@ -37,16 +37,13 @@ class CC_EXPORT CheckerImageTracker {
bool enable_checker_imaging);
~CheckerImageTracker();
- // Given the |images| for a tile, filters the images which will be deferred
- // asynchronously using the image decoded service, eliminating them from
- // |images| adds them to the |checkered_images| set, so they can be skipped
- // during the rasterization of this tile.
- // The entries remaining in |images| are for images for which a cached decode
- // from the image decode service is available, or which must be decoded before
- // before this tile can be rasterized.
- void FilterImagesForCheckeringForTile(std::vector<DrawImage>* images,
- ImageIdFlatSet* checkered_images,
- WhichTree tree);
+ // 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;
+
+ using ImageDecodeQueue = std::vector<sk_sp<const SkImage>>;
+ void SetImageDecodeQueue(ImageDecodeQueue image_decode_queue);
// Returns the set of images to invalidate on the sync tree.
const ImageIdFlatSet& TakeImagesToInvalidateOnSyncTree();
@@ -58,12 +55,9 @@ class CC_EXPORT CheckerImageTracker {
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;
-
- 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_;
@@ -76,11 +70,15 @@ 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.
- 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.
+ ImageDecodeQueue image_decode_queue_;
+ size_t next_image_to_decode_ = 0;
vmpstr 2017/03/17 18:32:13 next_image_index? Or what is this? size_t is certa
Khushal 2017/03/27 13:57:33 Done.
+
+ // The currently outstanding image decode that has been scheduled with the
+ // decode service.
+ sk_sp<const SkImage> outstanding_image_decode_;
// A set of images which have been decoded at least once from the
// ImageDecodeService and should not be checkered again.
« 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