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

Unified Diff: src/gpu/GrPathRenderer.h

Issue 1962243002: Separate user and raw stencil settings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/GrGpu.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRenderer.h
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 3bc02306e63f7e8b83faf2313db5bf5ca8eda8b9..a7609db658d956e1b8de1dfa540c6f138d12d4e6 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -9,7 +9,6 @@
#define GrPathRenderer_DEFINED
#include "GrDrawTarget.h"
-#include "GrStencil.h"
#include "GrStyle.h"
#include "SkDrawProcs.h"
@@ -82,7 +81,7 @@ public:
bool fAntiAlias;
// These next two are only used by GrStencilAndCoverPathRenderer
- bool fIsStencilDisabled;
+ bool fHasUserStencilSettings;
bool fIsStencilBufferMSAA;
void validate() const {
@@ -155,11 +154,11 @@ public:
canArgs.fStyle = args.fStyle;
canArgs.fAntiAlias = args.fAntiAlias;
- canArgs.fIsStencilDisabled = args.fPipelineBuilder->getStencil().isDisabled();
+ canArgs.fHasUserStencilSettings = args.fPipelineBuilder->hasUserStencilSettings();
canArgs.fIsStencilBufferMSAA =
args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisampled();
SkASSERT(this->canDrawPath(canArgs));
- if (!args.fPipelineBuilder->getStencil().isDisabled()) {
+ if (args.fPipelineBuilder->hasUserStencilSettings()) {
SkASSERT(kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath));
SkASSERT(args.fStyle->isSimpleFill());
}
@@ -260,14 +259,16 @@ private:
* kStencilOnly in onGetStencilSupport().
*/
virtual void onStencilPath(const StencilPathArgs& args) {
- static constexpr GrStencilSettings kIncrementStencil(
- kReplace_StencilOp,
- kReplace_StencilOp,
- kAlways_StencilFunc,
- 0xffff,
- 0xffff,
- 0xffff);
- args.fPipelineBuilder->setStencil(kIncrementStencil);
+ static constexpr GrUserStencilSettings kIncrementStencil(
+ GrUserStencilSettings::StaticInit<
+ 0xffff,
+ GrUserStencilTest::kAlways,
+ 0xffff,
+ GrUserStencilOp::kReplace,
+ GrUserStencilOp::kReplace,
+ 0xffff>()
+ );
+ args.fPipelineBuilder->setUserStencil(&kIncrementStencil);
args.fPipelineBuilder->setDisableColorXPFactory();
DrawPathArgs drawArgs;
drawArgs.fTarget = args.fTarget;
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698