OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 SkMatrix inverse; | 291 SkMatrix inverse; |
292 if (fViewMatrix.invert(&inverse)) { | 292 if (fViewMatrix.invert(&inverse)) { |
293 if (matrix) { | 293 if (matrix) { |
294 *matrix = inverse; | 294 *matrix = inverse; |
295 } | 295 } |
296 return true; | 296 return true; |
297 } | 297 } |
298 return false; | 298 return false; |
299 } | 299 } |
300 | 300 |
301 /** | |
302 * Sets the view matrix to identity and updates any installed effects to com
pensate for the | |
303 * coord system change. | |
304 */ | |
305 bool setIdentityViewMatrix(); | |
306 | |
307 //////////////////////////////////////////////////////////////////////////// | 301 //////////////////////////////////////////////////////////////////////////// |
308 | 302 |
309 /** | 303 /** |
310 * Preconcats the current view matrix and restores the previous view matrix
in the destructor. | 304 * Preconcats the current view matrix and restores the previous view matrix
in the destructor. |
311 * Effect matrices are automatically adjusted to compensate and adjusted bac
k in the destructor. | 305 * Effect matrices are automatically adjusted to compensate and adjusted bac
k in the destructor. |
312 */ | 306 */ |
313 class AutoViewMatrixRestore : public ::SkNoncopyable { | 307 class AutoViewMatrixRestore : public ::SkNoncopyable { |
314 public: | 308 public: |
315 AutoViewMatrixRestore() : fDrawState(NULL) {} | 309 AutoViewMatrixRestore() : fDrawState(NULL) {} |
316 | 310 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 mutable bool fCoverageProcInfoValid; | 542 mutable bool fCoverageProcInfoValid; |
549 mutable GrColor fColorCache; | 543 mutable GrColor fColorCache; |
550 mutable GrColor fCoverageCache; | 544 mutable GrColor fCoverageCache; |
551 mutable const GrPrimitiveProcessor* fColorPrimProc; | 545 mutable const GrPrimitiveProcessor* fColorPrimProc; |
552 mutable const GrPrimitiveProcessor* fCoveragePrimProc; | 546 mutable const GrPrimitiveProcessor* fCoveragePrimProc; |
553 | 547 |
554 friend class GrOptDrawState; | 548 friend class GrOptDrawState; |
555 }; | 549 }; |
556 | 550 |
557 #endif | 551 #endif |
OLD | NEW |