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

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

Issue 379323002: Remove SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comment about const-ness of fLocalMatrix. Created 6 years, 5 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 | « gyp/skia_for_android_framework_defines.gypi ('k') | src/core/SkPaintPriv.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 8
9 #ifndef SkShader_DEFINED 9 #ifndef SkShader_DEFINED
10 #define SkShader_DEFINED 10 #define SkShader_DEFINED
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } 48 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; }
49 49
50 /** 50 /**
51 * Returns true if the local matrix is not an identity matrix. 51 * Returns true if the local matrix is not an identity matrix.
52 * 52 *
53 * FIXME: This can be incorrect for a Shader with its own local matrix 53 * FIXME: This can be incorrect for a Shader with its own local matrix
54 * that is also wrapped via CreateLocalMatrixShader. 54 * that is also wrapped via CreateLocalMatrixShader.
55 */ 55 */
56 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } 56 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); }
57 57
58 #ifdef SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX
59 /**
60 * Set the shader's local matrix.
61 * @param localM The shader's new local matrix.
62 */
63 void setLocalMatrix(const SkMatrix& localM) { fLocalMatrix = localM; }
64
65 /**
66 * Reset the shader's local matrix to identity.
67 */
68 void resetLocalMatrix() { fLocalMatrix.reset(); }
69 #endif
70
71 enum TileMode { 58 enum TileMode {
72 /** replicate the edge color if the shader draws outside of its 59 /** replicate the edge color if the shader draws outside of its
73 * original bounds 60 * original bounds
74 */ 61 */
75 kClamp_TileMode, 62 kClamp_TileMode,
76 63
77 /** repeat the shader's image horizontally and vertically */ 64 /** repeat the shader's image horizontally and vertically */
78 kRepeat_TileMode, 65 kRepeat_TileMode,
79 66
80 /** repeat the shader's image horizontally and vertically, alternating 67 /** repeat the shader's image horizontally and vertically, alternating
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 459
473 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; 460 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const;
474 461
475 /** 462 /**
476 * Your subclass must also override contextSize() if it overrides onCreateC ontext(). 463 * Your subclass must also override contextSize() if it overrides onCreateC ontext().
477 * Base class impl returns NULL. 464 * Base class impl returns NULL.
478 */ 465 */
479 virtual Context* onCreateContext(const ContextRec&, void* storage) const; 466 virtual Context* onCreateContext(const ContextRec&, void* storage) const;
480 467
481 private: 468 private:
469 // This is essentially const, but not officially so it can be modified in
470 // constructors.
482 SkMatrix fLocalMatrix; 471 SkMatrix fLocalMatrix;
483 472
484 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. 473 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor.
485 friend class SkLocalMatrixShader; 474 friend class SkLocalMatrixShader;
486 475
487 typedef SkFlattenable INHERITED; 476 typedef SkFlattenable INHERITED;
488 }; 477 };
489 478
490 #endif 479 #endif
OLDNEW
« no previous file with comments | « gyp/skia_for_android_framework_defines.gypi ('k') | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698