Index: src/gpu/GrTextureProvider.cpp |
diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp |
index f1775aba78f38c869611184cbca3fae00c4842c0..c7ca52867013b7993709f5eb8b23f5cd10e6d105 100644 |
--- a/src/gpu/GrTextureProvider.cpp |
+++ b/src/gpu/GrTextureProvider.cpp |
@@ -53,12 +53,17 @@ GrTexture* GrTextureProvider::createMipMappedTexture(const GrSurfaceDesc& desc, |
if (!GrPixelConfigIsCompressed(desc.fConfig) && |
!desc.fTextureStorageAllocator.fAllocateTextureStorage) { |
if (mipLevelCount < 2) { |
- const GrMipLevel& baseMipLevel = texels[0]; |
+ const void* basePixels = nullptr; |
+ size_t baseRowBytes = 0; |
robertphillips
2016/03/09 15:46:20
> 0 ?
|
+ if (1 == mipLevelCount) { |
+ basePixels = texels[0].fPixels; |
+ baseRowBytes = texels[0].fRowBytes; |
+ } |
static const uint32_t kFlags = kExact_ScratchTextureFlag | |
kNoCreate_ScratchTextureFlag; |
if (GrTexture* texture = this->refScratchTexture(desc, kFlags)) { |
if (!texels || texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, |
- baseMipLevel.fPixels, baseMipLevel.fRowBytes)) { |
+ basePixels, baseRowBytes)) { |
if (SkBudgeted::kNo == budgeted) { |
texture->resourcePriv().makeUnbudgeted(); |
} |