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

Unified Diff: src/gpu/GrPipeline.cpp

Issue 2468653002: Remove GrStencilSettings from GrPipeline (Closed)
Patch Set: Remove GrStencilSettings from GrPipeline Created 4 years, 1 month 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/GrPipeline.h ('k') | src/gpu/GrProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipeline.cpp
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 08ffeb58b5d3ca8f9e5a94f3038497b81862da84..0ac17e7a9d36902b2176ea429a12f6f99deb34e8 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -21,19 +21,15 @@
GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
GrXPOverridesForBatch* overrides) {
const GrPipelineBuilder& builder = *args.fPipelineBuilder;
+ const GrUserStencilSettings* userStencil = builder.getUserStencil();
+ GrRenderTarget* rt = args.fRenderTargetContext->accessRenderTarget();
GrPipeline* pipeline = new (memory) GrPipeline;
- GrRenderTarget* rt = args.fRenderTargetContext->accessRenderTarget();
pipeline->fRenderTarget.reset(rt);
SkASSERT(pipeline->fRenderTarget);
pipeline->fScissorState = *args.fScissor;
pipeline->fWindowRectsState = *args.fWindowRectsState;
- if (builder.hasUserStencilSettings() || args.fHasStencilClip) {
- const GrRenderTargetPriv& rtPriv = rt->renderTargetPriv();
- pipeline->fStencilSettings.reset(*builder.getUserStencil(), args.fHasStencilClip,
- rtPriv.numStencilBits());
- SkASSERT(!pipeline->fStencilSettings.usesWrapOp() || args.fCaps->stencilWrapOpsSupport());
- }
+ pipeline->fUserStencilSettings = userStencil;
pipeline->fDrawFace = builder.getDrawFace();
pipeline->fFlags = 0;
@@ -55,10 +51,13 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
if (args.fHasStencilClip) {
pipeline->fFlags |= kHasStencilClip_Flag;
}
+ if (!userStencil->isDisabled(args.fHasStencilClip)) {
+ pipeline->fFlags |= kStencilEnabled_Flag;
+ }
// Create XferProcessor from DS's XPFactory
bool hasMixedSamples = args.fRenderTargetContext->hasMixedSamples() &&
- (builder.isHWAntialias() || !pipeline->fStencilSettings.isDisabled());
+ (builder.isHWAntialias() || pipeline->isStencilEnabled());
const GrXPFactory* xpFactory = builder.getXPFactory();
SkAutoTUnref<GrXferProcessor> xferProcessor;
if (xpFactory) {
@@ -88,7 +87,7 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
const GrXferProcessor* xpForOpts = xferProcessor ? xferProcessor.get() :
&GrPorterDuffXPFactory::SimpleSrcOverXP();
optFlags = xpForOpts->getOptimizations(args.fOpts,
- pipeline->fStencilSettings.doesWrite(),
+ userStencil->doesWrite(args.fHasStencilClip),
&overrideColor,
*args.fCaps);
@@ -226,7 +225,7 @@ bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b) {
a.fScissorState != b.fScissorState ||
!a.fWindowRectsState.cheapEqualTo(b.fWindowRectsState) ||
a.fFlags != b.fFlags ||
- a.fStencilSettings != b.fStencilSettings ||
+ a.fUserStencilSettings != b.fUserStencilSettings ||
a.fDrawFace != b.fDrawFace ||
a.fIgnoresCoverage != b.fIgnoresCoverage) {
return false;
« no previous file with comments | « src/gpu/GrPipeline.h ('k') | src/gpu/GrProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698