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
This commit is contained in:
robertphillips 2015-10-27 07:53:35 -07:00 committed by Commit bot
parent 3f7357f1a0
commit cf10b5a432
6 changed files with 15 additions and 17 deletions

View File

@ -334,7 +334,7 @@ public:
void getTestTarget(GrTestTarget*);
GrPathRenderer* getPathRenderer(
const GrPipelineBuilder*,
const GrPipelineBuilder&,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,

View File

@ -56,7 +56,7 @@ public:
whether the path can be rendered with arbitrary stencil rules or not. See comments on
StencilSupport in GrPathRenderer.h. */
GrPathRenderer* getPathRenderer(const GrShaderCaps* shaderCaps,
const GrPipelineBuilder*,
const GrPipelineBuilder&,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,

View File

@ -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,

View File

@ -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,

View File

@ -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);
}

View File

@ -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;