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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 1228763005: small cleanups after fixing const of GrPipelineBuilder on DrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@const-fix3
Patch Set: tweaks Created 5 years, 5 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
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index d7501c3adf4b8ca9b76096a99eba202ed70d8559..b15bee9939d0019a81ec1d85b721b6a1a52c6063 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -32,12 +32,10 @@ namespace {
// stage matrix this also alters the vertex layout
void setup_drawstate_aaclip(const GrPipelineBuilder& pipelineBuilder,
GrTexture* result,
- GrPipelineBuilder::AutoRestoreFragmentProcessors* arfp,
- GrPipelineBuilder::AutoRestoreProcessorDataManager* arpdm,
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState* arfps,
const SkIRect &devBound) {
- SkASSERT(arfp && arpdm);
- arfp->set(&pipelineBuilder);
- arpdm->set(&pipelineBuilder);
+ SkASSERT(arfps);
+ arfps->set(&pipelineBuilder);
SkMatrix mat;
// We use device coords to compute the texture coordinates. We set our matrix to be a
@@ -48,8 +46,8 @@ void setup_drawstate_aaclip(const GrPipelineBuilder& pipelineBuilder,
SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height());
// This could be a long-lived effect that is cached with the alpha-mask.
- arfp->addCoverageProcessor(
- GrTextureDomainEffect::Create(arpdm->getProcessorDataManager(),
+ arfps->addCoverageProcessor(
+ GrTextureDomainEffect::Create(arfps->getProcessorDataManager(),
result,
mat,
GrTextureDomain::MakeTexelDomain(result, domainTexels),
@@ -123,18 +121,19 @@ bool GrClipMaskManager::useSWOnlyPath(const GrPipelineBuilder& pipelineBuilder,
return false;
}
-bool GrClipMaskManager::installClipEffects(const GrPipelineBuilder& pipelineBuilder,
- GrPipelineBuilder::AutoRestoreFragmentProcessors* arfp,
- const GrReducedClip::ElementList& elements,
- const SkVector& clipToRTOffset,
- const SkRect* drawBounds) {
+bool GrClipMaskManager::installClipEffects(
+ const GrPipelineBuilder& pipelineBuilder,
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState* arfps,
+ const GrReducedClip::ElementList& elements,
+ const SkVector& clipToRTOffset,
+ const SkRect* drawBounds) {
SkRect boundsInClipSpace;
if (drawBounds) {
boundsInClipSpace = *drawBounds;
boundsInClipSpace.offset(-clipToRTOffset.fX, -clipToRTOffset.fY);
}
- arfp->set(&pipelineBuilder);
+ arfps->set(&pipelineBuilder);
GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
GrReducedClip::ElementList::Iter iter(elements);
bool failed = false;
@@ -201,7 +200,7 @@ bool GrClipMaskManager::installClipEffects(const GrPipelineBuilder& pipelineBuil
break;
}
if (fp) {
- arfp->addCoverageProcessor(fp);
+ arfps->addCoverageProcessor(fp);
} else {
failed = true;
break;
@@ -211,7 +210,7 @@ bool GrClipMaskManager::installClipEffects(const GrPipelineBuilder& pipelineBuil
}
if (failed) {
- arfp->set(NULL);
+ arfps->set(NULL);
}
return !failed;
}
@@ -220,9 +219,8 @@ bool GrClipMaskManager::installClipEffects(const GrPipelineBuilder& pipelineBuil
// sort out what kind of clip mask needs to be created: alpha, stencil,
// scissor, or entirely software
bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
- GrPipelineBuilder::AutoRestoreFragmentProcessors* arfp,
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState* arfps,
GrPipelineBuilder::AutoRestoreStencil* ars,
- GrPipelineBuilder::AutoRestoreProcessorDataManager* arpdm,
GrScissorState* scissorState,
const SkRect* devBounds) {
fCurrClipMaskType = kNone_ClipMaskType;
@@ -296,7 +294,7 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
SkVector clipToRTOffset = { SkIntToScalar(-clip.origin().fX),
SkIntToScalar(-clip.origin().fY) };
if (elements.isEmpty() ||
- (requiresAA && this->installClipEffects(pipelineBuilder, arfp, elements, clipToRTOffset,
+ (requiresAA && this->installClipEffects(pipelineBuilder, arfps, elements, clipToRTOffset,
devBounds))) {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clip.origin());
@@ -336,12 +334,12 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
}
if (result) {
- arfp->set(&pipelineBuilder);
+ arfps->set(&pipelineBuilder);
// The mask's top left coord should be pinned to the rounded-out top left corner of
// clipSpace bounds. We determine the mask's position WRT to the render target here.
SkIRect rtSpaceMaskBounds = clipSpaceIBounds;
rtSpaceMaskBounds.offset(-clip.origin());
- setup_drawstate_aaclip(pipelineBuilder, result, arfp, arpdm, rtSpaceMaskBounds);
+ setup_drawstate_aaclip(pipelineBuilder, result, arfps, rtSpaceMaskBounds);
this->setPipelineBuilderStencil(pipelineBuilder, ars);
return true;
}
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698