aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage_Gpu.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index faccf8dd8b..b56b1bab15 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -24,6 +24,7 @@
#include "SkGrPriv.h"
#include "SkImage_Gpu.h"
#include "SkImageCacherator.h"
+#include "SkImageInfoPriv.h"
#include "SkMipMap.h"
#include "SkPixelRef.h"
@@ -124,6 +125,10 @@ static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes)
bool SkImage_Gpu::onReadPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
int srcX, int srcY, CachingHint) const {
+ if (!SkImageInfoValidConversion(info, this->onImageInfo())) {
+ return false;
+ }
+
GrPixelConfig config = SkImageInfo2GrPixelConfig(info, *fTexture->getContext()->caps());
uint32_t flags = 0;
if (kUnpremul_SkAlphaType == info.alphaType() && kPremul_SkAlphaType == fAlphaType) {