OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 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 SkPixelRef_DEFINED | 10 #ifndef SkPixelRef_DEFINED |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 }; | 237 }; |
238 | 238 |
239 // Takes ownership of listener. | 239 // Takes ownership of listener. |
240 void addGenIDChangeListener(GenIDChangeListener* listener); | 240 void addGenIDChangeListener(GenIDChangeListener* listener); |
241 | 241 |
242 protected: | 242 protected: |
243 /** Called when the lockCount goes from 0 to 1. The caller will have already | 243 /** Called when the lockCount goes from 0 to 1. The caller will have already |
244 acquire a mutex for thread safety, so this method need not do that. | 244 acquire a mutex for thread safety, so this method need not do that. |
245 */ | 245 */ |
246 virtual void* onLockPixels(SkColorTable**) = 0; | 246 virtual void* onLockPixels(SkColorTable**) = 0; |
247 /** Called when the lock count goes from 1 to 0. The caller will have | 247 |
248 already acquire a mutex for thread safety, so this method need not do | 248 /** |
249 that. | 249 * Called when the lock count goes from 1 to 0. The caller will have |
250 */ | 250 * already acquire a mutex for thread safety, so this method need not do |
| 251 * that. |
| 252 * |
| 253 * If the previous call to onLockPixels failed (i.e. returned NULL), then |
| 254 * the onUnlockPixels will NOT be called. |
| 255 */ |
251 virtual void onUnlockPixels() = 0; | 256 virtual void onUnlockPixels() = 0; |
252 | 257 |
253 /** Default impl returns true */ | 258 /** Default impl returns true */ |
254 virtual bool onLockPixelsAreWritable() const; | 259 virtual bool onLockPixelsAreWritable() const; |
255 | 260 |
256 // returns false; | 261 // returns false; |
257 virtual bool onImplementsDecodeInto(); | 262 virtual bool onImplementsDecodeInto(); |
258 // returns false; | 263 // returns false; |
259 virtual bool onDecodeInto(int pow2, SkBitmap* bitmap); | 264 virtual bool onDecodeInto(int pow2, SkBitmap* bitmap); |
260 | 265 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 325 |
321 // When copying a bitmap to another with the same shape and config, we can s
afely | 326 // When copying a bitmap to another with the same shape and config, we can s
afely |
322 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 327 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
323 friend class SkBitmap; // only for cloneGenID | 328 friend class SkBitmap; // only for cloneGenID |
324 void cloneGenID(const SkPixelRef&); | 329 void cloneGenID(const SkPixelRef&); |
325 | 330 |
326 typedef SkFlattenable INHERITED; | 331 typedef SkFlattenable INHERITED; |
327 }; | 332 }; |
328 | 333 |
329 #endif | 334 #endif |
OLD | NEW |