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

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: Fix isSolidWhite Created 6 years, 2 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/effects/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvexPolyEffect.cpp
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 4857a9e96d6231b5b75d91736f6cf11316a2a9a9..836596a76130c168f10d4e5d078fc873c63e3643 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 onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE {
+ if (fRect.isEmpty()) {
+ // An empty rect will have no coverage anywhere.
+ inout->fColor = 0x00000000;
+ inout->fValidFlags = kRGBA_GrColorComponentFlags;
+ } else {
+ inout->fValidFlags = 0;
+ }
+ inout->fIsSingleComponent = 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::onComputeInvariantOutput(InvariantOutput* inout) const {
+ inout->fValidFlags = 0;
+ inout->fIsSingleComponent = false;
}
const GrBackendFragmentProcessorFactory& GrConvexPolyEffect::getFactory() const {
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698