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

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

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: cleanup Created 5 years, 11 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
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 GrBatchOpt;
14 class GrFragmentStage; 16 class GrFragmentStage;
15 class GrFragmentProcessor; 17 class GrFragmentProcessor;
16 class GrPrimitiveProcessor; 18 class GrPrimitiveProcessor;
17 class GrProcessor; 19 class GrProcessor;
18 20
19 /** 21 /**
20 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use d to recognize 22 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use d to recognize
21 * optimizations related to eliminating stages and vertex attributes that aren't necessary for a 23 * optimizations related to eliminating stages and vertex attributes that aren't necessary for a
22 * draw. 24 * draw.
23 */ 25 */
24 class GrProcOptInfo { 26 class GrProcOptInfo {
25 public: 27 public:
26 GrProcOptInfo() 28 GrProcOptInfo()
27 : fInOut(0, static_cast<GrColorComponentFlags>(0), false) 29 : fInOut(0, static_cast<GrColorComponentFlags>(0), false)
28 , fFirstEffectStageIndex(0) 30 , fFirstEffectStageIndex(0)
29 , fInputColorIsUsed(true) 31 , fInputColorIsUsed(true)
30 , fInputColor(0) 32 , fInputColor(0)
31 , fReadsDst(false) 33 , fReadsDst(false)
32 , fReadsFragPosition(false) {} 34 , fReadsFragPosition(false) {}
33 35
34 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor, 36 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor,
35 GrColorComponentFlags flags, bool areCoverageStag es); 37 GrColorComponentFlags flags, bool areCoverageStag es);
36 38
39 void calcColorWithBatch(const GrBatch*, const GrBatchOpt&, const GrFragmentS tage*,
40 int stagecount);
41 void calcCoverageWithBatch(const GrBatch*, const GrBatchOpt&, const GrFragme ntStage*,
42 int stagecount);
43
44 // TODO delete these when batch is everywhere
37 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount); 45 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount);
38 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*, 46 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*,
39 int stagecount); 47 int stagecount);
40 48
41 bool isSolidWhite() const { return fInOut.isSolidWhite(); } 49 bool isSolidWhite() const { return fInOut.isSolidWhite(); }
42 bool isOpaque() const { return fInOut.isOpaque(); } 50 bool isOpaque() const { return fInOut.isOpaque(); }
43 bool isSingleComponent() const { return fInOut.isSingleComponent(); } 51 bool isSingleComponent() const { return fInOut.isSingleComponent(); }
44 52
45 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function. 53 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function.
46 // For now this function will correctly tell us if we are using LCD text or not and should only 54 // For now this function will correctly tell us if we are using LCD text or not and should only
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 97
90 GrInvariantOutput fInOut; 98 GrInvariantOutput fInOut;
91 int fFirstEffectStageIndex; 99 int fFirstEffectStageIndex;
92 bool fInputColorIsUsed; 100 bool fInputColorIsUsed;
93 GrColor fInputColor; 101 GrColor fInputColor;
94 bool fReadsDst; 102 bool fReadsDst;
95 bool fReadsFragPosition; 103 bool fReadsFragPosition;
96 }; 104 };
97 105
98 #endif 106 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698