| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 GrCoordSet sourceCoords() const { return fSourceCoords; } | 118 GrCoordSet sourceCoords() const { return fSourceCoords; } |
| 119 const SkMatrix& getMatrix() const { return fMatrix; } | 119 const SkMatrix& getMatrix() const { return fMatrix; } |
| 120 bool reverseY() const { return fReverseY; } | 120 bool reverseY() const { return fReverseY; } |
| 121 GrSLPrecision precision() const { return fPrecision; } | 121 GrSLPrecision precision() const { return fPrecision; } |
| 122 | 122 |
| 123 /** Useful for effects that want to insert a texture matrix that is implied
by the texture | 123 /** Useful for effects that want to insert a texture matrix that is implied
by the texture |
| 124 dimensions */ | 124 dimensions */ |
| 125 static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) { | 125 static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) { |
| 126 SkASSERT(texture); | 126 SkASSERT(texture); |
| 127 SkMatrix mat; | 127 SkMatrix mat; |
| 128 mat.setIDiv(texture->width(), texture->height()); | 128 (void)mat.setIDiv(texture->width(), texture->height()); |
| 129 return mat; | 129 return mat; |
| 130 } | 130 } |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 GrCoordSet fSourceCoords; | 133 GrCoordSet fSourceCoords; |
| 134 SkMatrix fMatrix; | 134 SkMatrix fMatrix; |
| 135 bool fReverseY; | 135 bool fReverseY; |
| 136 GrSLPrecision fPrecision; | 136 GrSLPrecision fPrecision; |
| 137 typedef SkNoncopyable INHERITED; | 137 typedef SkNoncopyable INHERITED; |
| 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 |