diff options
author | 2014-01-30 22:05:47 +0000 | |
---|---|---|
committer | 2014-01-30 22:05:47 +0000 | |
commit | cbbc481e918c0d32454455626235f67106f216a1 (patch) | |
tree | b4bf708bcbcb9e3971c46002e4733959b869a8ea /src/gpu/GrTextContext.cpp | |
parent | 3f01449afeac6162c7e55ec6052d47217b514ce5 (diff) |
Replace factory generation of TextContexts with persistent objects.
BUG=skia:2018
R=bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/150743002
git-svn-id: http://skia.googlecode.com/svn/trunk@13249 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrTextContext.cpp')
-rw-r--r-- | src/gpu/GrTextContext.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp index 0c9e149f75..bc116714da 100644 --- a/src/gpu/GrTextContext.cpp +++ b/src/gpu/GrTextContext.cpp @@ -12,24 +12,27 @@ #include "SkGlyphCache.h" #include "SkGr.h" -GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint, - const SkPaint& skPaint, const SkDeviceProperties& properties) : - fContext(context), fPaint(paint), fSkPaint(skPaint), - fDeviceProperties(properties) { +GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& properties) : + fContext(context), fDeviceProperties(properties), fDrawTarget(NULL) { +} - const GrClipData* clipData = context->getClip(); +void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) { + const GrClipData* clipData = fContext->getClip(); SkRect devConservativeBound; clipData->fClipStack->getConservativeBounds( -clipData->fOrigin.fX, -clipData->fOrigin.fY, - context->getRenderTarget()->width(), - context->getRenderTarget()->height(), + fContext->getRenderTarget()->width(), + fContext->getRenderTarget()->height(), &devConservativeBound); devConservativeBound.roundOut(&fClipRect); - fDrawTarget = context->getTextTarget(); + fDrawTarget = fContext->getTextTarget(); + + fPaint = grPaint; + fSkPaint = skPaint; } //*** change to output positions? |