aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipelineBuilder.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@google.com>2015-01-27 06:41:33 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-27 06:41:33 -0800
commitca0a1799ffdceb4ccd998468566f39abac2f0b55 (patch)
tree5524b2cd3024f8ddfd076d21d05237562518800e /src/gpu/GrPipelineBuilder.cpp
parent7defaa6c4a7577742d1b42bc869a84bd9a96e5a7 (diff)
Revert of GrBatchPrototype (patchset #30 id:570001 of https://codereview.chromium.org/845103005/)
Reason for revert: creates large performance regression Original issue's description: > GrBatchPrototype > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/d15e4e45374275c045572b304c229237c4a82be4 TBR=bsalomon@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/862823004
Diffstat (limited to 'src/gpu/GrPipelineBuilder.cpp')
-rw-r--r--src/gpu/GrPipelineBuilder.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index 90aee748c9..f329c05b91 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -20,7 +20,9 @@ GrPipelineBuilder::GrPipelineBuilder()
, fColorProcInfoValid(false)
, fCoverageProcInfoValid(false)
, fColorCache(GrColor_ILLEGAL)
- , fCoverageCache(GrColor_ILLEGAL) {
+ , fCoverageCache(GrColor_ILLEGAL)
+ , fColorPrimProc(NULL)
+ , fCoveragePrimProc(NULL) {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
}
@@ -37,6 +39,8 @@ GrPipelineBuilder& GrPipelineBuilder::operator=(const GrPipelineBuilder& that) {
fCoverageProcInfoValid = that.fCoverageProcInfoValid;
fColorCache = that.fColorCache;
fCoverageCache = that.fCoverageCache;
+ fColorPrimProc = that.fColorPrimProc;
+ fCoveragePrimProc = that.fCoveragePrimProc;
if (fColorProcInfoValid) {
fColorProcInfo = that.fColorProcInfo;
}
@@ -80,6 +84,9 @@ void GrPipelineBuilder::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) {
fColorCache = GrColor_ILLEGAL;
fCoverageCache = GrColor_ILLEGAL;
+
+ fColorPrimProc = NULL;
+ fCoveragePrimProc = NULL;
}
////////////////////////////////////////////////////////////////////////////////
@@ -154,29 +161,22 @@ bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const {
}
void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
- fColorProcInfoValid = false;
-
+ if (!fColorProcInfoValid || fColorPrimProc != pp) {
+ fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColorStages());
+ fColorProcInfoValid = true;
+ fColorPrimProc = pp;
+ }
}
void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor* pp) const {
- fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
- this->numCoverageStages());
- fCoverageProcInfoValid = false;
-}
-
-void GrPipelineBuilder::calcColorInvariantOutput(const GrBatch* batch) const {
- fColorProcInfo.calcColorWithBatch(batch, fColorStages.begin(), this->numColorStages());
- fColorProcInfoValid = false;
-}
-
-void GrPipelineBuilder::calcCoverageInvariantOutput(const GrBatch* batch) const {
- fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageStages.begin(),
- this->numCoverageStages());
- fCoverageProcInfoValid = false;
+ if (!fCoverageProcInfoValid || fCoveragePrimProc != pp) {
+ fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(),
+ this->numCoverageStages());
+ fCoverageProcInfoValid = true;
+ fCoveragePrimProc = pp;
+ }
}
-
void GrPipelineBuilder::calcColorInvariantOutput(GrColor color) const {
if (!fColorProcInfoValid || color != fColorCache) {
GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;