Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1065773005: Fix for segfault on destruction of BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrBatchAtlas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 5f4f916adcd3e8941ab5783789557d2d69eee115..5fbe2e34805d705890570985ac876e76c4e400f5 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -660,12 +660,13 @@ inline void GrAtlasTextContext::fallbackDrawPosText(BitmapTextBlob* blob,
SkASSERT(fallbackTxt.count());
blob->setHasBitmap();
Run& run = blob->fRuns[runIndex];
- PerSubRunInfo& subRun = run.fSubRunInfo.push_back();
- subRun.fOverrideDescriptor.reset(SkNEW(SkAutoDescriptor));
- skPaint.getScalerContextDescriptor(subRun.fOverrideDescriptor,
+ // Push back a new subrun to fill and set the override descriptor
+ run.push_back();
+ run.fOverrideDescriptor.reset(SkNEW(SkAutoDescriptor));
+ skPaint.getScalerContextDescriptor(run.fOverrideDescriptor,
&fDeviceProperties, &viewMatrix, false);
SkGlyphCache* cache = SkGlyphCache::DetachCache(run.fTypeface,
- subRun.fOverrideDescriptor->getDesc());
+ run.fOverrideDescriptor->getDesc());
this->internalDrawBMPPosText(blob, runIndex, cache, skPaint, paint.getColor(), viewMatrix,
fallbackTxt.begin(), fallbackTxt.count(),
fallbackPos.begin(), scalarsPerPosition, offset, clipRect);
@@ -1602,8 +1603,8 @@ public:
// We can reuse if we have a valid strike and our descriptors / typeface are the
// same
- const SkDescriptor* newDesc = info.fOverrideDescriptor ?
- info.fOverrideDescriptor->getDesc() :
+ const SkDescriptor* newDesc = run.fOverrideDescriptor ?
+ run.fOverrideDescriptor->getDesc() :
run.fDescriptor.getDesc();
if (!cache || !SkTypeface::Equal(typeface, run.fTypeface) ||
!(desc->equals(*newDesc))) {
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrBatchAtlas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698