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

Side by Side Diff: include/core/SkMatrix.h

Issue 200223008: Remove SkCanvas matrix ops return value. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per comments Created 6 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMatrix_DEFINED 10 #ifndef SkMatrix_DEFINED
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 */ 211 */
212 void setSinCos(SkScalar sinValue, SkScalar cosValue); 212 void setSinCos(SkScalar sinValue, SkScalar cosValue);
213 /** Set the matrix to skew by sx and sy, with a pivot point at (px, py). 213 /** Set the matrix to skew by sx and sy, with a pivot point at (px, py).
214 The pivot point is the coordinate that should remain unchanged by the 214 The pivot point is the coordinate that should remain unchanged by the
215 specified transformation. 215 specified transformation.
216 */ 216 */
217 void setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py); 217 void setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py);
218 /** Set the matrix to skew by sx and sy. 218 /** Set the matrix to skew by sx and sy.
219 */ 219 */
220 void setSkew(SkScalar kx, SkScalar ky); 220 void setSkew(SkScalar kx, SkScalar ky);
221 /** Set the matrix to the concatenation of the two specified matrices, 221 /** Set the matrix to the concatenation of the two specified matrices.
222 returning true if the the result can be represented. Either of the 222 Either of the two matrices may also be the target matrix.
223 two matrices may also be the target matrix. *this = a * b; 223 *this = a * b;
224 */ 224 */
225 bool setConcat(const SkMatrix& a, const SkMatrix& b); 225 void setConcat(const SkMatrix& a, const SkMatrix& b);
226 226
227 /** Preconcats the matrix with the specified translation. 227 /** Preconcats the matrix with the specified translation.
228 M' = M * T(dx, dy) 228 M' = M * T(dx, dy)
229 */ 229 */
230 bool preTranslate(SkScalar dx, SkScalar dy); 230 void preTranslate(SkScalar dx, SkScalar dy);
231 /** Preconcats the matrix with the specified scale. 231 /** Preconcats the matrix with the specified scale.
232 M' = M * S(sx, sy, px, py) 232 M' = M * S(sx, sy, px, py)
233 */ 233 */
234 bool preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py); 234 void preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py);
235 /** Preconcats the matrix with the specified scale. 235 /** Preconcats the matrix with the specified scale.
236 M' = M * S(sx, sy) 236 M' = M * S(sx, sy)
237 */ 237 */
238 bool preScale(SkScalar sx, SkScalar sy); 238 void preScale(SkScalar sx, SkScalar sy);
239 /** Preconcats the matrix with the specified rotation. 239 /** Preconcats the matrix with the specified rotation.
240 M' = M * R(degrees, px, py) 240 M' = M * R(degrees, px, py)
241 */ 241 */
242 bool preRotate(SkScalar degrees, SkScalar px, SkScalar py); 242 void preRotate(SkScalar degrees, SkScalar px, SkScalar py);
243 /** Preconcats the matrix with the specified rotation. 243 /** Preconcats the matrix with the specified rotation.
244 M' = M * R(degrees) 244 M' = M * R(degrees)
245 */ 245 */
246 bool preRotate(SkScalar degrees); 246 void preRotate(SkScalar degrees);
247 /** Preconcats the matrix with the specified skew. 247 /** Preconcats the matrix with the specified skew.
248 M' = M * K(kx, ky, px, py) 248 M' = M * K(kx, ky, px, py)
249 */ 249 */
250 bool preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py); 250 void preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py);
251 /** Preconcats the matrix with the specified skew. 251 /** Preconcats the matrix with the specified skew.
252 M' = M * K(kx, ky) 252 M' = M * K(kx, ky)
253 */ 253 */
254 bool preSkew(SkScalar kx, SkScalar ky); 254 void preSkew(SkScalar kx, SkScalar ky);
255 /** Preconcats the matrix with the specified matrix. 255 /** Preconcats the matrix with the specified matrix.
256 M' = M * other 256 M' = M * other
257 */ 257 */
258 bool preConcat(const SkMatrix& other); 258 void preConcat(const SkMatrix& other);
259 259
260 /** Postconcats the matrix with the specified translation. 260 /** Postconcats the matrix with the specified translation.
261 M' = T(dx, dy) * M 261 M' = T(dx, dy) * M
262 */ 262 */
263 bool postTranslate(SkScalar dx, SkScalar dy); 263 void postTranslate(SkScalar dx, SkScalar dy);
264 /** Postconcats the matrix with the specified scale. 264 /** Postconcats the matrix with the specified scale.
265 M' = S(sx, sy, px, py) * M 265 M' = S(sx, sy, px, py) * M
266 */ 266 */
267 bool postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py); 267 void postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py);
268 /** Postconcats the matrix with the specified scale. 268 /** Postconcats the matrix with the specified scale.
269 M' = S(sx, sy) * M 269 M' = S(sx, sy) * M
270 */ 270 */
271 bool postScale(SkScalar sx, SkScalar sy); 271 void postScale(SkScalar sx, SkScalar sy);
272 /** Postconcats the matrix by dividing it by the specified integers. 272 /** Postconcats the matrix by dividing it by the specified integers.
273 M' = S(1/divx, 1/divy, 0, 0) * M 273 M' = S(1/divx, 1/divy, 0, 0) * M
274 */ 274 */
275 bool postIDiv(int divx, int divy); 275 bool postIDiv(int divx, int divy);
276 /** Postconcats the matrix with the specified rotation. 276 /** Postconcats the matrix with the specified rotation.
277 M' = R(degrees, px, py) * M 277 M' = R(degrees, px, py) * M
278 */ 278 */
279 bool postRotate(SkScalar degrees, SkScalar px, SkScalar py); 279 void postRotate(SkScalar degrees, SkScalar px, SkScalar py);
280 /** Postconcats the matrix with the specified rotation. 280 /** Postconcats the matrix with the specified rotation.
281 M' = R(degrees) * M 281 M' = R(degrees) * M
282 */ 282 */
283 bool postRotate(SkScalar degrees); 283 void postRotate(SkScalar degrees);
284 /** Postconcats the matrix with the specified skew. 284 /** Postconcats the matrix with the specified skew.
285 M' = K(kx, ky, px, py) * M 285 M' = K(kx, ky, px, py) * M
286 */ 286 */
287 bool postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py); 287 void postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py);
288 /** Postconcats the matrix with the specified skew. 288 /** Postconcats the matrix with the specified skew.
289 M' = K(kx, ky) * M 289 M' = K(kx, ky) * M
290 */ 290 */
291 bool postSkew(SkScalar kx, SkScalar ky); 291 void postSkew(SkScalar kx, SkScalar ky);
292 /** Postconcats the matrix with the specified matrix. 292 /** Postconcats the matrix with the specified matrix.
293 M' = other * M 293 M' = other * M
294 */ 294 */
295 bool postConcat(const SkMatrix& other); 295 void postConcat(const SkMatrix& other);
296 296
297 enum ScaleToFit { 297 enum ScaleToFit {
298 /** 298 /**
299 * Scale in X and Y independently, so that src matches dst exactly. 299 * Scale in X and Y independently, so that src matches dst exactly.
300 * This may change the aspect ratio of the src. 300 * This may change the aspect ratio of the src.
301 */ 301 */
302 kFill_ScaleToFit, 302 kFill_ScaleToFit,
303 /** 303 /**
304 * Compute a scale that will maintain the original src aspect ratio, 304 * Compute a scale that will maintain the original src aspect ratio,
305 * but will also ensure that src fits entirely inside dst. At least one 305 * but will also ensure that src fits entirely inside dst. At least one
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 694 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
695 int count); 695 int count);
696 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 696 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
697 697
698 static const MapPtsProc gMapPtsProcs[]; 698 static const MapPtsProc gMapPtsProcs[];
699 699
700 friend class SkPerspIter; 700 friend class SkPerspIter;
701 }; 701 };
702 702
703 #endif 703 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | src/core/SkMatrix.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698