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

Unified Diff: src/gpu/GrPaint.cpp

Issue 699943003: Move GrInvariantOutput out of GrProcessor and into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup Created 6 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/GrOvalRenderer.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPaint.cpp
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index 56e8aa02f3f4e23ac041f2e011c4609290a0859a..366378751d75bfc78a2da6c84a5e303566530de8 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -9,6 +9,7 @@
#include "GrPaint.h"
#include "GrBlend.h"
+#include "GrInvariantOutput.h"
#include "effects/GrSimpleTextureEffect.h"
void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) {
@@ -52,21 +53,18 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
// TODO: Share this implementation with GrDrawState
- GrProcessor::InvariantOutput inout;
- inout.fColor = 0xFFFFFFFF;
- inout.fValidFlags = kRGBA_GrColorComponentFlags;
- inout.fIsSingleComponent = true;
+ GrInvariantOutput inoutCoverage(0xFFFFFFFF,
+ kRGBA_GrColorComponentFlags,
+ true);
int count = fCoverageStages.count();
for (int i = 0; i < count; ++i) {
- fCoverageStages[i].getProcessor()->computeInvariantOutput(&inout);
+ fCoverageStages[i].getProcessor()->computeInvariantOutput(&inoutCoverage);
}
- if (!inout.isSolidWhite()) {
+ if (!inoutCoverage.isSolidWhite()) {
return false;
}
- inout.fColor = fColor;
- inout.fValidFlags = kRGBA_GrColorComponentFlags;
- inout.fIsSingleComponent = false;
+ GrInvariantOutput inout(fColor, kRGBA_GrColorComponentFlags, false);
count = fColorStages.count();
for (int i = 0; i < count; ++i) {
fColorStages[i].getProcessor()->computeInvariantOutput(&inout);
@@ -76,7 +74,7 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
GrBlendCoeff srcCoeff = fSrcBlendCoeff;
GrBlendCoeff dstCoeff = fDstBlendCoeff;
- GrSimplifyBlend(&srcCoeff, &dstCoeff, inout.fColor, inout.fValidFlags,
+ GrSimplifyBlend(&srcCoeff, &dstCoeff, inout.color(), inout.validFlags(),
0, 0, 0);
bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoeff);
@@ -89,8 +87,8 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
break;
case kOne_GrBlendCoeff:
- *solidColor = inout.fColor;
- *solidColorKnownComponents = inout.fValidFlags;
+ *solidColor = inout.color();
+ *solidColorKnownComponents = inout.validFlags();
break;
// The src coeff should never refer to the src and if it refers to dst then opaque
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698