Add abandoned GPU check to createTextureProxy

I'm guessing the crash is actually on the first 'fGpu' reference in createTextureProxy after the GPU context has been abandoned.

Bug: 712929
Change-Id: Ia6742da7073c2320e592b42fcf2d0e7c04eeefb9
Reviewed-on: https://skia-review.googlesource.com/13966
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2017-04-20 10:19:33 -04:00 committed by Skia Commit-Bot
parent ad8b5dc69c
commit 774831a4e8

View File

@ -123,6 +123,12 @@ static bool make_info(int w, int h, GrPixelConfig config, SkImageInfo* ii) {
sk_sp<GrTextureProxy> GrResourceProvider::createTextureProxy(const GrSurfaceDesc& desc, sk_sp<GrTextureProxy> GrResourceProvider::createTextureProxy(const GrSurfaceDesc& desc,
SkBudgeted budgeted, SkBudgeted budgeted,
const GrMipLevel& mipLevel) { const GrMipLevel& mipLevel) {
ASSERT_SINGLE_OWNER
if (this->isAbandoned()) {
return nullptr;
}
if (!mipLevel.fPixels) { if (!mipLevel.fPixels) {
return nullptr; return nullptr;
} }