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

Side by Side Diff: src/gpu/GrPipelineBuilder.cpp

Issue 919683002: Remove canApplyCoverage from XP and all related functions in gpu code. (Closed) Base URL: https://skia.googlesource.com/skia.git@pdDstCopy
Patch Set: Rebase Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrPipelineBuilder.h" 8 #include "GrPipelineBuilder.h"
9 9
10 #include "GrBlend.h" 10 #include "GrBlend.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 this->setState(GrPipelineBuilder::kDither_StateBit, paint.isDither()); 75 this->setState(GrPipelineBuilder::kDither_StateBit, paint.isDither());
76 this->setState(GrPipelineBuilder::kHWAntialias_StateBit, paint.isAntiAlias() ); 76 this->setState(GrPipelineBuilder::kHWAntialias_StateBit, paint.isAntiAlias() );
77 77
78 fColorProcInfoValid = false; 78 fColorProcInfoValid = false;
79 fCoverageProcInfoValid = false; 79 fCoverageProcInfoValid = false;
80 80
81 fColorCache = GrColor_ILLEGAL; 81 fColorCache = GrColor_ILLEGAL;
82 fCoverageCache = GrColor_ILLEGAL; 82 fCoverageCache = GrColor_ILLEGAL;
83 } 83 }
84 84
85 ////////////////////////////////////////////////////////////////////////////////
86
87 bool GrPipelineBuilder::canUseFracCoveragePrimProc(GrColor color,
88 const GrDrawTargetCaps& caps) const {
89 if (caps.dualSourceBlendingSupport()) {
90 return true;
91 }
92
93 this->calcColorInvariantOutput(color);
94
95 // The coverage isn't actually white, its unknown, but this will produce the same effect
96 // TODO we want to cache the result of this call, but we can probably clean up the interface
97 // so we don't have to pass in a seemingly known coverage
98 this->calcCoverageInvariantOutput(GrColor_WHITE);
99 return this->getXPFactory()->canApplyCoverage(fColorProcInfo, fCoverageProcI nfo);
100 }
101
102 //////////////////////////////////////////////////////////////////////////////s 85 //////////////////////////////////////////////////////////////////////////////s
103 86
104 bool GrPipelineBuilder::willXPNeedDstCopy(const GrDrawTargetCaps& caps, 87 bool GrPipelineBuilder::willXPNeedDstCopy(const GrDrawTargetCaps& caps,
105 const GrProcOptInfo& colorPOI, 88 const GrProcOptInfo& colorPOI,
106 const GrProcOptInfo& coveragePOI) cons t { 89 const GrProcOptInfo& coveragePOI) cons t {
107 return this->getXPFactory()->willNeedDstCopy(caps, colorPOI, coveragePOI); 90 return this->getXPFactory()->willNeedDstCopy(caps, colorPOI, coveragePOI);
108 } 91 }
109 92
110 void GrPipelineBuilder::AutoRestoreEffects::set(GrPipelineBuilder* pipelineBuild er) { 93 void GrPipelineBuilder::AutoRestoreEffects::set(GrPipelineBuilder* pipelineBuild er) {
111 if (fPipelineBuilder) { 94 if (fPipelineBuilder) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { 175 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const {
193 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { 176 if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
194 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; 177 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
195 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), 178 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
196 this->numCoverageStages(), cover age, flags, 179 this->numCoverageStages(), cover age, flags,
197 true); 180 true);
198 fCoverageProcInfoValid = true; 181 fCoverageProcInfoValid = true;
199 fCoverageCache = coverage; 182 fCoverageCache = coverage;
200 } 183 }
201 } 184 }
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698