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

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

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: a bit more tweaking 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 , fReadsFragPosition(false) {} 33 , fReadsFragPosition(false) {}
32 34
33 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor, 35 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor,
34 GrColorComponentFlags flags, bool areCoverageStag es); 36 GrColorComponentFlags flags, bool areCoverageStag es);
35 37
38 void calcColorWithBatch(const GrBatch*, const GrBatchOpt&, const GrFragmentS tage*,
39 int stagecount);
40 void calcCoverageWithBatch(const GrBatch*, const GrBatchOpt&, const GrFragme ntStage*,
41 int stagecount);
42
43 // TODO delete these when batch is everywhere
36 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount); 44 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag e*, int stagecount);
37 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*, 45 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS tage*,
38 int stagecount); 46 int stagecount);
39 47
40 bool isSolidWhite() const { return fInOut.isSolidWhite(); } 48 bool isSolidWhite() const { return fInOut.isSolidWhite(); }
41 bool isOpaque() const { return fInOut.isOpaque(); } 49 bool isOpaque() const { return fInOut.isOpaque(); }
42 bool isSingleComponent() const { return fInOut.isSingleComponent(); } 50 bool isSingleComponent() const { return fInOut.isSingleComponent(); }
43 51
44 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function. 52 // TODO: Once texture pixel configs quaries are updated, we no longer need t his function.
45 // For now this function will correctly tell us if we are using LCD text or not and should only 53 // 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
82 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF ragPosition); 90 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF ragPosition);
83 91
84 GrInvariantOutput fInOut; 92 GrInvariantOutput fInOut;
85 int fFirstEffectStageIndex; 93 int fFirstEffectStageIndex;
86 bool fInputColorIsUsed; 94 bool fInputColorIsUsed;
87 GrColor fInputColor; 95 GrColor fInputColor;
88 bool fReadsFragPosition; 96 bool fReadsFragPosition;
89 }; 97 };
90 98
91 #endif 99 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698