diff options
author | msarett <msarett@google.com> | 2016-03-07 08:39:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-07 08:39:12 -0800 |
commit | 095d31c8a0eeb5d491febf064bc3c8a44e22b94f (patch) | |
tree | 415ad73df7c480fcb9329cec90ac2883c4c9b72f /src/lazy | |
parent | a9101eef5ffc5f329a5edc75fd67441d868b0e9b (diff) |
Update Skia's YUV API
We should match the recently designed API in SkCodec.
https://codereview.chromium.org/1549473003/
This requires changes in Chromium as well.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002
Review URL: https://codereview.chromium.org/1716523002
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkDiscardablePixelRef.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h index 695d441d2b..73a2b08250 100644 --- a/src/lazy/SkDiscardablePixelRef.h +++ b/src/lazy/SkDiscardablePixelRef.h @@ -54,16 +54,22 @@ private: size_t rowBytes, SkDiscardableMemory::Factory* factory); - bool onGetYUV8Planes(SkISize sizes[3], - void* planes[3], - size_t rowBytes[3], - SkYUVColorSpace* colorSpace) override { + bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const override { // If the image was already decoded with lockPixels(), favor not // re-decoding to YUV8 planes. if (fDiscardableMemory) { return false; } - return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace); + return fGenerator->queryYUV8(sizeInfo, colorSpace); + } + + bool onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) override { + // If the image was already decoded with lockPixels(), favor not + // re-decoding to YUV8 planes. + if (fDiscardableMemory) { + return false; + } + return fGenerator->getYUV8Planes(sizeInfo, planes); } friend bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*, |