From ea4615034498aca2f9ca1753fb9a1ef10508d8cc Mon Sep 17 00:00:00 2001 From: robertphillips Date: Tue, 26 May 2015 11:38:03 -0700 Subject: 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 --- src/gpu/GrStencilAndCoverTextContext.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gpu/GrStencilAndCoverTextContext.cpp') diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp index 63efcfcd85..539d731743 100644 --- a/src/gpu/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/GrStencilAndCoverTextContext.cpp @@ -7,6 +7,7 @@ #include "GrStencilAndCoverTextContext.h" #include "GrAtlasTextContext.h" +#include "GrDrawContext.h" #include "GrDrawTarget.h" #include "GrPath.h" #include "GrPathRange.h" @@ -434,7 +435,13 @@ void GrStencilAndCoverTextContext::flush() { SkAutoTUnref pp(GrPathProcessor::Create(fPaint.getColor(), fViewMatrix, fLocalMatrix)); - fDrawTarget->drawPaths(&fPipelineBuilder, pp, fGlyphs, + + GrDrawContext* drawContext = fContext->drawContext(); + if (!drawContext) { + return; + } + + drawContext->drawPaths(&fPipelineBuilder, pp, fGlyphs, fGlyphIndices, GrPathRange::kU16_PathIndexType, get_xy_scalar_array(fGlyphPositions), GrPathRendering::kTranslate_PathTransformType, @@ -482,6 +489,5 @@ void GrStencilAndCoverTextContext::finish() { fPipelineBuilder.stencil()->setDisabled(); fStateRestore.set(NULL); fViewMatrix = fContextInitialMatrix; - GrTextContext::finish(); } -- cgit v1.2.3