OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrDrawTarget_DEFINED | 8 #ifndef GrDrawTarget_DEFINED |
9 #define GrDrawTarget_DEFINED | 9 #define GrDrawTarget_DEFINED |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 * following assumptions are made: | 93 * following assumptions are made: |
94 * 1. The caller intends to somehow specify coverage. This can be | 94 * 1. The caller intends to somehow specify coverage. This can be |
95 * specified either by enabling a coverage stage on the GrDrawState or | 95 * specified either by enabling a coverage stage on the GrDrawState or |
96 * via the vertex layout. | 96 * via the vertex layout. |
97 * 2. Other than enabling coverage stages or enabling coverage in the | 97 * 2. Other than enabling coverage stages or enabling coverage in the |
98 * layout, the current configuration of the target's GrDrawState is as | 98 * layout, the current configuration of the target's GrDrawState is as |
99 * it will be at draw time. | 99 * it will be at draw time. |
100 */ | 100 */ |
101 bool canApplyCoverage() const; | 101 bool canApplyCoverage() const; |
102 | 102 |
| 103 /** When we're using coverage AA but the blend is incompatible (given gpu |
| 104 * limitations) we should disable AA. */ |
| 105 bool shouldDisableCoverageAAForBlend() { |
| 106 // Enable below if we should draw with AA even when it produces |
| 107 // incorrect blending. |
| 108 // return false; |
| 109 return !this->canApplyCoverage(); |
| 110 } |
| 111 |
103 /** | 112 /** |
104 * Given the current draw state and hw support, will HW AA lines be used (if | 113 * Given the current draw state and hw support, will HW AA lines be used (if |
105 * a line primitive type is drawn)? | 114 * a line primitive type is drawn)? |
106 */ | 115 */ |
107 bool willUseHWAALines() const; | 116 bool willUseHWAALines() const; |
108 | 117 |
109 /** | 118 /** |
110 * There are three types of "sources" of geometry (vertices and indices) for | 119 * There are three types of "sources" of geometry (vertices and indices) for |
111 * draw calls made on the target. When performing an indexed draw, the | 120 * draw calls made on the target. When performing an indexed draw, the |
112 * indices and vertices can use different source types. Once a source is | 121 * indices and vertices can use different source types. Once a source is |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 const GrClipData* fClip; | 886 const GrClipData* fClip; |
878 GrDrawState* fDrawState; | 887 GrDrawState* fDrawState; |
879 GrDrawState fDefaultDraw
State; | 888 GrDrawState fDefaultDraw
State; |
880 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 889 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
881 GrContext* fContext; | 890 GrContext* fContext; |
882 | 891 |
883 typedef SkRefCnt INHERITED; | 892 typedef SkRefCnt INHERITED; |
884 }; | 893 }; |
885 | 894 |
886 #endif | 895 #endif |
OLD | NEW |