| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 */ | 298 */ |
| 299 SkBaseMutex* mutex() const { return fMutex; } | 299 SkBaseMutex* mutex() const { return fMutex; } |
| 300 | 300 |
| 301 // serialization | 301 // serialization |
| 302 SkPixelRef(SkFlattenableReadBuffer&, SkBaseMutex*); | 302 SkPixelRef(SkFlattenableReadBuffer&, SkBaseMutex*); |
| 303 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 303 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| 304 | 304 |
| 305 // only call from constructor. Flags this to always be locked, removing | 305 // only call from constructor. Flags this to always be locked, removing |
| 306 // the need to grab the mutex and call onLockPixels/onUnlockPixels. | 306 // the need to grab the mutex and call onLockPixels/onUnlockPixels. |
| 307 // Performance tweak to avoid those calls (esp. in multi-thread use case). | 307 // Performance tweak to avoid those calls (esp. in multi-thread use case). |
| 308 void setPreLocked(void* pixels, SkColorTable* ctable); | 308 void setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctable); |
| 309 | 309 |
| 310 private: | 310 private: |
| 311 SkBaseMutex* fMutex; // must remain in scope for the life of this object | 311 SkBaseMutex* fMutex; // must remain in scope for the life of this object |
| 312 | 312 |
| 313 const SkImageInfo fInfo; | 313 const SkImageInfo fInfo; |
| 314 | 314 |
| 315 void* fPixels; | 315 void* fPixels; |
| 316 SkColorTable* fColorTable; // we do not track ownership, subclass does | 316 SkColorTable* fColorTable; // we do not track ownership, subclass does |
| 317 int fLockCount; | 317 int fLockCount; |
| 318 | 318 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 335 | 335 |
| 336 // When copying a bitmap to another with the same shape and config, we can s
afely | 336 // When copying a bitmap to another with the same shape and config, we can s
afely |
| 337 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 337 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
| 338 friend class SkBitmap; // only for cloneGenID | 338 friend class SkBitmap; // only for cloneGenID |
| 339 void cloneGenID(const SkPixelRef&); | 339 void cloneGenID(const SkPixelRef&); |
| 340 | 340 |
| 341 typedef SkFlattenable INHERITED; | 341 typedef SkFlattenable INHERITED; |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 #endif | 344 #endif |
| OLD | NEW |