| Index: src/core/SkImageCacherator.cpp
|
| diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
|
| index 7b5ff2267774463584c525bdd0f2cc5ee3fcbd8a..8d6a65a39733182be113479e7a1d3b30e05374e4 100644
|
| --- a/src/core/SkImageCacherator.cpp
|
| +++ b/src/core/SkImageCacherator.cpp
|
| @@ -25,6 +25,16 @@
|
| #include "SkGrPriv.h"
|
| #endif
|
|
|
| +bool SkGpuFormatWhitelist::includes(SkEncodedFormat format) {
|
| +#if SK_SUPPORT_GPU
|
| + return GrIsCompressedFormatPossiblySupported(fCtx, format);
|
| +#else
|
| + return false;
|
| +#endif
|
| +}
|
| +
|
| +///////////////////////////////////////////////////////////////////////////////////////////////////
|
| +
|
| SkImageCacherator* SkImageCacherator::NewFromGenerator(SkImageGenerator* gen,
|
| const SkIRect* subset) {
|
| if (!gen) {
|
| @@ -70,8 +80,15 @@ SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& i
|
| {}
|
|
|
| SkData* SkImageCacherator::refEncoded(GrContext* ctx) {
|
| + SkImageGenerator::RefEncodedWhitelist* whitelist = nullptr;
|
| +#if SK_SUPPORT_GPU
|
| + SkGpuFormatWhitelist gpuWhitelist(ctx);
|
| + if (ctx) {
|
| + whitelist = &gpuWhitelist;
|
| + }
|
| +#endif
|
| ScopedGenerator generator(this);
|
| - return generator->refEncodedData(ctx);
|
| + return generator->refEncodedData(whitelist);
|
| }
|
|
|
| static bool check_output_bitmap(const SkBitmap& bitmap, uint32_t expectedID) {
|
|
|