OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkSurface_DEFINED | 8 #ifndef SkSurface_DEFINED |
9 #define SkSurface_DEFINED | 9 #define SkSurface_DEFINED |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 * method will return a new value. | 74 * method will return a new value. |
75 * | 75 * |
76 * If this surface is empty (i.e. has a zero-dimention), this will return | 76 * If this surface is empty (i.e. has a zero-dimention), this will return |
77 * 0. | 77 * 0. |
78 */ | 78 */ |
79 uint32_t generationID(); | 79 uint32_t generationID(); |
80 | 80 |
81 /** | 81 /** |
82 * Call this if the contents have changed. This will (lazily) force a new | 82 * Call this if the contents have changed. This will (lazily) force a new |
83 * value to be returned from generationID() when it is called next. | 83 * value to be returned from generationID() when it is called next. |
| 84 * @param canDiscardContents For performance, set to true when it is known |
| 85 * that the contents of the surface do not need to be preserved (e.g. |
| 86 * because they will be overwritten). |
84 */ | 87 */ |
85 void notifyContentChanged(); | 88 void notifyContentChanged(bool canDiscardContents = false); |
86 | 89 |
87 /** | 90 /** |
88 * Return a canvas that will draw into this surface. This will always | 91 * Return a canvas that will draw into this surface. This will always |
89 * return the same canvas for a given surface, and is manged/owned by the | 92 * return the same canvas for a given surface, and is manged/owned by the |
90 * surface. It should not be used when its parent surface has gone out of | 93 * surface. It should not be used when its parent surface has gone out of |
91 * scope. | 94 * scope. |
92 */ | 95 */ |
93 SkCanvas* getCanvas(); | 96 SkCanvas* getCanvas(); |
94 | 97 |
95 /** | 98 /** |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 136 |
134 private: | 137 private: |
135 const int fWidth; | 138 const int fWidth; |
136 const int fHeight; | 139 const int fHeight; |
137 uint32_t fGenerationID; | 140 uint32_t fGenerationID; |
138 | 141 |
139 typedef SkRefCnt INHERITED; | 142 typedef SkRefCnt INHERITED; |
140 }; | 143 }; |
141 | 144 |
142 #endif | 145 #endif |
OLD | NEW |