OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 #ifndef SkPixelRef_DEFINED | 8 #ifndef SkPixelRef_DEFINED |
9 #define SkPixelRef_DEFINED | 9 #define SkPixelRef_DEFINED |
10 | 10 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 */ | 335 */ |
336 virtual size_t getAllocatedSizeInBytes() const; | 336 virtual size_t getAllocatedSizeInBytes() const; |
337 | 337 |
338 virtual bool onRequestLock(const LockRequest&, LockResult*); | 338 virtual bool onRequestLock(const LockRequest&, LockResult*); |
339 | 339 |
340 virtual bool onIsLazyGenerated() const { return false; } | 340 virtual bool onIsLazyGenerated() const { return false; } |
341 | 341 |
342 /** Return the mutex associated with this pixelref. This value is assigned | 342 /** Return the mutex associated with this pixelref. This value is assigned |
343 in the constructor, and cannot change during the lifetime of the object. | 343 in the constructor, and cannot change during the lifetime of the object. |
344 */ | 344 */ |
345 SkMutex* mutex() const { return &fMutex; } | 345 SkBaseMutex* mutex() const { return &fMutex; } |
346 | 346 |
347 // only call from constructor. Flags this to always be locked, removing | 347 // only call from constructor. Flags this to always be locked, removing |
348 // the need to grab the mutex and call onLockPixels/onUnlockPixels. | 348 // the need to grab the mutex and call onLockPixels/onUnlockPixels. |
349 // Performance tweak to avoid those calls (esp. in multi-thread use case). | 349 // Performance tweak to avoid those calls (esp. in multi-thread use case). |
350 void setPreLocked(void*, size_t rowBytes, SkColorTable*); | 350 void setPreLocked(void*, size_t rowBytes, SkColorTable*); |
351 | 351 |
352 private: | 352 private: |
353 mutable SkMutex fMutex; | 353 mutable SkMutex fMutex; |
354 | 354 |
355 // mostly const. fInfo.fAlpahType can be changed at runtime. | 355 // mostly const. fInfo.fAlpahType can be changed at runtime. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 /** | 414 /** |
415 * Allocate a new pixelref matching the specified ImageInfo, allocating | 415 * Allocate a new pixelref matching the specified ImageInfo, allocating |
416 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 416 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
417 * the pixelref will ref() the colortable. | 417 * the pixelref will ref() the colortable. |
418 * On failure return NULL. | 418 * On failure return NULL. |
419 */ | 419 */ |
420 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 420 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
421 }; | 421 }; |
422 | 422 |
423 #endif | 423 #endif |
OLD | NEW |