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

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

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
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"
11 #include "GrPaint.h" 11 #include "GrPaint.h"
12 #include "GrPipeline.h" 12 #include "GrPipeline.h"
13 #include "GrProcOptInfo.h" 13 #include "GrProcOptInfo.h"
14 #include "GrXferProcessor.h" 14 #include "GrXferProcessor.h"
15 #include "batches/GrBatch.h" 15 #include "batches/GrBatch.h"
16 #include "batches/GrDrawBatch.h"
16 #include "effects/GrPorterDuffXferProcessor.h" 17 #include "effects/GrPorterDuffXferProcessor.h"
17 18
18 GrPipelineBuilder::GrPipelineBuilder() 19 GrPipelineBuilder::GrPipelineBuilder()
19 : fFlags(0x0), fDrawFace(kBoth_DrawFace) { 20 : fFlags(0x0), fDrawFace(kBoth_DrawFace) {
20 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 21 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
21 } 22 }
22 23
23 GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c onst GrClip& clip) { 24 GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c onst GrClip& clip) {
24 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 25 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
25 26
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 86
86 GrPipelineBuilder::~GrPipelineBuilder() { 87 GrPipelineBuilder::~GrPipelineBuilder() {
87 SkASSERT(0 == fBlockEffectRemovalCnt); 88 SkASSERT(0 == fBlockEffectRemovalCnt);
88 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { 89 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
89 fColorFragmentProcessors[i]->unref(); 90 fColorFragmentProcessors[i]->unref();
90 } 91 }
91 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { 92 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
92 fCoverageFragmentProcessors[i]->unref(); 93 fCoverageFragmentProcessors[i]->unref();
93 } 94 }
94 } 95 }
95
96 ////////////////////////////////////////////////////////////////////////////////
97
98 void GrPipelineBuilder::calcColorInvariantOutput(const GrDrawBatch* batch) const {
99 fColorProcInfo.calcColorWithBatch(batch, fColorFragmentProcessors.begin(),
100 this->numColorFragmentProcessors());
101 }
102
103 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrDrawBatch* batch) co nst {
104 fCoverageProcInfo.calcCoverageWithBatch(batch, fCoverageFragmentProcessors.b egin(),
105 this->numCoverageFragmentProcessors( ));
106 }
107
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698