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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2240623002: Move GrAtlasTextContext to GrDrawingManager, so we only have one. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix alignment Created 4 years, 4 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
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 0a6ab5b52704876ff8976489db3ecc114d3f8a2a..345d3e833f9ecc3e89ee624f48dd954639289fb0 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -135,12 +135,9 @@ void GrDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint,
SkDEBUGCODE(this->validate();)
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawText");
- if (!fAtlasTextContext) {
- fAtlasTextContext.reset(GrAtlasTextContext::Create());
- }
-
- fAtlasTextContext->drawText(fContext, this, clip, grPaint, skPaint, viewMatrix, fSurfaceProps,
- text, byteLength, x, y, clipBounds);
+ GrAtlasTextContext* atlasTextContext = fDrawingManager->getAtlasTextContext();
+ atlasTextContext->drawText(fContext, this, clip, grPaint, skPaint, viewMatrix, fSurfaceProps,
+ text, byteLength, x, y, clipBounds);
}
void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
@@ -154,13 +151,10 @@ void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
SkDEBUGCODE(this->validate();)
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawPosText");
- if (!fAtlasTextContext) {
- fAtlasTextContext.reset(GrAtlasTextContext::Create());
- }
-
- fAtlasTextContext->drawPosText(fContext, this, clip, grPaint, skPaint, viewMatrix,
- fSurfaceProps, text, byteLength, pos, scalarsPerPosition,
- offset, clipBounds);
+ GrAtlasTextContext* atlasTextContext = fDrawingManager->getAtlasTextContext();
+ atlasTextContext->drawPosText(fContext, this, clip, grPaint, skPaint, viewMatrix,
+ fSurfaceProps, text, byteLength, pos, scalarsPerPosition,
+ offset, clipBounds);
}
@@ -173,12 +167,9 @@ void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
SkDEBUGCODE(this->validate();)
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawTextBlob");
- if (!fAtlasTextContext) {
- fAtlasTextContext.reset(GrAtlasTextContext::Create());
- }
-
- fAtlasTextContext->drawTextBlob(fContext, this, clip, skPaint, viewMatrix, fSurfaceProps, blob,
- x, y, filter, clipBounds);
+ GrAtlasTextContext* atlasTextContext = fDrawingManager->getAtlasTextContext();
+ atlasTextContext->drawTextBlob(fContext, this, clip, skPaint, viewMatrix, fSurfaceProps, blob,
+ x, y, filter, clipBounds);
}
void GrDrawContext::discard() {

Powered by Google App Engine
This is Rietveld 408576698