Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 2035823002: Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrSWMaskHelper.cpp
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 849a9338ed81cbd5d4d60680546650eae5fc620e..6e99f07bc8bf10cbace76b7428968372a17c921b 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -8,7 +8,9 @@
#include "GrSWMaskHelper.h"
#include "GrCaps.h"
-#include "GrDrawTarget.h"
+#include "GrContext.h"
+#include "batches/GrDrawBatch.h"
+#include "GrDrawContext.h"
#include "GrGpu.h"
#include "GrPipelineBuilder.h"
#include "GrStyle.h"
@@ -159,8 +161,9 @@ GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrTextureProvider* texProvider,
}
void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
- GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+ GrDrawContext* drawContext,
+ const GrPaint* paint,
+ const GrUserStencilSettings* userStencilSettings,
const GrClip& clip,
GrColor color,
const SkMatrix& viewMatrix,
@@ -169,7 +172,6 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
if (!viewMatrix.invert(&invert)) {
return;
}
- GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps(*pipelineBuilder);
SkRect dstRect = SkRect::MakeLTRB(SK_Scalar1 * rect.fLeft,
SK_Scalar1 * rect.fTop,
@@ -183,7 +185,11 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
maskMatrix.setIDiv(texture->width(), texture->height());
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
- pipelineBuilder->addCoverageFragmentProcessor(
+ GrPipelineBuilder pipelineBuilder(*paint, drawContext->isUnifiedMultisampled());
+ pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget());
+ pipelineBuilder.setUserStencil(userStencilSettings);
+
+ pipelineBuilder.addCoverageFragmentProcessor(
GrSimpleTextureEffect::Create(texture,
maskMatrix,
GrTextureParams::kNone_FilterMode,
@@ -191,5 +197,5 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, SkMatrix::I(),
dstRect, nullptr, &invert));
- target->drawBatch(*pipelineBuilder, clip, batch);
+ drawContext->drawBatch(pipelineBuilder, clip, batch);
}

Powered by Google App Engine
This is Rietveld 408576698