Commit 74522773 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Revert "Remove use of DeferredTextureImageData APIs and Support Decode to Scale"

This reverts commit 86c790e6.

Reason for revert: This is causing performance / memory regressions that are trickier to address than expected. Reverting this for now.

Original change's description:
> 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/713593
> Reviewed-by: vmpstr <vmpstr@chromium.org>
> Commit-Queue: Eric Karl <ericrk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#517206}

TBR=vmpstr@chromium.org,ericrk@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 773799
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Ie4493559e334100f03dfed1dfb7a408fc26a33e0
Reviewed-on: https://chromium-review.googlesource.com/830587
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524613}
parent 9161f6b9
......@@ -161,6 +161,9 @@ class CC_PAINT_EXPORT PaintImage {
// Returns the total number of frames known to exist in this image.
size_t FrameCount() const;
// Returns an SkImage for the frame at |index|.
sk_sp<SkImage> GetSkImageForFrame(size_t index) const;
std::string ToString() const;
private:
......@@ -179,9 +182,6 @@ class CC_PAINT_EXPORT PaintImage {
void CreateSkImage();
PaintImage MakeSubset(const gfx::Rect& subset) const;
// Returns an SkImage for the frame at |index|.
sk_sp<SkImage> GetSkImageForFrame(size_t index) const;
sk_sp<SkImage> sk_image_;
sk_sp<PaintRecord> paint_record_;
......
This diff is collapsed.
......@@ -203,14 +203,9 @@ 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
......@@ -221,7 +216,6 @@ 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.
......@@ -249,15 +243,13 @@ class CC_EXPORT GpuImageDecodeCache
ImageData(DecodedDataMode mode,
size_t size,
const gfx::ColorSpace& target_color_space,
SkFilterQuality quality,
int mip_level);
const SkImage::DeferredTextureImageUsageParams& upload_params);
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.
......@@ -381,7 +373,7 @@ class CC_EXPORT GpuImageDecodeCache
const SkColorType color_type_;
viz::ContextProvider* context_;
int max_texture_size_ = 0;
sk_sp<GrContextThreadSafeProxy> context_threadsafe_proxy_;
// 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