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

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

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: Update from review comments Created 6 years 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 GrFragmentStage; 14 class GrFragmentStage;
15 class GrFragmentProcessor;
15 class GrGeometryProcessor; 16 class GrGeometryProcessor;
17 class GrProcessor;
16 18
17 /** 19 /**
18 * 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
19 * 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
20 * draw. 22 * draw.
21 */ 23 */
22 class GrProcOptInfo { 24 class GrProcOptInfo {
23 public: 25 public:
24 GrProcOptInfo() 26 GrProcOptInfo()
25 : fInOut(0, static_cast<GrColorComponentFlags>(0), false) 27 : fInOut(0, static_cast<GrColorComponentFlags>(0), false)
26 , fFirstEffectStageIndex(0) 28 , fFirstEffectStageIndex(0)
27 , fInputColorIsUsed(true) 29 , fInputColorIsUsed(true)
28 , fInputColor(0) 30 , fInputColor(0)
29 , fRemoveVertexAttrib(false) 31 , fRemoveVertexAttrib(false)
30 , fReadsDst(false) {} 32 , fReadsDst(false)
33 , fReadsFragPosition(false) {}
31 34
32 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor, 35 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s tartColor,
33 GrColorComponentFlags flags, bool areCoverageStag es, 36 GrColorComponentFlags flags, bool areCoverageStag es,
34 const GrGeometryProcessor* gp = NULL); 37 const GrGeometryProcessor* gp = NULL);
35 38
36 bool isSolidWhite() const { return fInOut.isSolidWhite(); } 39 bool isSolidWhite() const { return fInOut.isSolidWhite(); }
37 bool isOpaque() const { return fInOut.isOpaque(); } 40 bool isOpaque() const { return fInOut.isOpaque(); }
38 bool isSingleComponent() const { return fInOut.isSingleComponent(); } 41 bool isSingleComponent() const { return fInOut.isSingleComponent(); }
39 42
40 GrColor color() const { return fInOut.color(); } 43 GrColor color() const { return fInOut.color(); }
(...skipping 26 matching lines...) Expand all
67 * Given the set of optimizations determined by GrProcOptInfo, should the ca ller remove the 70 * Given the set of optimizations determined by GrProcOptInfo, should the ca ller remove the
68 * color/coverage vertex attribute that was input to the first stage. 71 * color/coverage vertex attribute that was input to the first stage.
69 */ 72 */
70 bool removeVertexAttrib() const { return fRemoveVertexAttrib; } 73 bool removeVertexAttrib() const { return fRemoveVertexAttrib; }
71 74
72 /** 75 /**
73 * Returns true if any of the stages preserved by GrProcOptInfo read the dst color. 76 * Returns true if any of the stages preserved by GrProcOptInfo read the dst color.
74 */ 77 */
75 bool readsDst() const { return fReadsDst; } 78 bool readsDst() const { return fReadsDst; }
76 79
80 /**
81 * Returns true if any of the stages preserved by GrProcOptInfo read the fra g position.
82 */
83 bool readsFragPosition() const { return fReadsFragPosition; }
84
77 private: 85 private:
78 GrInvariantOutput fInOut; 86 GrInvariantOutput fInOut;
79 int fFirstEffectStageIndex; 87 int fFirstEffectStageIndex;
80 bool fInputColorIsUsed; 88 bool fInputColorIsUsed;
81 GrColor fInputColor; 89 GrColor fInputColor;
82 bool fRemoveVertexAttrib; 90 bool fRemoveVertexAttrib;
83 bool fReadsDst; 91 bool fReadsDst;
92 bool fReadsFragPosition;
84 }; 93 };
85 94
86 #endif 95 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698