diff options
author | Greg Daniel <egdaniel@google.com> | 2018-02-21 13:02:32 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-21 18:22:47 +0000 |
commit | 0a7aa14bf36cbb444b84902a37591d7a9c84fbd0 (patch) | |
tree | aa2769ad071df6f5250a00be9a67ef0c6baf4d44 /gm | |
parent | 32f72e25bd802d15ce43a3dd7ef4a3fcfd646727 (diff) |
Add checks for failed SkImageInfo2GrPixelConfig calls
Bug: skia:7645
Change-Id: I32b9326fb43490ef6a7a99527243b68d89184ae1
Reviewed-on: https://skia-review.googlesource.com/109083
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/texdata.cpp | 1 | ||||
-rw-r--r-- | gm/texturedomaineffect.cpp | 1 | ||||
-rw-r--r-- | gm/yuvtorgbeffect.cpp | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 1f7d107a30..b00daf52f5 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -92,6 +92,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { desc.fWidth = 2 * S; desc.fHeight = 2 * S; desc.fConfig = SkImageInfo2GrPixelConfig(ii, *context->caps()); + SkASSERT(kUnknown_GrPixelConfig != desc.fConfig); sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kNo, gTextureData.get(), 0); diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 57f012973f..7f7f4c4817 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -93,6 +93,7 @@ protected: desc.fWidth = fBmp.width(); desc.fHeight = fBmp.height(); desc.fConfig = SkImageInfo2GrPixelConfig(fBmp.info(), *context->caps()); + SkASSERT(kUnknown_GrPixelConfig != desc.fConfig); sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes, fBmp.getPixels(), diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index e314ea28bc..841f57488e 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -94,6 +94,7 @@ protected: desc.fWidth = fBmp[i].width(); desc.fHeight = fBmp[i].height(); desc.fConfig = SkImageInfo2GrPixelConfig(fBmp[i].info(), *context->caps()); + SkASSERT(kUnknown_GrPixelConfig != desc.fConfig); proxy[i] = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes, fBmp[i].getPixels(), @@ -225,6 +226,7 @@ protected: desc.fWidth = fBmp[index].width(); desc.fHeight = fBmp[index].height(); desc.fConfig = SkImageInfo2GrPixelConfig(fBmp[index].info(), *context->caps()); + SkASSERT(kUnknown_GrPixelConfig != desc.fConfig); proxy[i] = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes, fBmp[index].getPixels(), |