diff options
author | joshualitt <joshualitt@chromium.org> | 2016-02-10 08:52:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 08:52:24 -0800 |
commit | 2f2ee83a9c1ff05a94265b175e51c63fc424d554 (patch) | |
tree | 5d281c8cb6f3113384f17bc65d4d060bc01fd0f4 /src/gpu/text/GrTextBlobCache.cpp | |
parent | 9972c424ea5eaa2d78e06ae068abc86fd408e0e3 (diff) |
cleanup textblob cache sanity check and prevent it from bitrotting
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684513004
Review URL: https://codereview.chromium.org/1684513004
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.cpp')
-rw-r--r-- | src/gpu/text/GrTextBlobCache.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpu/text/GrTextBlobCache.cpp b/src/gpu/text/GrTextBlobCache.cpp index 685284bee5..7fa2d1a80a 100644 --- a/src/gpu/text/GrTextBlobCache.cpp +++ b/src/gpu/text/GrTextBlobCache.cpp @@ -23,14 +23,12 @@ GrAtlasTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount, size_ sizeof(GrAtlasTextBlob::Run) * runCount; void* allocation = fPool.allocate(size); -#ifdef CACHE_SANITY_CHECK - sk_bzero(allocation, size); -#endif + if (CACHE_SANITY_CHECK) { + sk_bzero(allocation, size); + } GrAtlasTextBlob* cacheBlob = new (allocation) GrAtlasTextBlob; -#ifdef CACHE_SANITY_CHECK cacheBlob->fSize = size; -#endif // setup offsets for vertices / glyphs cacheBlob->fVertices = sizeof(GrAtlasTextBlob) + reinterpret_cast<unsigned char*>(cacheBlob); |