diff options
author | 2015-10-27 07:53:35 -0700 | |
---|---|---|
committer | 2015-10-27 07:53:35 -0700 | |
commit | cf10b5a432c604088b6cc5df3630fda08895d829 (patch) | |
tree | 42150e29d133119a544390e6828dce0c3b889e5a /src | |
parent | 3f7357f1a0af60dddbd91fd457cb50a1771f0d13 (diff) |
Cosmetic portion of reverted "Fix ClipMaskManager's SW-fallback logic" CL
This CL isolates the cosmetic portion so the functional portion is clearer. It relies on https://codereview.chromium.org/1412883005/ (Fix ClipMaskManager's SW-fallback logic (take 2))
Review URL: https://codereview.chromium.org/1422023003
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 16 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrDrawContext.cpp | 6 | ||||
-rw-r--r-- | src/gpu/GrPathRendererChain.cpp | 4 |
4 files changed, 13 insertions, 15 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 5c493aab7b..2847f096ce 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -87,7 +87,7 @@ static bool path_needs_SW_renderer(GrContext* context, } // the 'false' parameter disallows use of the SW path renderer - GrPathRenderer* pr = context->getPathRenderer(&pipelineBuilder, viewMatrix, path, + GrPathRenderer* pr = context->getPathRenderer(pipelineBuilder, viewMatrix, path, stroke, false, type); if (tryStencilFirst && !pr) { // If the path can't be stenciled, createAlphaClipMask falls back to color rendering @@ -96,7 +96,7 @@ static bool path_needs_SW_renderer(GrContext* context, ? GrPathRendererChain::kColorAntiAlias_DrawType : GrPathRendererChain::kColor_DrawType; - pr = context->getPathRenderer(&pipelineBuilder, viewMatrix, path, stroke, false, type); + pr = context->getPathRenderer(pipelineBuilder, viewMatrix, path, stroke, false, type); } if (prOut) { @@ -127,8 +127,7 @@ bool GrClipMaskManager::useSWOnlyPath(const GrPipelineBuilder& pipelineBuilder, // Set the matrix so that rendered clip elements are transformed to mask space from clip // space. - SkMatrix translate; - translate.setTranslate(clipToMaskOffset); + const SkMatrix translate = SkMatrix::MakeTrans(clipToMaskOffset.fX, clipToMaskOffset.fY); for (GrReducedClip::ElementList::Iter iter(elements.headIter()); iter.get(); iter.next()) { const Element* element = iter.get(); @@ -452,7 +451,7 @@ bool GrClipMaskManager::drawElement(GrPipelineBuilder* pipelineBuilder, GrPathRendererChain::DrawType type; type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_DrawType : GrPathRendererChain::kColor_DrawType; - pr = this->getContext()->getPathRenderer(pipelineBuilder, viewMatrix, + pr = this->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix, path, stroke, false, type); } if (nullptr == pr) { @@ -494,7 +493,7 @@ bool GrClipMaskManager::canStencilAndDrawElement(GrPipelineBuilder* pipelineBuil GrPathRendererChain::DrawType type = element->isAA() ? GrPathRendererChain::kStencilAndColorAntiAlias_DrawType : GrPathRendererChain::kStencilAndColor_DrawType; - *pr = this->getContext()->getPathRenderer(pipelineBuilder, SkMatrix::I(), path, + *pr = this->getContext()->getPathRenderer(*pipelineBuilder, SkMatrix::I(), path, stroke, false, type); return SkToBool(*pr); } @@ -595,8 +594,7 @@ GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, // Set the matrix so that rendered clip elements are transformed to mask space from clip // space. - SkMatrix translate; - translate.setTranslate(clipToMaskOffset); + const SkMatrix translate = SkMatrix::MakeTrans(clipToMaskOffset.fX, clipToMaskOffset.fY); // The texture may be larger than necessary, this rect represents the part of the texture // we populate with a rasterization of the clip. @@ -799,7 +797,7 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, if (fillInverted) { clipPath.toggleInverseFillType(); } - pr = this->getContext()->getPathRenderer(&pipelineBuilder, + pr = this->getContext()->getPathRenderer(pipelineBuilder, viewMatrix, clipPath, stroke, diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 081bc0ac38..04e1b8d203 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -541,7 +541,7 @@ void GrContext::flushSurfaceWrites(GrSurface* surface) { * Due to its expense, the software path renderer has split out so it can * can be individually allowed/disallowed via the "allowSW" boolean. */ -GrPathRenderer* GrContext::getPathRenderer(const GrPipelineBuilder* pipelineBuilder, +GrPathRenderer* GrContext::getPathRenderer(const GrPipelineBuilder& pipelineBuilder, const SkMatrix& viewMatrix, const SkPath& path, const GrStrokeInfo& stroke, diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index f52d7dcd15..d64273a828 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -691,7 +691,7 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder, const GrStrokeInfo* strokeInfoPtr = &strokeInfo; // Try a 1st time without stroking the path and without allowing the SW renderer - GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, + GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr, false, type); @@ -707,7 +707,7 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder, return; } strokeInfoPtr = &dashlessStrokeInfo; - pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix, + pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr, false, type); } @@ -732,7 +732,7 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder, } // This time, allow SW renderer - pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix, + pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr, true, type); } diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp index b1eb3202bf..c6bc4c08f1 100644 --- a/src/gpu/GrPathRendererChain.cpp +++ b/src/gpu/GrPathRendererChain.cpp @@ -40,7 +40,7 @@ GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) { } GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderCaps, - const GrPipelineBuilder* pipelineBuilder, + const GrPipelineBuilder& pipelineBuilder, const SkMatrix& viewMatrix, const SkPath& path, const GrStrokeInfo& stroke, @@ -70,7 +70,7 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderC for (int i = 0; i < fChain.count(); ++i) { GrPathRenderer::CanDrawPathArgs args; args.fShaderCaps = shaderCaps; - args.fPipelineBuilder = pipelineBuilder; + args.fPipelineBuilder = &pipelineBuilder; args.fViewMatrix = &viewMatrix; args.fPath = &path; args.fStroke = &stroke; |