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

Unified Diff: cc/tiles/software_image_decode_controller.h

Issue 1839833003: Add medium image quality to software predecode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing an error check to a DCHECK. Updating unit tests (including adding a new one) to reflect th… Created 4 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
Index: cc/tiles/software_image_decode_controller.h
diff --git a/cc/tiles/software_image_decode_controller.h b/cc/tiles/software_image_decode_controller.h
index 01a73e6a7e439aabfa75be0dd4d90d7ff222164e..992e2663a3ecb426e3337b01399cfd914e5aa580 100644
--- a/cc/tiles/software_image_decode_controller.h
+++ b/cc/tiles/software_image_decode_controller.h
@@ -211,6 +211,14 @@ class CC_EXPORT SoftwareImageDecodeController
DecodedDrawImage GetDecodedImageForDrawInternal(const ImageKey& key,
const DrawImage& draw_image);
+ // GetMediumQualityImageDecode is called by DecodeImageInternal to get the
+ // decoded and scaled image for medium quality.
+ // Like DecodeImageInternal, it should be called with no lock acquired
+ // and it also returns nullptr if the decoding or scaling failed.
+ std::unique_ptr<DecodedImage> GetMediumQualityImageDecode(
+ const ImageKey& key,
+ sk_sp<const SkImage> image);
+
// GetOriginalImageDecode is called by DecodeImageInternal when the quality
// does not scale the image. Like DecodeImageInternal, it should be called
// with no lock acquired and it returns nullptr if the decoding failed.
@@ -231,13 +239,6 @@ class CC_EXPORT SoftwareImageDecodeController
void RefAtRasterImage(const ImageKey& key);
void UnrefAtRasterImage(const ImageKey& key);
- // These functions indicate whether the images can be handled and cached by
- // ImageDecodeController or whether they will fall through to Skia (with
- // exception of possibly prerolling them). Over time these should return
- // "false" in less cases, as the ImageDecodeController should start handling
- // more of them.
- bool CanHandleImage(const ImageKey& key);
-
// Helper function which dumps all images in a specific ImageMRUCache.
void DumpImageMemoryForCache(const ImageMRUCache& cache,
const char* cache_name,
@@ -261,11 +262,6 @@ class CC_EXPORT SoftwareImageDecodeController
MemoryBudget locked_images_budget_;
- // Note that this is used for cases where the only thing we do is preroll the
- // image the first time we see it. This mimics the previous behavior and
- // should over time change as the compositor starts to handle more cases.
- std::unordered_set<uint32_t> prerolled_images_;
-
ResourceFormat format_;
// Used to uniquely identify DecodedImages for memory traces.
« no previous file with comments | « no previous file | cc/tiles/software_image_decode_controller.cc » ('j') | cc/tiles/software_image_decode_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698