Index: src/core/SkImageGenerator.cpp |
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp |
index d42ece828a7d906f9b69a9b49d685cc834d47667..ffccb611d81b141d4d40944a5ef10885aa961de7 100644 |
--- a/src/core/SkImageGenerator.cpp |
+++ b/src/core/SkImageGenerator.cpp |
@@ -104,11 +104,12 @@ bool SkImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t |
return this->onGetYUV8Planes(sizes, planes, rowBytes); |
} |
-GrTexture* SkImageGenerator::generateTexture(GrContext* ctx, SkImageUsageType usage) { |
- if (!ctx) { |
+GrTexture* SkImageGenerator::generateTexture(GrContext* ctx, SkImageUsageType usage, |
+ const SkIRect* subset) { |
+ if (subset && !SkIRect::MakeWH(fInfo.width(), fInfo.height()).contains(*subset)) { |
return nullptr; |
} |
- return this->onGenerateTexture(ctx, usage); |
+ return this->onGenerateTexture(ctx, usage, subset); |
} |
///////////////////////////////////////////////////////////////////////////////////////////// |