diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-14 18:54:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-15 13:23:22 +0000 |
commit | 303cd58870cf1d0d128ff3f37d1dc26778cad5af (patch) | |
tree | 0d063c9072fff57bc50d77e3b15a2247290ec05e /src/gpu/text/GrAtlasTextBlob.h | |
parent | d5811b2d4423cbf561e6ab8251550543d690f376 (diff) |
Update GrTextBlobCache for DDL
Although, theoretically, we could update the DDLs to maintain pointers to the GrMemoryPools being used by their GrAtlasTextBlobs this method seems simpler.
Change-Id: I4835284630b9cd29eb78cf25bcdfe5c56974a8cb
Reviewed-on: https://skia-review.googlesource.com/107345
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/text/GrAtlasTextBlob.h')
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h index 9132684622..6e1d0b1bde 100644 --- a/src/gpu/text/GrAtlasTextBlob.h +++ b/src/gpu/text/GrAtlasTextBlob.h @@ -52,7 +52,7 @@ public: class VertexRegenerator; - static sk_sp<GrAtlasTextBlob> Make(GrMemoryPool* pool, int glyphCount, int runCount); + static sk_sp<GrAtlasTextBlob> Make(GrMemoryPool*, int glyphCount, int runCount); /** * We currently force regeneration of a blob if old or new matrix differ in having perspective. @@ -104,7 +104,11 @@ public: void operator delete(void* p) { GrAtlasTextBlob* blob = reinterpret_cast<GrAtlasTextBlob*>(p); - blob->fPool->release(p); + if (blob->fPool) { + blob->fPool->release(p); + } else { + ::operator delete(p); + } } void* operator new(size_t) { SK_ABORT("All blobs are created by placement new."); @@ -521,7 +525,7 @@ private: char* fVertices; GrGlyph** fGlyphs; Run* fRuns; - GrMemoryPool* fPool; + GrMemoryPool* fPool; // this will be null when DDLs are being recorded SkMaskFilterBase::BlurRec fBlurRec; StrokeInfo fStrokeInfo; Key fKey; |