| Index: src/core/SkImageCacherator.cpp
|
| diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
|
| index 7b5ff2267774463584c525bdd0f2cc5ee3fcbd8a..457aecd35e0e393b7cc1728122b8307f2d68aac3 100644
|
| --- a/src/core/SkImageCacherator.cpp
|
| +++ b/src/core/SkImageCacherator.cpp
|
| @@ -25,6 +25,24 @@
|
| #include "SkGrPriv.h"
|
| #endif
|
|
|
| +bool SkEncodedFormatQuery_Gpu::supportedFormat(SkEncodedFormat format) {
|
| +#if SK_SUPPORT_GPU
|
| + return GrIsCompressedFormatPossiblySupported(fCtx, format);
|
| +#else
|
| + return false;
|
| +#endif
|
| +}
|
| +
|
| +bool SkEncodedFormatQuery_Gpu::supportedFormatFromData(const void* data, size_t length) {
|
| +#if SK_SUPPORT_GPU
|
| + return GrIsCompressedTextureDataPossiblySupported(fCtx, data, length);
|
| +#else
|
| + return false;
|
| +#endif
|
| +}
|
| +
|
| +///////////////////////////////////////////////////////////////////////////////////////////////////
|
| +
|
| SkImageCacherator* SkImageCacherator::NewFromGenerator(SkImageGenerator* gen,
|
| const SkIRect* subset) {
|
| if (!gen) {
|
| @@ -70,8 +88,15 @@ SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& i
|
| {}
|
|
|
| SkData* SkImageCacherator::refEncoded(GrContext* ctx) {
|
| + SkEncodedFormatQuery* query = nullptr;
|
| +#if SK_SUPPORT_GPU
|
| + SkEncodedFormatQuery_Gpu gpuQuery(ctx);
|
| + if (ctx) {
|
| + query = &gpuQuery;
|
| + }
|
| +#endif
|
| ScopedGenerator generator(this);
|
| - return generator->refEncodedData(ctx);
|
| + return generator->refEncodedData(query);
|
| }
|
|
|
| static bool check_output_bitmap(const SkBitmap& bitmap, uint32_t expectedID) {
|
|
|