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 "SkDynamicAnnotations.h" |
| 13 #include "SkMutex.h" |
13 #include "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
14 #include "SkString.h" | 15 #include "SkString.h" |
15 #include "SkImageInfo.h" | 16 #include "SkImageInfo.h" |
16 #include "SkSize.h" | 17 #include "SkSize.h" |
17 #include "SkTDArray.h" | 18 #include "SkTDArray.h" |
18 | 19 |
19 //#define xed | 20 //#define xed |
20 | 21 |
21 #ifdef SK_DEBUG | 22 #ifdef SK_DEBUG |
22 /** | 23 /** |
23 * Defining SK_IGNORE_PIXELREF_SETPRELOCKED will force all pixelref | 24 * Defining SK_IGNORE_PIXELREF_SETPRELOCKED will force all pixelref |
24 * subclasses to correctly handle lock/unlock pixels. For performance | 25 * subclasses to correctly handle lock/unlock pixels. For performance |
25 * reasons, simple malloc-based subclasses call setPreLocked() to skip | 26 * reasons, simple malloc-based subclasses call setPreLocked() to skip |
26 * the overhead of implementing these calls. | 27 * the overhead of implementing these calls. |
27 * | 28 * |
28 * This build-flag disables that optimization, to add in debugging our | 29 * This build-flag disables that optimization, to add in debugging our |
29 * call-sites, to ensure that they correctly balance their calls of | 30 * call-sites, to ensure that they correctly balance their calls of |
30 * lock and unlock. | 31 * lock and unlock. |
31 */ | 32 */ |
32 // #define SK_IGNORE_PIXELREF_SETPRELOCKED | 33 // #define SK_IGNORE_PIXELREF_SETPRELOCKED |
33 #endif | 34 #endif |
34 | 35 |
35 class SkColorTable; | 36 class SkColorTable; |
36 class SkData; | 37 class SkData; |
37 struct SkIRect; | 38 struct SkIRect; |
38 class SkMutex; | |
39 | 39 |
40 class GrTexture; | 40 class GrTexture; |
41 | 41 |
42 /** \class SkPixelRef | 42 /** \class SkPixelRef |
43 | 43 |
44 This class is the smart container for pixel memory, and is used with | 44 This class is the smart container for pixel memory, and is used with |
45 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can | 45 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can |
46 access the actual pixel memory by calling lockPixels/unlockPixels. | 46 access the actual pixel memory by calling lockPixels/unlockPixels. |
47 | 47 |
48 This class can be shared/accessed between multiple threads. | 48 This class can be shared/accessed between multiple threads. |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 /** | 386 /** |
387 * Allocate a new pixelref matching the specified ImageInfo, allocating | 387 * Allocate a new pixelref matching the specified ImageInfo, allocating |
388 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 388 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
389 * the pixelref will ref() the colortable. | 389 * the pixelref will ref() the colortable. |
390 * On failure return NULL. | 390 * On failure return NULL. |
391 */ | 391 */ |
392 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 392 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
393 }; | 393 }; |
394 | 394 |
395 #endif | 395 #endif |
OLD | NEW |