aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrStencilBuffer.cpp1
-rw-r--r--src/gpu/SkGr.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrStencilBuffer.cpp b/src/gpu/GrStencilBuffer.cpp
index 623861df8f..865961acdc 100644
--- a/src/gpu/GrStencilBuffer.cpp
+++ b/src/gpu/GrStencilBuffer.cpp
@@ -29,6 +29,7 @@ void gen_cache_id(int width, int height, int sampleCnt, GrCacheID* cacheID) {
keyData[0] = width;
keyData[1] = height;
keyData[2] = sampleCnt;
+ memset(keyData + 3, 0, sizeof(key) - 3 * sizeof(uint32_t));
GR_STATIC_ASSERT(sizeof(key) >= 3 * sizeof(uint32_t));
cacheID->reset(gStencilBufferDomain, key);
}
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 695b1df852..fac18e969e 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -69,6 +69,8 @@ static void generate_bitmap_cache_id(const SkBitmap& bitmap, GrCacheID* id) {
memcpy(key.fData8 + 4, &width, 2);
memcpy(key.fData8 + 6, &height, 2);
memcpy(key.fData8 + 8, &offset, sizeof(size_t));
+ static const size_t kKeyDataSize = 8 + sizeof(size_t);
+ memset(key.fData8 + kKeyDataSize, 0, sizeof(key) - kKeyDataSize);
GR_STATIC_ASSERT(sizeof(key) >= 8 + sizeof(size_t));
static const GrCacheID::Domain gBitmapTextureDomain = GrCacheID::GenerateDomain();
id->reset(gBitmapTextureDomain, key);