Chromium Code Reviews| Index: src/gpu/GrStencilAndCoverTextContext.cpp |
| diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp |
| index 65c26423d1391edd69193620234af1e344e5303f..01d942b8d3c082e4d30b1bb0f5631b3cf4b382bb 100644 |
| --- a/src/gpu/GrStencilAndCoverTextContext.cpp |
| +++ b/src/gpu/GrStencilAndCoverTextContext.cpp |
| @@ -18,7 +18,7 @@ |
| #include "SkPath.h" |
| #include "SkTextMapStateProc.h" |
| -class GrStencilAndCoverTextContext::GlyphPathRange : public GrCacheable { |
| +class GrStencilAndCoverTextContext::GlyphPathRange : public GrGpuObject { |
| static const int kMaxGlyphCount = 1 << 16; // Glyph IDs are uint16_t's |
| static const int kGlyphGroupSize = 16; // Glyphs get tracked in groups of 16 |
| @@ -75,13 +75,13 @@ public: |
| this->didChangeGpuMemorySize(); |
| } |
| - // GrCacheable overrides |
| + // GrGpuObject overrides |
| virtual size_t gpuMemorySize() const SK_OVERRIDE { return fPathRange->gpuMemorySize(); } |
| - virtual bool isValidOnGpu() const SK_OVERRIDE { return fPathRange->isValidOnGpu(); } |
| private: |
| GlyphPathRange(GrContext* context, const SkDescriptor& desc, const SkStrokeRec& stroke) |
| - : fDesc(desc.copy()) |
| + : INHERITED(context->getGpu(), false) |
| + , fDesc(desc.copy()) |
| // We reserve a range of kMaxGlyphCount paths because of fallbacks fonts. We |
| // can't know exactly how many glyphs we might need without preloading every |
| // fallback, which we don't want to do at this point. |
| @@ -90,15 +90,28 @@ private: |
| } |
| ~GlyphPathRange() { |
| + this->release(); |
| SkDescriptor::Free(fDesc); |
| } |
|
robertphillips
2014/07/25 12:53:06
override ?
bsalomon
2014/07/25 14:20:53
Done.
|
| + virtual void onRelease() { |
| + INHERITED::onRelease(); |
| + fPathRange.reset(NULL); |
| + } |
| + |
|
robertphillips
2014/07/25 12:53:06
override?
bsalomon
2014/07/25 14:20:53
Done.
|
| + virtual void onAbandon() { |
| + INHERITED::onAbandon(); |
| + fPathRange->abandon(); |
| + fPathRange.reset(NULL); |
| + } |
| + |
| + |
| static const int kMaxGroupCount = (kMaxGlyphCount + (kGlyphGroupSize - 1)) / kGlyphGroupSize; |
| SkDescriptor* const fDesc; |
| uint8_t fLoadedGlyphs[(kMaxGroupCount + 7) >> 3]; // One bit per glyph group |
| SkAutoTUnref<GrPathRange> fPathRange; |
| - typedef GrCacheable INHERITED; |
| + typedef GrGpuObject INHERITED; |
| }; |