bounds.outset(2.f, 2.f);
bounds.offset(SkIntToScalar(x), SkIntToScalar(y));
- tt.target()->drawBWRect(pipelineBuilder,
- 0xff000000,
- SkMatrix::I(),
- bounds);
+ tt.target()->drawNonAARect(pipelineBuilder,
+ 0xff000000,
+ SkMatrix::I(),
+ bounds);
}
canvas->restore();
x = x + kDrawOffset;
GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawBWRect(pipelineBuilder,
- grPaint.getColor(),
- viewMatrix,
- renderRect);
+ tt.target()->drawNonAARect(pipelineBuilder,
+ grPaint.getColor(),
+ viewMatrix,
+ renderRect);
// Draw labels for the input to the processor and the processor to the right of
// the test rect. The input label appears above the processor label.
SkRect bounds = rrect.getBounds();
bounds.outset(2.f, 2.f);
- tt.target()->drawBWRect(pipelineBuilder,
- 0xff000000,
- SkMatrix::I(),
- bounds);
+ tt.target()->drawNonAARect(pipelineBuilder,
+ 0xff000000,
+ SkMatrix::I(),
+ bounds);
} else {
drew = false;
}
pipelineBuilder.setRenderTarget(rt);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawBWRect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- renderRect);
+ tt.target()->drawNonAARect(pipelineBuilder,
+ GrColor_WHITE,
+ viewMatrix,
+ renderRect);
x += renderRect.width() + kTestPad;
}
y += renderRect.height() + kTestPad;
viewMatrix.setTranslate(x, y);
pipelineBuilder.setRenderTarget(rt);
pipelineBuilder.addColorProcessor(fp);
- tt.target()->drawBWRect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- renderRect);
+ tt.target()->drawNonAARect(pipelineBuilder,
+ GrColor_WHITE,
+ viewMatrix,
+ renderRect);
}
x += renderRect.width() + kTestPad;
}
fClipTarget->drawAARect(*pipelineBuilder, color, viewMatrix,
element->getRect(), devRect);
} else {
- fClipTarget->drawBWRect(*pipelineBuilder, color, viewMatrix,
- element->getRect());
+ fClipTarget->drawNonAARect(*pipelineBuilder, color, viewMatrix,
+ element->getRect());
}
return true;
default: {
GrTextureParams::kNone_FilterMode))->unref();
// The color passed in here does not matter since the coverageSetOpXP won't read it.
- fClipTarget->drawBWRect(*pipelineBuilder,
- GrColor_WHITE,
- SkMatrix::I(),
- SkRect::Make(dstBound));
+ fClipTarget->drawNonAARect(*pipelineBuilder,
+ GrColor_WHITE,
+ SkMatrix::I(),
+ SkRect::Make(dstBound));
}
GrTexture* GrClipMaskManager::createTempMask(int width, int height) {
backgroundPipelineBuilder.setStencil(kDrawOutsideElement);
// The color passed in here does not matter since the coverageSetOpXP won't read it.
- fClipTarget->drawSimpleRect(backgroundPipelineBuilder, GrColor_WHITE, translate,
- clipSpaceIBounds);
+ fClipTarget->drawNonAARect(backgroundPipelineBuilder, GrColor_WHITE, translate,
+ clipSpaceIBounds);
}
} else {
GrPipelineBuilder pipelineBuilder;
*pipelineBuilder.stencil() = gDrawToStencil;
// We need this AGP until everything is in GrBatch
- fClipTarget->drawBWRect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- element->getRect());
+ fClipTarget->drawNonAARect(pipelineBuilder,
+ GrColor_WHITE,
+ viewMatrix,
+ element->getRect());
} else {
if (!clipPath.isEmpty()) {
if (canRenderDirectToStencil) {
if (canDrawDirectToClip) {
if (Element::kRect_Type == element->getType()) {
// We need this AGP until everything is in GrBatch
- fClipTarget->drawBWRect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- element->getRect());
+ fClipTarget->drawNonAARect(pipelineBuilder,
+ GrColor_WHITE,
+ viewMatrix,
+ element->getRect());
} else {
GrPathRenderer::DrawPathArgs args;
args.fTarget = fClipTarget;
} else {
// The view matrix is setup to do clip space -> stencil space translation, so
// draw rect in clip space.
- fClipTarget->drawBWRect(pipelineBuilder,
- GrColor_WHITE,
- viewMatrix,
- SkRect::Make(clipSpaceIBounds));
+ fClipTarget->drawNonAARect(pipelineBuilder,
+ GrColor_WHITE,
+ viewMatrix,
+ SkRect::Make(clipSpaceIBounds));
}
}
}
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- target->drawBWRect(*pipelineBuilder, color, viewM, bounds, localMatrix);
+ target->drawNonAARect(*pipelineBuilder, color, viewM, bounds, localMatrix);
} else {
if (passCount > 1) {
pipelineBuilder->setDisableColorXPFactory();
}
GrPipelineBuilder pipelineBuilder(*paint, rt, clip);
- fDrawTarget->drawBWRect(pipelineBuilder,
- paint->getColor(),
- SkMatrix::I(),
- r,
- localMatrix);
+ fDrawTarget->drawNonAARect(pipelineBuilder,
+ paint->getColor(),
+ SkMatrix::I(),
+ r,
+ localMatrix);
}
}
viewMatrix.mapRect(&devBoundRect, rect);
SkAutoTUnref<GrDrawBatch> batch;
if (width >= 0) {
- batch.reset(GrRectBatchFactory::CreateStrokeAA(color, viewMatrix, rect, devBoundRect,
+ batch.reset(GrRectBatchFactory::CreateAAStroke(color, viewMatrix, rect, devBoundRect,
*strokeInfo));
} else {
- batch.reset(GrRectBatchFactory::CreateFillAA(color, viewMatrix, rect, devBoundRect));
+ batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect, devBoundRect));
}
fDrawTarget->drawBatch(pipelineBuilder, batch);
return;
if (width >= 0) {
// Non-AA hairlines are snapped to pixel centers to make which pixels are hit deterministic
bool snapToPixelCenters = (0 == width && !rt->isUnifiedMultisampled());
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateStrokeBW(
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAStroke(
color, viewMatrix, rect, width, snapToPixelCenters));
// Depending on sub-pixel coordinates and the particular GPU, we may lose a corner of
fDrawTarget->drawBatch(pipelineBuilder, batch);
} else {
// filled BW rect
- fDrawTarget->drawBWRect(pipelineBuilder, color, viewMatrix, rect);
+ fDrawTarget->drawNonAARect(pipelineBuilder, color, viewMatrix, rect);
}
}
}
GrPipelineBuilder pipelineBuilder(paint, rt, clip);
- fDrawTarget->drawBWRect(pipelineBuilder,
- paint.getColor(),
- viewMatrix,
- rectToDraw,
- localRect);
+ fDrawTarget->drawNonAARect(pipelineBuilder,
+ paint.getColor(),
+ viewMatrix,
+ rectToDraw,
+ localRect);
}
void GrDrawContext::drawNonAARectWithLocalMatrix(GrRenderTarget* rt,
}
GrPipelineBuilder pipelineBuilder(paint, rt, clip);
- fDrawTarget->drawBWRect(pipelineBuilder,
- paint.getColor(),
- viewMatrix,
- rectToDraw,
- localMatrix);
+ fDrawTarget->drawNonAARect(pipelineBuilder,
+ paint.getColor(),
+ viewMatrix,
+ rectToDraw,
+ localMatrix);
}
void GrDrawContext::drawVertices(GrRenderTarget* rt,
SkRect rects[2];
if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillNestedRectsAA(
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFillNestedRects(
color, viewMatrix, rects));
fDrawTarget->drawBatch(pipelineBuilder, batch);
return;
transformType, count, stencilSettings, pipelineInfo);
}
-void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder,
+void GrDrawTarget::drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect,
- nullptr, nullptr));
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect,
+ nullptr, nullptr));
this->drawBatch(pipelineBuilder, batch);
}
-void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder,
+void GrDrawTarget::drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect,
- nullptr, &localMatrix));
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect,
+ nullptr, &localMatrix));
this->drawBatch(pipelineBuilder, batch);
}
-void GrDrawTarget::drawBWRect(const GrPipelineBuilder& pipelineBuilder,
+void GrDrawTarget::drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& localRect) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect,
- &localRect, nullptr));
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect,
+ &localRect, nullptr));
this->drawBatch(pipelineBuilder, batch);
}
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillAA(color, viewMatrix, rect,
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect,
devRect));
this->drawBatch(pipelineBuilder, batch);
}
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setRenderTarget(renderTarget);
- this->drawSimpleRect(pipelineBuilder, color, SkMatrix::I(), *rect);
+ this->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), *rect);
} else {
GrBatch* batch = SkNEW_ARGS(GrClearBatch, (*rect, color, renderTarget));
this->onDrawBatch(batch);
* that rectangle before it is input to GrCoordTransforms that read local
* coordinates
*/
- void drawBWRect(const GrPipelineBuilder& pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect);
-
- void drawBWRect(const GrPipelineBuilder& pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkMatrix& localMatrix);
-
- void drawBWRect(const GrPipelineBuilder& pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect& localRect);
-
- /**
- * Helper for drawRect when the caller doesn't need separate local rects or matrices.
- */
- void drawSimpleRect(const GrPipelineBuilder& ds, GrColor color, const SkMatrix& viewM,
- const SkRect& rect) {
- this->drawBWRect(ds, color, viewM, rect);
- }
- void drawSimpleRect(const GrPipelineBuilder& ds, GrColor color, const SkMatrix& viewM,
- const SkIRect& irect) {
+ void drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
+ GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect);
+
+ void drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
+ GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkMatrix& localMatrix);
+
+ void drawNonAARect(const GrPipelineBuilder& pipelineBuilder,
+ GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect& localRect);
+
+ void drawNonAARect(const GrPipelineBuilder& ds,
+ GrColor color,
+ const SkMatrix& viewM,
+ const SkIRect& irect) {
SkRect rect = SkRect::Make(irect);
- this->drawBWRect(ds, color, viewM, rect);
+ this->drawNonAARect(ds, color, viewM, rect);
}
void drawAARect(const GrPipelineBuilder& pipelineBuilder,
if (applyAA) {
bounds.outset(SK_ScalarHalf, SK_ScalarHalf);
}
- target->drawBWRect(pipelineBuilder, color, SkMatrix::I(), bounds, invert);
+ target->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), bounds, invert);
return true;
}
GrTextureParams::kNone_FilterMode,
kDevice_GrCoordSet))->unref();
- target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), dstRect, invert);
+ target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), dstRect, invert);
}
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.iset(devClipBounds.fLeft, devClipBounds.fTop,
devClipBounds.fRight, devPathBounds.fTop);
- target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fLeft < devPathBounds.fLeft) {
rect.iset(devClipBounds.fLeft, devPathBounds.fTop,
devPathBounds.fLeft, devPathBounds.fBottom);
- target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fRight > devPathBounds.fRight) {
rect.iset(devPathBounds.fRight, devPathBounds.fTop,
devClipBounds.fRight, devPathBounds.fBottom);
- target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fBottom > devPathBounds.fBottom) {
rect.iset(devClipBounds.fLeft, devPathBounds.fBottom,
devClipBounds.fRight, devClipBounds.fBottom);
- target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
}
}
}
const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
- args.fTarget->drawBWRect(*pipelineBuilder, args.fColor, viewM, bounds, invert);
+ args.fTarget->drawNonAARect(*pipelineBuilder, args.fColor, viewM, bounds, invert);
} else {
GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
kZero_StencilOp,
}
matrix.preConcat(dstRectToSrcRect);
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillAA(grPaint.getColor(),
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill(grPaint.getColor(),
viewMatrix,
matrix,
dstRect,
namespace GrRectBatchFactory {
-GrDrawBatch* CreateStrokeBW(GrColor color,
+GrDrawBatch* CreateNonAAStroke(GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
SkScalar strokeWidth,
return GrStrokeRectBatch::Create(geometry, snapToPixelCenters);
}
-GrDrawBatch* CreateStrokeAA(GrColor color,
+GrDrawBatch* CreateAAStroke(GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect,
}
if (spare <= 0 && miterStroke) {
- return CreateFillAA(color, viewMatrix, devOutside, devOutside);
+ return CreateAAFill(color, viewMatrix, devOutside, devOutside);
}
SkRect devInside(devRect);
miterStroke);
}
-GrDrawBatch* CreateFillNestedRectsAA(GrColor color,
+GrDrawBatch* CreateAAFillNestedRects(GrColor color,
const SkMatrix& viewMatrix,
const SkRect rects[2]) {
SkASSERT(viewMatrix.rectStaysRect());
viewMatrix.mapRect(&devInside, rects[1]);
if (devInside.isEmpty()) {
- return CreateFillAA(color, viewMatrix, devOutside, devOutside);
+ return CreateAAFill(color, viewMatrix, devOutside, devOutside);
}
return create_stroke_aa_batch(color, viewMatrix, devOutside, devOutside, devInside, true);
*/
namespace GrRectBatchFactory {
-inline GrDrawBatch* CreateFillBW(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
+inline GrDrawBatch* CreateNonAAFill(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
return GrBWFillRectBatch::Create(color, viewMatrix, rect, localRect, localMatrix);
}
-inline GrDrawBatch* CreateFillAA(GrColor color,
+inline GrDrawBatch* CreateAAFill(GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect) {
return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect);
}
-inline GrDrawBatch* CreateFillAA(GrColor color,
+inline GrDrawBatch* CreateAAFill(GrColor color,
const SkMatrix& viewMatrix,
const SkMatrix& localMatrix,
const SkRect& rect,
return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRect);
}
-GrDrawBatch* CreateStrokeBW(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- SkScalar strokeWidth,
- bool snapToPixelCenters);
+GrDrawBatch* CreateNonAAStroke(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ SkScalar strokeWidth,
+ bool snapToPixelCenters);
-GrDrawBatch* CreateStrokeAA(GrColor,
+GrDrawBatch* CreateAAStroke(GrColor,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect,
const SkStrokeRec& stroke);
// First rect is outer; second rect is inner
-GrDrawBatch* CreateFillNestedRectsAA(GrColor,
+GrDrawBatch* CreateAAFillNestedRects(GrColor,
const SkMatrix& viewMatrix,
const SkRect rects[2]);