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

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

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment and nits Created 6 years, 3 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/GrConvexPolyEffect.cpp
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 4857a9e96d6231b5b75d91736f6cf11316a2a9a9..d63eee267846cca827484bbedca3a95df89bcc0e 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -29,17 +29,6 @@ public:
return SkNEW_ARGS(AARectEffect, (edgeType, rect));
}
- virtual void getConstantColorComponents(GrColor* color,
- uint32_t* validFlags) const SK_OVERRIDE {
- if (fRect.isEmpty()) {
- // An empty rect will have no coverage anywhere.
- *color = 0x00000000;
- *validFlags = kRGBA_GrColorComponentFlags;
- } else {
- *validFlags = 0;
- }
- }
-
GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE;
@@ -54,6 +43,17 @@ private:
return fRect == aare.fRect;
}
+ virtual void onComputeInvarientOutput(InvarientOutput* invarientOutput) const SK_OVERRIDE {
+ if (fRect.isEmpty()) {
+ // An empty rect will have no coverage anywhere.
+ invarientOutput->color = 0x00000000;
+ invarientOutput->validFlags = kRGBA_GrColorComponentFlags;
+ } else {
+ invarientOutput->validFlags = 0;
+ }
+ invarientOutput->isSingleComponent = false;
+ }
+
SkRect fRect;
GrPrimitiveEdgeType fEdgeType;
@@ -328,8 +328,9 @@ GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType edgeType, co
GrConvexPolyEffect::~GrConvexPolyEffect() {}
-void GrConvexPolyEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const {
- *validFlags = 0;
+void GrConvexPolyEffect::onComputeInvarientOutput(InvarientOutput* invarientOutput) const {
+ invarientOutput->validFlags = 0;
+ invarientOutput->isSingleComponent = false;
}
const GrBackendFragmentProcessorFactory& GrConvexPolyEffect::getFactory() const {

Powered by Google App Engine
This is Rietveld 408576698