| 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 | |
| 112 /** | 103 /** |
| 113 * Given the current draw state and hw support, will HW AA lines be used (if | 104 * Given the current draw state and hw support, will HW AA lines be used (if |
| 114 * a line primitive type is drawn)? | 105 * a line primitive type is drawn)? |
| 115 */ | 106 */ |
| 116 bool willUseHWAALines() const; | 107 bool willUseHWAALines() const; |
| 117 | 108 |
| 118 /** | 109 /** |
| 119 * There are three types of "sources" of geometry (vertices and indices) for | 110 * There are three types of "sources" of geometry (vertices and indices) for |
| 120 * draw calls made on the target. When performing an indexed draw, the | 111 * draw calls made on the target. When performing an indexed draw, the |
| 121 * indices and vertices can use different source types. Once a source is | 112 * 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... |
| 886 const GrClipData* fClip; | 877 const GrClipData* fClip; |
| 887 GrDrawState* fDrawState; | 878 GrDrawState* fDrawState; |
| 888 GrDrawState fDefaultDraw
State; | 879 GrDrawState fDefaultDraw
State; |
| 889 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 880 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
| 890 GrContext* fContext; | 881 GrContext* fContext; |
| 891 | 882 |
| 892 typedef SkRefCnt INHERITED; | 883 typedef SkRefCnt INHERITED; |
| 893 }; | 884 }; |
| 894 | 885 |
| 895 #endif | 886 #endif |
| OLD | NEW |