From 2e3b3e369d79e78f7635d4c20e83a47ab571bdf2 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Tue, 9 Dec 2014 13:31:14 -0800 Subject: This cl moves color and coverage off of drawstate. In an effort to keep this CL manageable, I have left the compute invariant input / output in a bit of a strange state(fixing this will be complicated). In addition, NVPR makes this very complicated, and I haven't quite figured out a good way to handle it, so for now color and coverage DO live on optstate, but I will figure out some way to refactor that in future CLs. BUG=skia: Review URL: https://codereview.chromium.org/783763002 --- src/gpu/GrAADistanceFieldPathRenderer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gpu/GrAADistanceFieldPathRenderer.cpp') diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp index 6ac504a948..7a7c1e4379 100755 --- a/src/gpu/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp @@ -105,6 +105,7 @@ GrAADistanceFieldPathRenderer::onGetStencilSupport(const GrDrawTarget*, bool GrAADistanceFieldPathRenderer::onDrawPath(GrDrawTarget* target, GrDrawState* drawState, + GrColor color, const SkPath& path, const SkStrokeRec& stroke, bool antiAlias) { @@ -143,7 +144,7 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(GrDrawTarget* target, } // use signed distance field to render - return this->internalDrawPath(target, drawState, path, pathData); + return this->internalDrawPath(target, drawState, color, path, pathData); } // padding around path bounds to allow for antialiased pixels @@ -306,6 +307,7 @@ bool GrAADistanceFieldPathRenderer::freeUnusedPlot() { bool GrAADistanceFieldPathRenderer::internalDrawPath(GrDrawTarget* target, GrDrawState* drawState, + GrColor color, const SkPath& path, const PathData* pathData) { GrTexture* texture = fAtlas->getTexture(); @@ -321,8 +323,9 @@ bool GrAADistanceFieldPathRenderer::internalDrawPath(GrDrawTarget* target, flags |= vm.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0; GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBilerp_FilterMode); - if (flags != fEffectFlags) { - fCachedGeometryProcessor.reset(GrDistanceFieldNoGammaTextureEffect::Create(texture, + if (flags != fEffectFlags || fCachedGeometryProcessor->getColor() != color) { + fCachedGeometryProcessor.reset(GrDistanceFieldNoGammaTextureEffect::Create(color, + texture, params, flags)); fEffectFlags = flags; -- cgit v1.2.3