diff options
author | 2015-05-26 11:38:03 -0700 | |
---|---|---|
committer | 2015-05-26 11:38:03 -0700 | |
commit | ea4615034498aca2f9ca1753fb9a1ef10508d8cc (patch) | |
tree | 22f0027849de0dd18b199fb13c6c28be812cf229 /src/gpu/GrTextContext.cpp | |
parent | 884e97cb04db7ed053a866567ee9c6e4c01f993a (diff) |
Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).
I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.
Review URL: https://codereview.chromium.org/1151283004
Diffstat (limited to 'src/gpu/GrTextContext.cpp')
-rw-r--r-- | src/gpu/GrTextContext.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp index 4c6dabcf7d..4b8bc68e33 100644 --- a/src/gpu/GrTextContext.cpp +++ b/src/gpu/GrTextContext.cpp @@ -24,8 +24,7 @@ GrTextContext::GrTextContext(GrContext* context, SkGpuDevice* gpuDevice, : fFallbackTextContext(NULL) , fContext(context) , fGpuDevice(gpuDevice) - , fDeviceProperties(properties) - , fDrawTarget(NULL) { + , fDeviceProperties(properties) { } GrTextContext::~GrTextContext() { @@ -41,8 +40,6 @@ void GrTextContext::init(GrRenderTarget* rt, const GrClip& clip, const GrPaint& fRegionClipBounds = regionClipBounds; fClip.getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect); - fDrawTarget = fContext->getTextTarget(); - fPaint = grPaint; fSkPaint = skPaint; } @@ -51,7 +48,7 @@ void GrTextContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPai const SkPaint& skPaint, const SkMatrix& viewMatrix, const char text[], size_t byteLength, SkScalar x, SkScalar y, const SkIRect& clipBounds) { - if (!fContext->getTextTarget()) { + if (fContext->abandoned()) { return; } @@ -75,7 +72,7 @@ void GrTextContext::drawPosText(GrRenderTarget* rt, const GrClip& clip, const Gr const char text[], size_t byteLength, const SkScalar pos[], int scalarsPerPosition, const SkPoint& offset, const SkIRect& clipBounds) { - if (!fContext->getTextTarget()) { + if (fContext->abandoned()) { return; } |