SkAutoTUnref<GrBatch> batch(
BezierCubicOrConicTestBatch::Create(gp, geometry, klmEqs, klmSigns[c]));
- tt.target()->drawBatch(&pipelineBuilder, batch);
+ tt.target()->drawBatch(pipelineBuilder, batch);
}
++col;
if (numCols == col) {
SkAutoTUnref<GrBatch> batch(
BezierCubicOrConicTestBatch::Create(gp, geometry, klmEqs, 1.f));
- tt.target()->drawBatch(&pipelineBuilder, batch);
+ tt.target()->drawBatch(pipelineBuilder, batch);
}
++col;
if (numCols == col) {
SkAutoTUnref<GrBatch> batch(BezierQuadTestBatch::Create(gp, geometry, DevToUV));
- tt.target()->drawBatch(&pipelineBuilder, batch);
+ tt.target()->drawBatch(pipelineBuilder, batch);
}
++col;
if (numCols == col) {
GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawSimpleRect(&pipelineBuilder,
+ tt.target()->drawSimpleRect(pipelineBuilder,
grPaint.getColor(),
viewMatrix,
renderRect);
SkAutoTUnref<GrBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));
- tt.target()->drawBatch(&pipelineBuilder, batch);
+ tt.target()->drawBatch(pipelineBuilder, batch);
x += SkScalarCeilToScalar(path->getBounds().width() + 10.f);
}
SkAutoTUnref<GrBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));
- tt.target()->drawBatch(&pipelineBuilder, batch);
+ tt.target()->drawBatch(pipelineBuilder, batch);
x += SkScalarCeilToScalar(rect.width() + 10.f);
}
SkRect bounds = rrect.getBounds();
bounds.outset(2.f, 2.f);
- tt.target()->drawSimpleRect(&pipelineBuilder,
+ tt.target()->drawSimpleRect(pipelineBuilder,
0xff000000,
SkMatrix::I(),
bounds);
pipelineBuilder.setRenderTarget(rt);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawSimpleRect(&pipelineBuilder,
+ tt.target()->drawSimpleRect(pipelineBuilder,
GrColor_WHITE,
viewMatrix,
renderRect);
viewMatrix.setTranslate(x, y);
pipelineBuilder.setRenderTarget(rt);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawSimpleRect(&pipelineBuilder,
+ tt.target()->drawSimpleRect(pipelineBuilder,
GrColor_WHITE,
viewMatrix,
renderRect);
geometry.fPath = path;
SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
fAtlas, &fPathCache, &fPathList));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
SkAutoTUnref<GrBatch> batch(create_hairline_batch(color, viewMatrix, path, stroke,
devClipBounds));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
geometry.fMiterLimit = stroke.getMiter();
SkAutoTUnref<GrBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
}
void GrAARectRenderer::GeometryFillAARect(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
}
void GrAARectRenderer::StrokeAARect(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
};
void GrAARectRenderer::GeometryStrokeAARect(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& devOutside,
}
void GrAARectRenderer::FillAANestedRects(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect rects[2]) {
// between them by passing in stroke (==NULL means fill).
static void FillAARect(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
}
static void StrokeAARect(GrDrawTarget*,
- GrPipelineBuilder*,
+ const GrPipelineBuilder&,
GrColor,
const SkMatrix& viewMatrix,
const SkRect& rect,
// First rect is outer; second rect is inner
static void FillAANestedRects(GrDrawTarget*,
- GrPipelineBuilder*,
+ const GrPipelineBuilder&,
GrColor,
const SkMatrix& viewMatrix,
const SkRect rects[2]);
GrAARectRenderer();
static void GeometryFillAARect(GrDrawTarget*,
- GrPipelineBuilder*,
+ const GrPipelineBuilder&,
GrColor,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect);
static void GeometryStrokeAARect(GrDrawTarget*,
- GrPipelineBuilder*,
+ const GrPipelineBuilder&,
GrColor,
const SkMatrix& viewMatrix,
const SkRect& devOutside,
SkRect devRect = element->getRect();
viewMatrix.mapRect(&devRect);
- fClipTarget->drawAARect(pipelineBuilder, color, viewMatrix,
+ fClipTarget->drawAARect(*pipelineBuilder, color, viewMatrix,
element->getRect(), devRect);
} else {
- fClipTarget->drawSimpleRect(pipelineBuilder, color, viewMatrix,
+ fClipTarget->drawSimpleRect(*pipelineBuilder, color, viewMatrix,
element->getRect());
}
return true;
GrTextureParams::kNone_FilterMode))->unref();
// The color passed in here does not matter since the coverageSetOpXP won't read it.
- fClipTarget->drawSimpleRect(pipelineBuilder,
+ fClipTarget->drawSimpleRect(*pipelineBuilder,
GrColor_WHITE,
SkMatrix::I(),
SkRect::Make(dstBound));
backgroundPipelineBuilder.setStencil(kDrawOutsideElement);
// The color passed in here does not matter since the coverageSetOpXP won't read it.
- fClipTarget->drawSimpleRect(&backgroundPipelineBuilder, GrColor_WHITE, translate,
+ fClipTarget->drawSimpleRect(backgroundPipelineBuilder, GrColor_WHITE, translate,
clipSpaceIBounds);
}
} else {
*pipelineBuilder.stencil() = gDrawToStencil;
// We need this AGP until everything is in GrBatch
- fClipTarget->drawSimpleRect(&pipelineBuilder,
+ fClipTarget->drawSimpleRect(pipelineBuilder,
GrColor_WHITE,
viewMatrix,
element->getRect());
if (canDrawDirectToClip) {
if (Element::kRect_Type == element->getType()) {
// We need this AGP until everything is in GrBatch
- fClipTarget->drawSimpleRect(&pipelineBuilder,
+ fClipTarget->drawSimpleRect(pipelineBuilder,
GrColor_WHITE,
viewMatrix,
element->getRect());
} else {
// The view matrix is setup to do clip space -> stencil space translation, so
// draw rect in clip space.
- fClipTarget->drawSimpleRect(&pipelineBuilder,
+ fClipTarget->drawSimpleRect(pipelineBuilder,
GrColor_WHITE,
viewMatrix,
SkRect::Make(clipSpaceIBounds));
bool useAA) {
SkPoint pts[2];
SkAssertResult(path.isLine(pts));
- return GrDashingEffect::DrawDashLine(target, pipelineBuilder, color,
+ return GrDashingEffect::DrawDashLine(target, *pipelineBuilder, color,
viewMatrix, pts, useAA, stroke);
}
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- target->drawBWRect(pipelineBuilder, color, viewM, bounds, NULL, &localMatrix);
+ target->drawBWRect(*pipelineBuilder, color, viewM, bounds, NULL, &localMatrix);
} else {
if (passCount > 1) {
pipelineBuilder->setDisableColorXPFactory();
SkAutoTUnref<GrBatch> batch(DefaultPathBatch::Create(geometry, newCoverage, viewMatrix,
isHairline, devBounds));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
}
}
return true;
int /*GrDrawTarget::PathTransformType*/ transformType,
int count,
int /*GrPathRendering::FillType*/ fill) {
- fDrawTarget->drawPaths(pipelineBuilder, pathProc, pathRange,
+ fDrawTarget->drawPaths(*pipelineBuilder, pathProc, pathRange,
indices, (GrDrawTarget::PathIndexType) indexType,
transformValues,
(GrDrawTarget::PathTransformType) transformType,
}
GrPipelineBuilder pipelineBuilder(*paint, rt, clip);
- fDrawTarget->drawBWRect(&pipelineBuilder,
+ fDrawTarget->drawBWRect(pipelineBuilder,
paint->getColor(),
SkMatrix::I(),
r,
if (doAA) {
if (width >= 0) {
GrAARectRenderer::StrokeAARect(fDrawTarget,
- &pipelineBuilder,
+ pipelineBuilder,
color,
viewMatrix,
rect,
} else {
// filled AA rect
GrAARectRenderer::FillAARect(fDrawTarget,
- &pipelineBuilder,
+ pipelineBuilder,
color,
viewMatrix,
rect,
// is enabled because it can cause ugly artifacts.
pipelineBuilder.setState(GrPipelineBuilder::kSnapVerticesToPixelCenters_Flag,
snapToPixelCenters);
- fDrawTarget->drawBatch(&pipelineBuilder, batch);
+ fDrawTarget->drawBatch(pipelineBuilder, batch);
} else {
// filled BW rect
- fDrawTarget->drawSimpleRect(&pipelineBuilder, color, viewMatrix, rect);
+ fDrawTarget->drawSimpleRect(pipelineBuilder, color, viewMatrix, rect);
}
}
}
GrPipelineBuilder pipelineBuilder(paint, rt, clip);
- fDrawTarget->drawBWRect(&pipelineBuilder,
+ fDrawTarget->drawBWRect(pipelineBuilder,
paint.getColor(),
viewMatrix,
rectToDraw,
indexCount, colors, texCoords,
bounds));
- fDrawTarget->drawBatch(&pipelineBuilder, batch);
+ fDrawTarget->drawBatch(pipelineBuilder, batch);
}
///////////////////////////////////////////////////////////////////////////////
SkRect rects[2];
if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) {
- GrAARectRenderer::FillAANestedRects(fDrawTarget, &pipelineBuilder, color,
+ GrAARectRenderer::FillAANestedRects(fDrawTarget, pipelineBuilder, color,
viewMatrix, rects);
return;
}
}
void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch) {
- fDrawTarget->drawBatch(pipelineBuilder, batch);
+ fDrawTarget->drawBatch(*pipelineBuilder, batch);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
this->reset();
}
-void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder,
- GrBatch* batch) {
- SkASSERT(pipelineBuilder);
+void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrBatch* batch) {
// TODO some kind of checkdraw, but not at this level
// Setup clip
this->clipMaskManager()->adjustPathStencilParams(sb, outStencilSettings);
}
-void GrDrawTarget::stencilPath(GrPipelineBuilder* pipelineBuilder,
+void GrDrawTarget::stencilPath(const GrPipelineBuilder& pipelineBuilder,
const GrPathProcessor* pathProc,
const GrPath* path,
GrPathRendering::FillType fill) {
// TODO: extract portions of checkDraw that are relevant to path stenciling.
SkASSERT(path);
SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport());
- SkASSERT(pipelineBuilder);
// Setup clip
GrScissorState scissorState;
// set stencil settings for path
GrStencilSettings stencilSettings;
- GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+ GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
- this->onStencilPath(*pipelineBuilder, pathProc, path, scissorState, stencilSettings);
+ this->onStencilPath(pipelineBuilder, pathProc, path, scissorState, stencilSettings);
}
-void GrDrawTarget::drawPath(GrPipelineBuilder* pipelineBuilder,
+void GrDrawTarget::drawPath(const GrPipelineBuilder& pipelineBuilder,
const GrPathProcessor* pathProc,
const GrPath* path,
GrPathRendering::FillType fill) {
// TODO: extract portions of checkDraw that are relevant to path rendering.
SkASSERT(path);
SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport());
- SkASSERT(pipelineBuilder);
SkRect devBounds = path->getBounds();
pathProc->viewMatrix().mapRect(&devBounds);
// set stencil settings for path
GrStencilSettings stencilSettings;
- GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+ GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
this->onDrawPath(pathProc, path, stencilSettings, pipelineInfo);
}
-void GrDrawTarget::drawPaths(GrPipelineBuilder* pipelineBuilder,
+void GrDrawTarget::drawPaths(const GrPipelineBuilder& pipelineBuilder,
const GrPathProcessor* pathProc,
const GrPathRange* pathRange,
const void* indices,
SkASSERT(indices);
SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeInBytes(indexType));
SkASSERT(transformValues);
- SkASSERT(pipelineBuilder);
// Setup clip
GrScissorState scissorState;
// set stencil settings for path
GrStencilSettings stencilSettings;
- GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+ GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
transformType, count, stencilSettings, pipelineInfo);
}
-void GrDrawTarget::drawBWRect(GrPipelineBuilder* pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
+void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder,
+ GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
SkAutoTUnref<GrBatch> batch(GrRectBatch::Create(color, viewMatrix, rect, localRect,
localMatrix));
this->drawBatch(pipelineBuilder, batch);
}
-void GrDrawTarget::drawAARect(GrPipelineBuilder* pipelineBuilder,
+void GrDrawTarget::drawAARect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setRenderTarget(renderTarget);
- this->drawSimpleRect(&pipelineBuilder, color, SkMatrix::I(), *rect);
+ this->drawSimpleRect(pipelineBuilder, color, SkMatrix::I(), *rect);
} else {
this->onClear(rect, color, canIgnoreRect, renderTarget);
}
}
///////////////////////////////////////////////////////////////////////////////
-GrDrawTarget::PipelineInfo::PipelineInfo(GrPipelineBuilder* pipelineBuilder,
+GrDrawTarget::PipelineInfo::PipelineInfo(const GrPipelineBuilder& pipelineBuilder,
GrScissorState* scissor,
const GrPrimitiveProcessor* primProc,
const SkRect* devBounds,
GrDrawTarget* target)
- : fPipelineBuilder(pipelineBuilder)
+ : fPipelineBuilder(&pipelineBuilder)
, fScissor(scissor) {
fColorPOI = fPipelineBuilder->colorProcInfo(primProc);
fCoveragePOI = fPipelineBuilder->coverageProcInfo(primProc);
}
}
-GrDrawTarget::PipelineInfo::PipelineInfo(GrPipelineBuilder* pipelineBuilder,
+GrDrawTarget::PipelineInfo::PipelineInfo(const GrPipelineBuilder& pipelineBuilder,
GrScissorState* scissor,
const GrBatch* batch,
const SkRect* devBounds,
GrDrawTarget* target)
- : fPipelineBuilder(pipelineBuilder)
+ : fPipelineBuilder(&pipelineBuilder)
, fScissor(scissor) {
fColorPOI = fPipelineBuilder->colorProcInfo(batch);
fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch);
}
-bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder,
+bool GrClipTarget::setupClip(const GrPipelineBuilder& pipelineBuilder,
GrPipelineBuilder::AutoRestoreFragmentProcessors* arfp,
GrPipelineBuilder::AutoRestoreStencil* ars,
GrPipelineBuilder::AutoRestoreProcessorDataManager* arpdm,
GrScissorState* scissorState,
const SkRect* devBounds) {
- return fClipMaskManager->setupClipping(*pipelineBuilder,
+ return fClipMaskManager->setupClipping(pipelineBuilder,
arfp,
ars,
arpdm,
*/
const GrCaps* caps() const { return fCaps; }
- void drawBatch(GrPipelineBuilder*, GrBatch*);
+ void drawBatch(const GrPipelineBuilder&, GrBatch*);
/**
* Draws path into the stencil buffer. The fill must be either even/odd or
* on the GrPipelineBuilder (if possible in the 3D API). Note, we will never have an inverse
* fill with stencil path
*/
- void stencilPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*,
+ void stencilPath(const GrPipelineBuilder&, const GrPathProcessor*, const GrPath*,
GrPathRendering::FillType);
/**
* Draws a path. Fill must not be a hairline. It will respect the HW
* antialias flag on the GrPipelineBuilder (if possible in the 3D API).
*/
- void drawPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*,
+ void drawPath(const GrPipelineBuilder&, const GrPathProcessor*, const GrPath*,
GrPathRendering::FillType);
/**
* @param count Number of paths to draw
* @param fill Fill type for drawing all the paths
*/
- void drawPaths(GrPipelineBuilder*,
+ void drawPaths(const GrPipelineBuilder&,
const GrPathProcessor*,
const GrPathRange* pathRange,
const void* indices,
* that rectangle before it is input to GrCoordTransforms that read local
* coordinates
*/
- void drawBWRect(GrPipelineBuilder* pipelineBuilder,
+ void drawBWRect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
/**
* Helper for drawRect when the caller doesn't need separate local rects or matrices.
*/
- void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& viewM,
+ void drawSimpleRect(const GrPipelineBuilder& ds, GrColor color, const SkMatrix& viewM,
const SkRect& rect) {
this->drawBWRect(ds, color, viewM, rect, NULL, NULL);
}
- void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& viewM,
+ void drawSimpleRect(const GrPipelineBuilder& ds, GrColor color, const SkMatrix& viewM,
const SkIRect& irect) {
SkRect rect = SkRect::Make(irect);
this->drawBWRect(ds, color, viewM, rect, NULL, NULL);
}
- void drawAARect(GrPipelineBuilder* pipelineBuilder,
+ void drawAARect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect* drawBounds);
struct PipelineInfo {
- PipelineInfo(GrPipelineBuilder* pipelineBuilder, GrScissorState* scissor,
+ PipelineInfo(const GrPipelineBuilder& pipelineBuilder, GrScissorState* scissor,
const GrPrimitiveProcessor* primProc,
const SkRect* devBounds, GrDrawTarget* target);
- PipelineInfo(GrPipelineBuilder* pipelineBuilder, GrScissorState* scissor,
+ PipelineInfo(const GrPipelineBuilder& pipelineBuilder, GrScissorState* scissor,
const GrBatch* batch, const SkRect* devBounds,
GrDrawTarget* target);
bool mustSkipDraw() const { return (NULL == fPipelineBuilder); }
- GrPipelineBuilder* fPipelineBuilder;
+ const GrPipelineBuilder* fPipelineBuilder;
GrScissorState* fScissor;
GrProcOptInfo fColorPOI;
GrProcOptInfo fCoveragePOI;
const GrStencilAttachment*,
GrStencilSettings*);
virtual GrClipMaskManager* clipMaskManager() = 0;
- virtual bool setupClip(GrPipelineBuilder*,
+ virtual bool setupClip(const GrPipelineBuilder&,
GrPipelineBuilder::AutoRestoreFragmentProcessors*,
GrPipelineBuilder::AutoRestoreStencil*,
GrPipelineBuilder::AutoRestoreProcessorDataManager*,
private:
GrClipMaskManager* clipMaskManager() override { return fClipMaskManager; }
- bool setupClip(GrPipelineBuilder*,
+ bool setupClip(const GrPipelineBuilder&,
GrPipelineBuilder::AutoRestoreFragmentProcessors*,
GrPipelineBuilder::AutoRestoreStencil*,
GrPipelineBuilder::AutoRestoreProcessorDataManager*,
* efficiently succeed. It should only succeed if it can allow copySurface to perform a copy
* that would be more effecient than drawing the src to a dst render target.
*/
- virtual bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) = 0;
+ virtual bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const = 0;
// After the client interacts directly with the 3D context state the GrGpu
// must resync its internal state and assumptions about 3D context state.
const SkStrokeRec& stroke) {
SkAutoTUnref<GrBatch> batch(create_circle_batch(color, viewMatrix, useCoverageAA, circle,
stroke));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
}
///////////////////////////////////////////////////////////////////////////////
return false;
}
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
if (!batch) {
return false;
}
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
if (applyAA) {
bounds.outset(SK_ScalarHalf, SK_ScalarHalf);
}
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), bounds, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), bounds, NULL, &invert);
return true;
}
return false;
}
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
GrTextureParams::kNone_FilterMode,
kDevice_GrCoordSet))->unref();
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), dstRect, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), dstRect, NULL, &invert);
}
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.iset(devClipBounds.fLeft, devClipBounds.fTop,
devClipBounds.fRight, devPathBounds.fTop);
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
}
if (devClipBounds.fLeft < devPathBounds.fLeft) {
rect.iset(devClipBounds.fLeft, devPathBounds.fTop,
devPathBounds.fLeft, devPathBounds.fBottom);
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
}
if (devClipBounds.fRight > devPathBounds.fRight) {
rect.iset(devPathBounds.fRight, devPathBounds.fTop,
devClipBounds.fRight, devPathBounds.fBottom);
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
}
if (devClipBounds.fBottom > devPathBounds.fBottom) {
rect.iset(devClipBounds.fLeft, devPathBounds.fBottom,
devClipBounds.fRight, devClipBounds.fBottom);
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, NULL, &invert);
}
}
SkASSERT(!path.isInverseFillType());
SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(GrColor_WHITE, viewMatrix));
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, stroke));
- target->stencilPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
+ target->stencilPath(*pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
}
bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
// fake inverse with a stencil and cover
SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(GrColor_WHITE, viewMatrix));
- target->stencilPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
+ target->stencilPath(*pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
SkMatrix invert = SkMatrix::I();
SkRect bounds =
}
}
const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
- target->drawBWRect(pipelineBuilder, color, viewM, bounds, NULL, &invert);
+ target->drawBWRect(*pipelineBuilder, color, viewM, bounds, NULL, &invert);
} else {
GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
kZero_StencilOp,
pipelineBuilder->setStencil(kStencilPass);
SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatrix));
- target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
+ target->drawPath(*pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
}
pipelineBuilder->stencil()->setDisabled();
}
vmi.mapRect(&clipBounds);
SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM, clipBounds));
- target->drawBatch(pipelineBuilder, batch);
+ target->drawBatch(*pipelineBuilder, batch);
return true;
}
const SkIRect& srcRect,
const SkIPoint& dstPoint) override { return false; };
- bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) override {
+ bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override {
return false;
}
}
bool GrDashingEffect::DrawDashLine(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder, GrColor color,
+ const GrPipelineBuilder& pipelineBuilder, GrColor color,
const SkMatrix& viewMatrix, const SkPoint pts[2],
bool useAA, const GrStrokeInfo& strokeInfo) {
- SkAutoTUnref<GrBatch> batch(create_batch(color, viewMatrix, pts, useAA, strokeInfo,
- pipelineBuilder->getRenderTarget()->isUnifiedMultisampled()));
+ SkAutoTUnref<GrBatch> batch(
+ create_batch(color, viewMatrix, pts, useAA, strokeInfo,
+ pipelineBuilder.getRenderTarget()->isUnifiedMultisampled()));
if (!batch) {
return false;
}
class GrStrokeInfo;
namespace GrDashingEffect {
- bool DrawDashLine(GrDrawTarget*, GrPipelineBuilder*, GrColor,
+ bool DrawDashLine(GrDrawTarget*, const GrPipelineBuilder&, GrColor,
const SkMatrix& viewMatrix, const SkPoint pts[2], bool useAA,
const GrStrokeInfo& strokeInfo);
bool CanDrawDashLine(const SkPoint pts[2], const GrStrokeInfo& strokeInfo,
0));
}
-bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) {
+bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const {
// If the src is a texture, we can implement the blit as a draw assuming the config is
// renderable.
if (src->asTexture() && this->caps()->isConfigRenderable(src->config(), false)) {
size_t rowBytes) const override;
bool fullReadPixelsIsFasterThanPartial() const override;
- bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) override;
+ bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override;
// These functions should be used to bind GL objects. They track the GL state and skip redundant
// bindings. Making the equivalent glBind calls directly will confuse the state tracking.
set_random_state(&pipelineBuilder, &random);
set_random_stencil(&pipelineBuilder, &random);
- this->drawBatch(&pipelineBuilder, batch);
+ this->drawBatch(pipelineBuilder, batch);
}
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)