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

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

Issue 1480353002: APIs which took colorPOI / coveragePOI pairs updated to take a GrPipelineOptimizations struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 90ab030d2479807054f99caeda8710ccda2e70a5..9de178d4782c081dc7bb799477dc3a2cd9e6e1ab 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -11,6 +11,7 @@
#include "GrContext.h"
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
+#include "GrPipeline.h"
#include "GrProcessor.h"
#include "GrTexture.h"
#include "GrTextureAccess.h"
@@ -99,8 +100,7 @@ public:
}
private:
- GrXferProcessor::OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+ GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations& optimizations,
bool doesStencilWrite,
GrColor* overrideColor,
const GrCaps& caps) override;
@@ -192,8 +192,7 @@ bool CustomXP::onIsEqual(const GrXferProcessor& other) const {
return fMode == s.fMode && fHWBlendEquation == s.fHWBlendEquation;
}
-GrXferProcessor::OptFlags CustomXP::onGetOptimizations(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+GrXferProcessor::OptFlags CustomXP::onGetOptimizations(const GrPipelineOptimizations& optimizations,
bool doesStencilWrite,
GrColor* overrideColor,
const GrCaps& caps) {
@@ -294,10 +293,10 @@ GrXferProcessor::OptFlags CustomXP::onGetOptimizations(const GrProcOptInfo& colo
*/
OptFlags flags = kNone_OptFlags;
- if (colorPOI.allStagesMultiplyInput()) {
+ if (optimizations.fColorPOI.allStagesMultiplyInput()) {
flags |= kCanTweakAlphaForCoverage_OptFlag;
}
- if (this->hasHWBlendEquation() && coveragePOI.isSolidWhite()) {
+ if (this->hasHWBlendEquation() && optimizations.fCoveragePOI.isSolidWhite()) {
flags |= kIgnoreCoverage_OptFlag;
}
return flags;
@@ -326,14 +325,12 @@ public:
private:
GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+ const GrPipelineOptimizations& optimizations,
bool hasMixedSamples,
const DstTexture*) const override;
bool willReadDstColor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+ const GrPipelineOptimizations& optimizations,
bool hasMixedSamples) const override;
bool onIsEqual(const GrXPFactory& xpfBase) const override {
@@ -357,11 +354,10 @@ CustomXPFactory::CustomXPFactory(SkXfermode::Mode mode)
}
GrXferProcessor* CustomXPFactory::onCreateXferProcessor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+ const GrPipelineOptimizations& opt,
bool hasMixedSamples,
const DstTexture* dstTexture) const {
- if (can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps)) {
+ if (can_use_hw_blend_equation(fHWBlendEquation, opt.fCoveragePOI, caps)) {
SkASSERT(!dstTexture || !dstTexture->texture());
return new CustomXP(fMode, fHWBlendEquation);
}
@@ -369,10 +365,9 @@ GrXferProcessor* CustomXPFactory::onCreateXferProcessor(const GrCaps& caps,
}
bool CustomXPFactory::willReadDstColor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
+ const GrPipelineOptimizations& optimizations,
bool hasMixedSamples) const {
- return !can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps);
+ return !can_use_hw_blend_equation(fHWBlendEquation, optimizations.fCoveragePOI, caps);
}
void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698