diff options
author | robertphillips <robertphillips@google.com> | 2016-06-23 14:07:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-23 14:07:00 -0700 |
commit | 28a838e532250fcca9673aca6c4616193a5a139d (patch) | |
tree | 3554ad76c7ce5f69d7ab200b3f2c52ba955827e0 /gm/yuvtorgbeffect.cpp | |
parent | b593a76749c6c7e12bf86aeaa06e1e52708e9bdf (diff) |
Move GrPipelineBuilder out of gms & reduce use of GrPipelineBuilder.h
Just another step in reining in the GrPLB
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2086293006
Review-Url: https://codereview.chromium.org/2086293006
Diffstat (limited to 'gm/yuvtorgbeffect.cpp')
-rw-r--r-- | gm/yuvtorgbeffect.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index a153c991fc..0be30088c8 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -13,7 +13,6 @@ #include "GrContext.h" #include "GrDrawContextPriv.h" -#include "GrPipelineBuilder.h" #include "SkBitmap.h" #include "SkGr.h" #include "SkGradientShader.h" @@ -113,19 +112,19 @@ protected: {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; for (int i = 0; i < 6; ++i) { - GrPipelineBuilder pipelineBuilder; - pipelineBuilder.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); + GrPaint grPaint; + grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); sk_sp<GrFragmentProcessor> fp(GrYUVEffect::MakeYUVToRGB( texture[indices[i][0]], texture[indices[i][1]], texture[indices[i][2]], sizes, static_cast<SkYUVColorSpace>(space), false)); if (fp) { SkMatrix viewMatrix; viewMatrix.setTranslate(x, y); - pipelineBuilder.addColorFragmentProcessor(std::move(fp)); + grPaint.addColorFragmentProcessor(std::move(fp)); SkAutoTUnref<GrDrawBatch> batch( GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix, renderRect, nullptr, nullptr)); - drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch); + drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); } x += renderRect.width() + kTestPad; } @@ -225,18 +224,18 @@ protected: SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset; SkScalar x = kDrawPad + kTestPad; - GrPipelineBuilder pipelineBuilder; - pipelineBuilder.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); + GrPaint grPaint; + grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); sk_sp<GrFragmentProcessor> fp( GrYUVEffect::MakeYUVToRGB(texture[0], texture[1], texture[2], sizes, static_cast<SkYUVColorSpace>(space), true)); if (fp) { SkMatrix viewMatrix; viewMatrix.setTranslate(x, y); - pipelineBuilder.addColorFragmentProcessor(fp); + grPaint.addColorFragmentProcessor(fp); SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill( GrColor_WHITE, viewMatrix, renderRect, nullptr, nullptr)); - drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch); + drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); } } } |