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 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
| 12 #include "SkDynamicAnnotations.h" |
12 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
13 #include "SkString.h" | 14 #include "SkString.h" |
14 #include "SkFlattenable.h" | 15 #include "SkFlattenable.h" |
15 #include "SkImageInfo.h" | 16 #include "SkImageInfo.h" |
16 #include "SkTDArray.h" | 17 #include "SkTDArray.h" |
17 | 18 |
18 //#define xed | 19 //#define xed |
19 | 20 |
20 #ifdef SK_DEBUG | 21 #ifdef SK_DEBUG |
21 /** | 22 /** |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 private: | 343 private: |
343 SkBaseMutex* fMutex; // must remain in scope for the life of this object | 344 SkBaseMutex* fMutex; // must remain in scope for the life of this object |
344 | 345 |
345 // mostly const. fInfo.fAlpahType can be changed at runtime. | 346 // mostly const. fInfo.fAlpahType can be changed at runtime. |
346 const SkImageInfo fInfo; | 347 const SkImageInfo fInfo; |
347 | 348 |
348 // LockRec is only valid if we're in a locked state (isLocked()) | 349 // LockRec is only valid if we're in a locked state (isLocked()) |
349 LockRec fRec; | 350 LockRec fRec; |
350 int fLockCount; | 351 int fLockCount; |
351 | 352 |
352 mutable uint32_t fGenerationID; | 353 mutable SkTRacy<uint32_t> fGenerationID; |
353 mutable bool fUniqueGenerationID; | 354 mutable SkTRacy<bool> fUniqueGenerationID; |
354 | 355 |
355 SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are owne
d | 356 SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are owne
d |
356 | 357 |
357 SkString fURI; | 358 SkString fURI; |
358 | 359 |
359 // can go from false to true, but never from true to false | 360 // can go from false to true, but never from true to false |
360 bool fIsImmutable; | 361 bool fIsImmutable; |
361 // only ever set in constructor, const after that | 362 // only ever set in constructor, const after that |
362 bool fPreLocked; | 363 bool fPreLocked; |
363 | 364 |
(...skipping 19 matching lines...) Expand all Loading... |
383 /** | 384 /** |
384 * Allocate a new pixelref matching the specified ImageInfo, allocating | 385 * Allocate a new pixelref matching the specified ImageInfo, allocating |
385 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 386 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
386 * the pixelref will ref() the colortable. | 387 * the pixelref will ref() the colortable. |
387 * On failure return NULL. | 388 * On failure return NULL. |
388 */ | 389 */ |
389 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 390 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
390 }; | 391 }; |
391 | 392 |
392 #endif | 393 #endif |
OLD | NEW |