Fix for texture width or height are greater than 2^16
BUG=skia:3467
TBR=
Review URL: https://codereview.chromium.org/1380153002
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 7984460..905455a 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -98,18 +98,16 @@
void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) {
static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType();
- GrScratchKey::Builder builder(key, kType, 2);
-
GrSurfaceOrigin origin = resolve_origin(desc);
uint32_t flags = desc.fFlags & ~kCheckAllocation_GrSurfaceFlag;
- SkASSERT(desc.fWidth <= SK_MaxU16);
- SkASSERT(desc.fHeight <= SK_MaxU16);
SkASSERT(static_cast<int>(desc.fConfig) < (1 << 6));
SkASSERT(desc.fSampleCnt < (1 << 8));
SkASSERT(flags < (1 << 10));
SkASSERT(static_cast<int>(origin) < (1 << 8));
- builder[0] = desc.fWidth | (desc.fHeight << 16);
- builder[1] = desc.fConfig | (desc.fSampleCnt << 6) | (flags << 14) | (origin << 24);
+ GrScratchKey::Builder builder(key, kType, 3);
+ builder[0] = desc.fWidth;
+ builder[1] = desc.fHeight;
+ builder[2] = desc.fConfig | (desc.fSampleCnt << 6) | (flags << 14) | (origin << 24);
}