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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
49 */ | 49 */ |
50 class SK_API SkPixelRef : public SkRefCnt { | 50 class SK_API SkPixelRef : public SkRefCnt { |
51 public: | 51 public: |
52 SK_DECLARE_INST_COUNT(SkPixelRef) | |
53 | |
54 explicit SkPixelRef(const SkImageInfo&); | 52 explicit SkPixelRef(const SkImageInfo&); |
55 SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex); | 53 SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex); |
56 virtual ~SkPixelRef(); | 54 virtual ~SkPixelRef(); |
57 | 55 |
58 const SkImageInfo& info() const { | 56 const SkImageInfo& info() const { |
59 return fInfo; | 57 return fInfo; |
60 } | 58 } |
61 | 59 |
62 /** Return the pixel memory returned from lockPixels, or null if the | 60 /** Return the pixel memory returned from lockPixels, or null if the |
63 lockCount is 0. | 61 lockCount is 0. |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 /** | 389 /** |
392 * Allocate a new pixelref matching the specified ImageInfo, allocating | 390 * Allocate a new pixelref matching the specified ImageInfo, allocating |
393 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 391 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
394 * the pixelref will ref() the colortable. | 392 * the pixelref will ref() the colortable. |
395 * On failure return NULL. | 393 * On failure return NULL. |
396 */ | 394 */ |
397 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 395 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
398 }; | 396 }; |
399 | 397 |
400 #endif | 398 #endif |
OLD | NEW |