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

Side by Side Diff: src/gpu/GrProcOptInfo.h

Issue 862823004: Revert of GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: 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.cpp ('k') | src/gpu/GrProcOptInfo.cpp » ('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 2014 Google Inc. 2 * Copyright 2014 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 #ifndef GrProcOptInfo_DEFINED 8 #ifndef GrProcOptInfo_DEFINED
9 #define GrProcOptInfo_DEFINED 9 #define GrProcOptInfo_DEFINED
10 10
11 #include "GrColor.h" 11 #include "GrColor.h"
12 #include "GrInvariantOutput.h" 12 #include "GrInvariantOutput.h"
13 13
14 class GrBatch;
15 class GrFragmentStage; 14 class GrFragmentStage;
16 class GrFragmentProcessor; 15 class GrFragmentProcessor;
17 class GrPrimitiveProcessor; 16 class GrPrimitiveProcessor;
18 class GrProcessor; 17 class GrProcessor;
19 18
20 /** 19 /**
21 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use d to recognize 20 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use d to recognize
22 * optimizations related to eliminating stages and vertex attributes that aren't necessary for a 21 * optimizations related to eliminating stages and vertex attributes that aren't necessary for a
23 * draw. 22 * draw.
24 */ 23 */
25 class GrProcOptInfo { 24 class GrProcOptInfo {
26 public: 25 public:
27 GrProcOptInfo() 26 GrProcOptInfo()
28 : fInOut(0, static_cast<GrColorComponentFlags>(0), false) 27 : fInOut(0, static_cast<GrColorComponentFlags>(0), false)
29 , fFirstEffectStageIndex(0) 28 , fFirstEffectStageIndex(0)
30 , fInputColorIsUsed(true) 29 , fInputColorIsUsed(true)
31 , fInputColor(0) 30 , fInputColor(0)
32 , fReadsFragPosition(false) {} 31 , fReadsFragPosition(false) {}
33 32
34 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor, 33 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor,
35 GrColorComponentFlags flags, bool areCoverageStag es); 34 GrColorComponentFlags flags, bool areCoverageStag es);
36 35
37 void calcColorWithBatch(const GrBatch*, const GrFragmentStage*, int stagecou nt);
38 void calcCoverageWithBatch(const GrBatch*, const GrFragmentStage*, int stage count);
39
40 // TODO delete these when batch is everywhere
41 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount); 36 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount);
42 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*, 37 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*,
43 int stagecount); 38 int stagecount);
44 39
45 bool isSolidWhite() const { return fInOut.isSolidWhite(); } 40 bool isSolidWhite() const { return fInOut.isSolidWhite(); }
46 bool isOpaque() const { return fInOut.isOpaque(); } 41 bool isOpaque() const { return fInOut.isOpaque(); }
47 bool isSingleComponent() const { return fInOut.isSingleComponent(); } 42 bool isSingleComponent() const { return fInOut.isSingleComponent(); }
48 43
49 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function. 44 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function.
50 // For now this function will correctly tell us if we are using LCD text or not and should only 45 // For now this function will correctly tell us if we are using LCD text or not and should only
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF ragPosition); 82 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF ragPosition);
88 83
89 GrInvariantOutput fInOut; 84 GrInvariantOutput fInOut;
90 int fFirstEffectStageIndex; 85 int fFirstEffectStageIndex;
91 bool fInputColorIsUsed; 86 bool fInputColorIsUsed;
92 GrColor fInputColor; 87 GrColor fInputColor;
93 bool fReadsFragPosition; 88 bool fReadsFragPosition;
94 }; 89 };
95 90
96 #endif 91 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.cpp ('k') | src/gpu/GrProcOptInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698