diff options
author | joshualitt <joshualitt@chromium.org> | 2014-12-09 13:31:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-09 13:31:15 -0800 |
commit | 2e3b3e369d79e78f7635d4c20e83a47ab571bdf2 (patch) | |
tree | 95378f3e35a21192f0db62e60bc6e408803050b7 /src/gpu/GrAADistanceFieldPathRenderer.cpp | |
parent | f3c78ccf5694d22d2e4a7061a80399a7e69b59db (diff) |
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
Diffstat (limited to 'src/gpu/GrAADistanceFieldPathRenderer.cpp')
-rwxr-xr-x | src/gpu/GrAADistanceFieldPathRenderer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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; |