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

Unified Diff: cc/tiles/checker_image_tracker.h

Issue 2928433003: cc: Add scaling for checkered images. (Closed)
Patch Set: .. Created 3 years, 6 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 205e4937ff54acfa6fe3fcde1ce85d333079ee1f..335050c6b9df5ec861be30f2f6b58f852bbebf07 100644
--- a/cc/tiles/checker_image_tracker.h
+++ b/cc/tiles/checker_image_tracker.h
@@ -40,7 +40,7 @@ class CC_EXPORT CheckerImageTracker {
// 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 PaintImage& image, WhichTree tree);
+ bool ShouldCheckerImage(const DrawImage& image, WhichTree tree);
using ImageDecodeQueue = std::vector<PaintImage>;
void ScheduleImageDecodeQueue(ImageDecodeQueue image_decode_queue);
@@ -78,6 +78,15 @@ class CC_EXPORT CheckerImageTracker {
SYNC
};
+ // Contains the information to construct a DrawImage from PaintImage when
+ // queuing the image decode.
+ struct DecodeState {
+ DecodePolicy policy = DecodePolicy::SYNC;
+ SkFilterQuality filter_quality = kNone_SkFilterQuality;
+ SkSize scale = SkSize::MakeEmpty();
+ gfx::ColorSpace color_space;
+ };
+
// Wrapper to unlock an image decode requested from the ImageController on
// destruction.
class ScopedDecodeHolder {
@@ -101,6 +110,9 @@ class CC_EXPORT CheckerImageTracker {
// Called when the next request in the |image_decode_queue_| should be
// scheduled with the image decode service.
void ScheduleNextImageDecode();
+ void UpdateDecodeState(const DrawImage& draw_image,
+ PaintImage::Id paint_image_id,
+ DecodeState* decode_state);
ImageController* image_controller_;
CheckerImageTrackerClient* client_;
@@ -123,7 +135,7 @@ class CC_EXPORT CheckerImageTracker {
base::Optional<PaintImage> outstanding_image_decode_;
// A map of ImageId to its DecodePolicy.
- std::unordered_map<PaintImage::Id, DecodePolicy> image_async_decode_state_;
+ std::unordered_map<PaintImage::Id, DecodeState> image_async_decode_state_;
// A map of image id to image decode request id for images to be unlocked.
std::unordered_map<PaintImage::Id, std::unique_ptr<ScopedDecodeHolder>>
« 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