Commit 86c790e6 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Remove use of DeferredTextureImageData APIs and Support Decode to Scale

We aren't benefitting from the complexity added by the
DeferredTextureImageData APIs, and this API blocks us from using
PaintImage::Decode's decode-to-scale functionality.

This change removes our usage of DeferredTextureImageData APIs,
instead using SkImage::makeTextureImage to handle upload. Additionally,
we now use the PaintImage::Decode API, adding decode-to-scale support.

Bug: 773799
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia5f480213c3a5c8225ccd289aa2c081056840f94
Reviewed-on: https://chromium-review.googlesource.com/713593Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517206}
parent 4ce81f02
This diff is collapsed.
......@@ -203,9 +203,14 @@ class CC_EXPORT GpuImageDecodeCache
void Unlock();
void SetLockedData(std::unique_ptr<base::DiscardableMemory> data,
sk_sp<SkImage> image,
bool out_of_raster);
void ResetData();
base::DiscardableMemory* data() const { return data_.get(); }
sk_sp<SkImage> image() const {
DCHECK(is_locked());
return image_;
}
bool decode_failure = false;
// Similar to |task|, but only is generated if there is no associated upload
......@@ -216,6 +221,7 @@ class CC_EXPORT GpuImageDecodeCache
void ReportUsageStats() const;
std::unique_ptr<base::DiscardableMemory> data_;
sk_sp<SkImage> image_;
};
// Stores the GPU-side image and supporting fields.
......@@ -243,13 +249,15 @@ class CC_EXPORT GpuImageDecodeCache
ImageData(DecodedDataMode mode,
size_t size,
const gfx::ColorSpace& target_color_space,
const SkImage::DeferredTextureImageUsageParams& upload_params);
SkFilterQuality quality,
int mip_level);
const DecodedDataMode mode;
const size_t size;
gfx::ColorSpace target_color_space;
SkFilterQuality quality;
int mip_level;
bool is_at_raster = false;
SkImage::DeferredTextureImageUsageParams upload_params;
// If true, this image is no longer in our |persistent_cache_| and will be
// deleted as soon as its ref count reaches zero.
......@@ -373,7 +381,7 @@ class CC_EXPORT GpuImageDecodeCache
const SkColorType color_type_;
viz::ContextProvider* context_;
sk_sp<GrContextThreadSafeProxy> context_threadsafe_proxy_;
int max_texture_size_ = 0;
// All members below this point must only be accessed while holding |lock_|.
// The exception are const members like |normal_max_cache_bytes_| that can
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment