diff options
author | Brian Salomon <bsalomon@google.com> | 2017-06-14 09:49:26 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-14 20:26:51 +0000 |
commit | 1ec03f33cf493352174c748662d4a3cca29f78fd (patch) | |
tree | 352c8f7fe900ea4c71846f3bc45a7f5a26d6469e /gm | |
parent | d99148623b1daecc54eca1e2df607a49f86c6fae (diff) |
Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses.
Consolidates op factory functions to a rewritten GrRectOpFactory.
Removes GrRenderTargetContext::drawNonAAFilledRect() in favor of creating and adding ops directly by the callers.
Change-Id: I57e5fc739bf4e92b4a4710c739e6d22cce82a479
Reviewed-on: https://skia-review.googlesource.com/17711
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/bigrrectaaeffect.cpp | 6 | ||||
-rw-r--r-- | gm/constcolorprocessor.cpp | 6 | ||||
-rw-r--r-- | gm/rrects.cpp | 11 | ||||
-rw-r--r-- | gm/texturedomaineffect.cpp | 6 | ||||
-rw-r--r-- | gm/yuvtorgbeffect.cpp | 11 |
5 files changed, 18 insertions, 22 deletions
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp index 92c3a24252..e60cfdf7b8 100644 --- a/gm/bigrrectaaeffect.cpp +++ b/gm/bigrrectaaeffect.cpp @@ -13,7 +13,7 @@ #include "SkRRect.h" #include "effects/GrRRectEffect.h" #include "ops/GrDrawOp.h" -#include "ops/GrNonAAFillRectOp.h" +#include "ops/GrRectOpFactory.h" namespace skiagm { @@ -89,8 +89,8 @@ protected: bounds.offset(SkIntToScalar(x), SkIntToScalar(y)); renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), SkMatrix::I(), bounds, - nullptr, nullptr, GrAAType::kNone)); + GrRectOpFactory::MakeNonAAFill(std::move(grPaint), SkMatrix::I(), + bounds, GrAAType::kNone)); } canvas->restore(); x = x + fTestOffsetX; diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp index bbfca008bd..39926a98eb 100644 --- a/gm/constcolorprocessor.cpp +++ b/gm/constcolorprocessor.cpp @@ -18,7 +18,7 @@ #include "SkGradientShader.h" #include "effects/GrConstColorProcessor.h" #include "ops/GrDrawOp.h" -#include "ops/GrNonAAFillRectOp.h" +#include "ops/GrRectOpFactory.h" namespace skiagm { /** @@ -110,8 +110,8 @@ protected: grPaint.addColorFragmentProcessor(std::move(fp)); renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), viewMatrix, renderRect, - nullptr, nullptr, GrAAType::kNone)); + GrRectOpFactory::MakeNonAAFill(std::move(grPaint), viewMatrix, + renderRect, GrAAType::kNone)); // 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 23f576b5e9..3124895a49 100644 --- a/gm/rrects.cpp +++ b/gm/rrects.cpp @@ -12,7 +12,7 @@ #include "GrRenderTargetContextPriv.h" #include "effects/GrRRectEffect.h" #include "ops/GrDrawOp.h" -#include "ops/GrNonAAFillRectOp.h" +#include "ops/GrRectOpFactory.h" #endif #include "SkRRect.h" @@ -117,12 +117,9 @@ protected: bounds.outset(2.f, 2.f); renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), - SkMatrix::I(), - bounds, - nullptr, - nullptr, - GrAAType::kNone)); + GrRectOpFactory::MakeNonAAFill(std::move(grPaint), + SkMatrix::I(), bounds, + GrAAType::kNone)); } else { drew = false; } diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index d49e059c56..e54404ef64 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -18,7 +18,7 @@ #include "SkGradientShader.h" #include "effects/GrTextureDomain.h" #include "ops/GrDrawOp.h" -#include "ops/GrNonAAFillRectOp.h" +#include "ops/GrRectOpFactory.h" namespace skiagm { /** @@ -134,8 +134,8 @@ protected: const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); grPaint.addColorFragmentProcessor(std::move(fp)); renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), viewMatrix, renderRect, - nullptr, nullptr, GrAAType::kNone)); + GrRectOpFactory::MakeNonAAFill(std::move(grPaint), viewMatrix, + renderRect, GrAAType::kNone)); x += renderRect.width() + kTestPad; } y += renderRect.height() + kTestPad; diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index eb2e422286..c6effed793 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -19,7 +19,7 @@ #include "SkGradientShader.h" #include "effects/GrYUVEffect.h" #include "ops/GrDrawOp.h" -#include "ops/GrNonAAFillRectOp.h" +#include "ops/GrRectOpFactory.h" #define YSIZE 8 #define USIZE 4 @@ -133,8 +133,8 @@ protected: SkMatrix viewMatrix; viewMatrix.setTranslate(x, y); renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), viewMatrix, renderRect, - nullptr, nullptr, GrAAType::kNone)); + GrRectOpFactory::MakeNonAAFill(std::move(grPaint), viewMatrix, + renderRect, GrAAType::kNone)); } x += renderRect.width() + kTestPad; } @@ -256,9 +256,8 @@ protected: SkMatrix viewMatrix; viewMatrix.setTranslate(x, y); grPaint.addColorFragmentProcessor(fp); - renderTargetContext->priv().testingOnly_addDrawOp( - GrNonAAFillRectOp::Make(std::move(grPaint), viewMatrix, renderRect, nullptr, - nullptr, GrAAType::kNone)); + renderTargetContext->priv().testingOnly_addDrawOp(GrRectOpFactory::MakeNonAAFill( + std::move(grPaint), viewMatrix, renderRect, GrAAType::kNone)); } } } |