From d2b23e0ee6dcb366540b12d13552120289ee3da0 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Fri, 21 Aug 2015 10:53:34 -0700 Subject: [PATCH] Standardize BW to NonAA TBR=bsalomon@google.com, robertphillips@google.com BUG=skia: Review URL: https://codereview.chromium.org/1310533004 --- gm/bigrrectaaeffect.cpp | 8 ++--- gm/constcolorprocessor.cpp | 8 ++--- gm/rrects.cpp | 8 ++--- gm/texturedomaineffect.cpp | 8 ++--- gm/yuvtorgbeffect.cpp | 8 ++--- src/gpu/GrClipMaskManager.cpp | 40 ++++++++++++------------- src/gpu/GrDefaultPathRenderer.cpp | 2 +- src/gpu/GrDrawContext.cpp | 40 ++++++++++++------------- src/gpu/GrDrawTarget.cpp | 22 +++++++------- src/gpu/GrDrawTarget.h | 49 ++++++++++++++----------------- src/gpu/GrOvalRenderer.cpp | 2 +- src/gpu/GrSWMaskHelper.cpp | 2 +- src/gpu/GrSoftwarePathRenderer.cpp | 8 ++--- src/gpu/GrStencilAndCoverPathRenderer.cpp | 2 +- src/gpu/SkGpuDevice.cpp | 2 +- src/gpu/batches/GrRectBatchFactory.cpp | 10 +++---- src/gpu/batches/GrRectBatchFactory.h | 28 +++++++++--------- 17 files changed, 121 insertions(+), 126 deletions(-) diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp index f603abe..cf151fb 100644 --- a/gm/bigrrectaaeffect.cpp +++ b/gm/bigrrectaaeffect.cpp @@ -85,10 +85,10 @@ protected: 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; diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp index 9177ce5..30544af 100644 --- a/gm/constcolorprocessor.cpp +++ b/gm/constcolorprocessor.cpp @@ -115,10 +115,10 @@ protected: 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. diff --git a/gm/rrects.cpp b/gm/rrects.cpp index fa7351b..62ad48f 100644 --- a/gm/rrects.cpp +++ b/gm/rrects.cpp @@ -120,10 +120,10 @@ protected: 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; } diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 63d7aef..07b7119 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -130,10 +130,10 @@ protected: 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; diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index 6f087e2..4ec86f4 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -124,10 +124,10 @@ protected: 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; } diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 8a5ee1d..b58faaa 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -410,8 +410,8 @@ bool GrClipMaskManager::drawElement(GrPipelineBuilder* pipelineBuilder, 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: { @@ -497,10 +497,10 @@ void GrClipMaskManager::mergeMask(GrPipelineBuilder* pipelineBuilder, 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) { @@ -690,8 +690,8 @@ GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, 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; @@ -827,10 +827,10 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, *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) { @@ -869,10 +869,10 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, 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; @@ -888,10 +888,10 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, } 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)); } } } diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp index 6fe2005..8112232 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -686,7 +686,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target, } 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(); diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 7590328..445a661 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -195,11 +195,11 @@ void GrDrawContext::drawPaint(GrRenderTarget* rt, } GrPipelineBuilder pipelineBuilder(*paint, rt, clip); - fDrawTarget->drawBWRect(pipelineBuilder, - paint->getColor(), - SkMatrix::I(), - r, - localMatrix); + fDrawTarget->drawNonAARect(pipelineBuilder, + paint->getColor(), + SkMatrix::I(), + r, + localMatrix); } } @@ -281,10 +281,10 @@ void GrDrawContext::drawRect(GrRenderTarget* rt, viewMatrix.mapRect(&devBoundRect, rect); SkAutoTUnref 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; @@ -293,7 +293,7 @@ void GrDrawContext::drawRect(GrRenderTarget* rt, 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 batch(GrRectBatchFactory::CreateStrokeBW( + SkAutoTUnref batch(GrRectBatchFactory::CreateNonAAStroke( color, viewMatrix, rect, width, snapToPixelCenters)); // Depending on sub-pixel coordinates and the particular GPU, we may lose a corner of @@ -304,7 +304,7 @@ void GrDrawContext::drawRect(GrRenderTarget* rt, fDrawTarget->drawBatch(pipelineBuilder, batch); } else { // filled BW rect - fDrawTarget->drawBWRect(pipelineBuilder, color, viewMatrix, rect); + fDrawTarget->drawNonAARect(pipelineBuilder, color, viewMatrix, rect); } } @@ -321,11 +321,11 @@ void GrDrawContext::drawNonAARectToRect(GrRenderTarget* rt, } 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, @@ -341,11 +341,11 @@ 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, @@ -642,7 +642,7 @@ void GrDrawContext::drawPath(GrRenderTarget* rt, SkRect rects[2]; if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) { - SkAutoTUnref batch(GrRectBatchFactory::CreateFillNestedRectsAA( + SkAutoTUnref batch(GrRectBatchFactory::CreateAAFillNestedRects( color, viewMatrix, rects)); fDrawTarget->drawBatch(pipelineBuilder, batch); return; diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index f5d4af6..98c7587 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -309,32 +309,32 @@ void GrDrawTarget::drawPaths(const GrPipelineBuilder& pipelineBuilder, 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 batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect, - nullptr, nullptr)); + SkAutoTUnref 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 batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect, - nullptr, &localMatrix)); + SkAutoTUnref 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 batch(GrRectBatchFactory::CreateFillBW(color, viewMatrix, rect, - &localRect, nullptr)); + SkAutoTUnref batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect, + &localRect, nullptr)); this->drawBatch(pipelineBuilder, batch); } @@ -344,7 +344,7 @@ void GrDrawTarget::drawAARect(const GrPipelineBuilder& pipelineBuilder, const SkMatrix& viewMatrix, const SkRect& rect, const SkRect& devRect) { - SkAutoTUnref batch(GrRectBatchFactory::CreateFillAA(color, viewMatrix, rect, + SkAutoTUnref batch(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect, devRect)); this->drawBatch(pipelineBuilder, batch); } @@ -378,7 +378,7 @@ void GrDrawTarget::clear(const SkIRect* rect, 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); diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index 1f7e297..48ac06d 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -120,34 +120,29 @@ public: * 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, diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 364c567..2ad7e72 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -1458,7 +1458,7 @@ bool GrOvalRenderer::DrawDRRect(GrDrawTarget* target, 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; } diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index 7edcd6a..f421b81 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -373,5 +373,5 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture, GrTextureParams::kNone_FilterMode, kDevice_GrCoordSet))->unref(); - target->drawBWRect(*pipelineBuilder, color, SkMatrix::I(), dstRect, invert); + target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), dstRect, invert); } diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 31f8fc4..613228e 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -81,22 +81,22 @@ void draw_around_inv_path(GrDrawTarget* target, 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); } } diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp index e375944..60f9f64 100644 --- a/src/gpu/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp @@ -137,7 +137,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { } } 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, diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index c808ade..23151d4 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -986,7 +986,7 @@ static void draw_aa_bitmap(GrDrawContext* drawContext, GrContext* context, } matrix.preConcat(dstRectToSrcRect); - SkAutoTUnref batch(GrRectBatchFactory::CreateFillAA(grPaint.getColor(), + SkAutoTUnref batch(GrRectBatchFactory::CreateAAFill(grPaint.getColor(), viewMatrix, matrix, dstRect, diff --git a/src/gpu/batches/GrRectBatchFactory.cpp b/src/gpu/batches/GrRectBatchFactory.cpp index 86980d2..f01010b 100644 --- a/src/gpu/batches/GrRectBatchFactory.cpp +++ b/src/gpu/batches/GrRectBatchFactory.cpp @@ -30,7 +30,7 @@ static GrDrawBatch* create_stroke_aa_batch(GrColor color, namespace GrRectBatchFactory { -GrDrawBatch* CreateStrokeBW(GrColor color, +GrDrawBatch* CreateNonAAStroke(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect, SkScalar strokeWidth, @@ -43,7 +43,7 @@ GrDrawBatch* CreateStrokeBW(GrColor color, return GrStrokeRectBatch::Create(geometry, snapToPixelCenters); } -GrDrawBatch* CreateStrokeAA(GrColor color, +GrDrawBatch* CreateAAStroke(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect, const SkRect& devRect, @@ -82,7 +82,7 @@ GrDrawBatch* CreateStrokeAA(GrColor color, } if (spare <= 0 && miterStroke) { - return CreateFillAA(color, viewMatrix, devOutside, devOutside); + return CreateAAFill(color, viewMatrix, devOutside, devOutside); } SkRect devInside(devRect); @@ -102,7 +102,7 @@ GrDrawBatch* CreateStrokeAA(GrColor color, miterStroke); } -GrDrawBatch* CreateFillNestedRectsAA(GrColor color, +GrDrawBatch* CreateAAFillNestedRects(GrColor color, const SkMatrix& viewMatrix, const SkRect rects[2]) { SkASSERT(viewMatrix.rectStaysRect()); @@ -113,7 +113,7 @@ GrDrawBatch* CreateFillNestedRectsAA(GrColor color, 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); diff --git a/src/gpu/batches/GrRectBatchFactory.h b/src/gpu/batches/GrRectBatchFactory.h index 5a43a34..195a2b9 100644 --- a/src/gpu/batches/GrRectBatchFactory.h +++ b/src/gpu/batches/GrRectBatchFactory.h @@ -22,22 +22,22 @@ class SkStrokeRec; */ 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, @@ -45,20 +45,20 @@ inline GrDrawBatch* CreateFillAA(GrColor color, 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]); -- 2.7.4