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

Side by Side Diff: include/gpu/GrCoordTransform.h

Issue 1003813003: some utils for rect and matrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « include/core/SkRect.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « include/core/SkRect.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698