void getTestTarget(GrTestTarget*);
GrPathRenderer* getPathRenderer(
- const GrPipelineBuilder*,
+ const GrPipelineBuilder&,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,
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,
}
// 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
? 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) {
// 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();
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) {
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);
}
// 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.
if (fillInverted) {
clipPath.toggleInverseFillType();
}
- pr = this->getContext()->getPathRenderer(&pipelineBuilder,
+ pr = this->getContext()->getPathRenderer(pipelineBuilder,
viewMatrix,
clipPath,
stroke,
* 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,
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);
return;
}
strokeInfoPtr = &dashlessStrokeInfo;
- pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix,
+ pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix,
*pathPtr, *strokeInfoPtr,
false, type);
}
}
// This time, allow SW renderer
- pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix,
+ pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix,
*pathPtr, *strokeInfoPtr,
true, type);
}
}
GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderCaps,
- const GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,
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;