OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrCoordTransform_DEFINED | 8 #ifndef GrCoordTransform_DEFINED |
9 #define GrCoordTransform_DEFINED | 9 #define GrCoordTransform_DEFINED |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 kDevice_GrCoordSet, | 35 kDevice_GrCoordSet, |
36 }; | 36 }; |
37 | 37 |
38 /** | 38 /** |
39 * A class representing a linear transformation from one of the built-in coordin
ate sets (local or | 39 * A class representing a linear transformation from one of the built-in coordin
ate sets (local or |
40 * position). GrProcessors just define these transformations, and the framework
does the rest of the | 40 * position). GrProcessors just define these transformations, and the framework
does the rest of the |
41 * work to make the transformed coordinates available in their fragment shader. | 41 * work to make the transformed coordinates available in their fragment shader. |
42 */ | 42 */ |
43 class GrCoordTransform : SkNoncopyable { | 43 class GrCoordTransform : SkNoncopyable { |
44 public: | 44 public: |
45 GrCoordTransform() { SkDEBUGCODE(fInProcessor = false); } | 45 GrCoordTransform() : fSourceCoords(kLocal_GrCoordSet) { SkDEBUGCODE(fInProce
ssor = false); } |
46 | 46 |
47 /** | 47 /** |
48 * Create a transformation that maps [0, 1] to a texture's boundaries. The p
recision is inferred | 48 * Create a transformation that maps [0, 1] to a texture's boundaries. The p
recision is inferred |
49 * from the texture size and filter. The texture origin also implies whether
a y-reversal should | 49 * from the texture size and filter. The texture origin also implies whether
a y-reversal should |
50 * be performed. | 50 * be performed. |
51 */ | 51 */ |
52 GrCoordTransform(GrCoordSet sourceCoords, | 52 GrCoordTransform(GrCoordSet sourceCoords, |
53 const GrTexture* texture, | 53 const GrTexture* texture, |
54 GrTextureParams::FilterMode filter) { | 54 GrTextureParams::FilterMode filter) { |
55 SkASSERT(texture); | 55 SkASSERT(texture); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 #ifdef SK_DEBUG | 139 #ifdef SK_DEBUG |
140 public: | 140 public: |
141 void setInProcessor() const { fInProcessor = true; } | 141 void setInProcessor() const { fInProcessor = true; } |
142 private: | 142 private: |
143 mutable bool fInProcessor; | 143 mutable bool fInProcessor; |
144 #endif | 144 #endif |
145 }; | 145 }; |
146 | 146 |
147 #endif | 147 #endif |
OLD | NEW |