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

Unified Diff: src/gpu/effects/GrCoverageSetOpXP.cpp

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/effects/GrCoverageSetOpXP.cpp
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index 7761a6445ac14f91c2fda6984a387cc916ec2a27..abf4be0aa09de43d7879a9f4cc944fad475b954f 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -9,6 +9,7 @@
#include "effects/GrCoverageSetOpXP.h"
#include "GrCaps.h"
#include "GrColor.h"
+#include "GrPipeline.h"
#include "GrProcessor.h"
#include "GrProcOptInfo.h"
#include "glsl/GrGLSLBlend.h"
@@ -151,7 +152,6 @@ class ShaderCSOXferProcessor : public GrXferProcessor {
public:
ShaderCSOXferProcessor(const DstTexture* dstTexture,
bool hasMixedSamples,
- SkXfermode::Mode xfermode,
SkRegion::Op regionOp,
bool invertCoverage)
: INHERITED(dstTexture, true, hasMixedSamples)
@@ -310,11 +310,17 @@ GrXPFactory* GrCoverageSetOpXPFactory::Create(SkRegion::Op regionOp, bool invert
}
}
+bool GrCoverageSetOpXPFactory::willReadDstColor(const GrCaps& caps,
+ const GrPipelineOptimizations& optimizations,
+ bool hasMixedSamples) const {
+ return optimizations.fOverrides.fUsePLSDstRead;
egdaniel 2016/01/13 21:47:19 I am slightly worried about the need to check PLS
+}
+
GrXferProcessor*
GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrPipelineOptimizations& optimizations,
bool hasMixedSamples,
- const DstTexture* dst) const {
+ const DstTexture* dst) const {
egdaniel 2016/01/13 21:47:19 extra spaces
// We don't support inverting coverage with mixed samples. We don't expect to ever want this in
// the future, however we could at some point make this work using an inverted coverage
// modulation table. Note that an inverted table still won't work if there are coverage procs.
@@ -323,6 +329,9 @@ GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps,
return nullptr;
}
+ if (optimizations.fOverrides.fUsePLSDstRead) {
+ return new ShaderCSOXferProcessor(dst, hasMixedSamples, fRegionOp, fInvertCoverage);
+ }
return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage);
}

Powered by Google App Engine
This is Rietveld 408576698