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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1706773002: Fix memory leak (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrPathRenderingDrawContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index f31e0b23b090917d5148fb1a8fbaa86876bda30a..67013ff4f16f65c45b5c1ad4fb9f198855ce8b41 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -59,7 +59,6 @@ GrDrawContext::GrDrawContext(GrContext* context,
: fDrawingManager(drawingMgr)
, fRenderTarget(rt)
, fDrawTarget(SkSafeRef(rt->getLastDrawTarget()))
- , fAtlasTextContext(nullptr)
, fContext(context)
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
, fAuditTrail(auditTrail)
@@ -117,7 +116,7 @@ void GrDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint,
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText");
if (!fAtlasTextContext) {
- fAtlasTextContext = GrAtlasTextContext::Create();
+ fAtlasTextContext.reset(GrAtlasTextContext::Create());
}
fAtlasTextContext->drawText(fContext, this, clip, grPaint, skPaint, viewMatrix, fSurfaceProps,
@@ -136,7 +135,7 @@ void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText");
if (!fAtlasTextContext) {
- fAtlasTextContext = GrAtlasTextContext::Create();
+ fAtlasTextContext.reset(GrAtlasTextContext::Create());
}
fAtlasTextContext->drawPosText(fContext, this, clip, grPaint, skPaint, viewMatrix,
@@ -155,7 +154,7 @@ void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob");
if (!fAtlasTextContext) {
- fAtlasTextContext = GrAtlasTextContext::Create();
+ fAtlasTextContext.reset(GrAtlasTextContext::Create());
}
fAtlasTextContext->drawTextBlob(fContext, this, clip, skPaint, viewMatrix, fSurfaceProps, blob,
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrPathRenderingDrawContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698