aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathRenderingDrawContext.cpp
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-08-11 12:17:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-11 12:17:32 -0700
commit86e7626f080028edd58f4b326e0ba9fa83c4208e (patch)
treea3f6c062eea0e6efe7084ccfc527ca8fd3729071 /src/gpu/GrPathRenderingDrawContext.cpp
parentc6d855f7f3d548c52f450299dc6975820cda3387 (diff)
Move GrAtlasTextContext to GrDrawingManager, so we only have one.
Ultimately, avoids wasteful redundant computation and storage of distance field fake-gamma tables. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2240623002 Review-Url: https://codereview.chromium.org/2240623002
Diffstat (limited to 'src/gpu/GrPathRenderingDrawContext.cpp')
-rw-r--r--src/gpu/GrPathRenderingDrawContext.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gpu/GrPathRenderingDrawContext.cpp b/src/gpu/GrPathRenderingDrawContext.cpp
index becffe0179..1380f7dc78 100644
--- a/src/gpu/GrPathRenderingDrawContext.cpp
+++ b/src/gpu/GrPathRenderingDrawContext.cpp
@@ -26,7 +26,8 @@ void GrPathRenderingDrawContext::drawText(const GrClip& clip, const GrPaint& gr
GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrPathRenderingDrawContext::drawText");
if (!fStencilAndCoverTextContext) {
- fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create());
+ GrAtlasTextContext* fallbackContext = this->drawingManager()->getAtlasTextContext();
+ fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create(fallbackContext));
}
fStencilAndCoverTextContext->drawText(this->drawingManager()->getContext(), this, clip, grPaint,
@@ -46,7 +47,8 @@ void GrPathRenderingDrawContext::drawPosText(const GrClip& clip, const GrPaint&
GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrPathRenderingDrawContext::drawPosText");
if (!fStencilAndCoverTextContext) {
- fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create());
+ GrAtlasTextContext* fallbackContext = this->drawingManager()->getAtlasTextContext();
+ fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create(fallbackContext));
}
fStencilAndCoverTextContext->drawPosText(this->drawingManager()->getContext(), this, clip,
@@ -65,7 +67,8 @@ void GrPathRenderingDrawContext::drawTextBlob(const GrClip& clip, const SkPaint&
GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrPathRenderingDrawContext::drawTextBlob");
if (!fStencilAndCoverTextContext) {
- fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create());
+ GrAtlasTextContext* fallbackContext = this->drawingManager()->getAtlasTextContext();
+ fStencilAndCoverTextContext.reset(GrStencilAndCoverTextContext::Create(fallbackContext));
}
fStencilAndCoverTextContext->drawTextBlob(this->drawingManager()->getContext(), this, clip,