OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 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 SkDevice_DEFINED | 10 #ifndef SkDevice_DEFINED |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 * the default origin in its canvas' matrix/clip | 168 * the default origin in its canvas' matrix/clip |
169 */ | 169 */ |
170 const SkIPoint& getOrigin() const { return fOrigin; } | 170 const SkIPoint& getOrigin() const { return fOrigin; } |
171 | 171 |
172 /** | 172 /** |
173 * onAttachToCanvas is invoked whenever a device is installed in a canvas | 173 * onAttachToCanvas is invoked whenever a device is installed in a canvas |
174 * (i.e., setDevice, saveLayer (for the new device created by the save), | 174 * (i.e., setDevice, saveLayer (for the new device created by the save), |
175 * and SkCanvas' SkDevice & SkBitmap -taking ctors). It allows the | 175 * and SkCanvas' SkDevice & SkBitmap -taking ctors). It allows the |
176 * devices to prepare for drawing (e.g., locking their pixels, etc.) | 176 * devices to prepare for drawing (e.g., locking their pixels, etc.) |
177 */ | 177 */ |
178 virtual void onAttachToCanvas(SkCanvas* canvas) { | 178 virtual void onAttachToCanvas(SkCanvas*) { |
179 SkASSERT(!fAttachedToCanvas); | 179 SkASSERT(!fAttachedToCanvas); |
180 this->lockPixels(); | 180 this->lockPixels(); |
181 #ifdef SK_DEBUG | 181 #ifdef SK_DEBUG |
182 fAttachedToCanvas = true; | 182 fAttachedToCanvas = true; |
183 #endif | 183 #endif |
184 }; | 184 }; |
185 | 185 |
186 /** | 186 /** |
187 * onDetachFromCanvas notifies a device that it will no longer be drawn to. | 187 * onDetachFromCanvas notifies a device that it will no longer be drawn to. |
188 * It gives the device a chance to clean up (e.g., unlock its pixels). It | 188 * It gives the device a chance to clean up (e.g., unlock its pixels). It |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 SkDeviceProperties fLeakyProperties; | 458 SkDeviceProperties fLeakyProperties; |
459 | 459 |
460 #ifdef SK_DEBUG | 460 #ifdef SK_DEBUG |
461 bool fAttachedToCanvas; | 461 bool fAttachedToCanvas; |
462 #endif | 462 #endif |
463 | 463 |
464 typedef SkRefCnt INHERITED; | 464 typedef SkRefCnt INHERITED; |
465 }; | 465 }; |
466 | 466 |
467 #endif | 467 #endif |
OLD | NEW |