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 | 8 |
9 #ifndef SkMallocPixelRef_DEFINED | 9 #ifndef SkMallocPixelRef_DEFINED |
10 #define SkMallocPixelRef_DEFINED | 10 #define SkMallocPixelRef_DEFINED |
11 | 11 |
12 #include "SkPixelRef.h" | 12 #include "SkPixelRef.h" |
13 | 13 |
14 /** We explicitly use the same allocator for our pixels that SkMask does, | 14 /** We explicitly use the same allocator for our pixels that SkMask does, |
15 so that we can freely assign memory allocated by one class to the other. | 15 so that we can freely assign memory allocated by one class to the other. |
16 */ | 16 */ |
17 class SK_API SkMallocPixelRef : public SkPixelRef { | 17 class SK_API SkMallocPixelRef : public SkPixelRef { |
18 public: | 18 public: |
| 19 SK_DECLARE_INST_COUNT(SkMallocPixelRef) |
19 /** | 20 /** |
20 * Return a new SkMallocPixelRef with the provided pixel storage, rowBytes, | 21 * Return a new SkMallocPixelRef with the provided pixel storage, rowBytes, |
21 * and optional colortable. The caller is responsible for managing the | 22 * and optional colortable. The caller is responsible for managing the |
22 * lifetime of the pixel storage buffer, as this pixelref will not try | 23 * lifetime of the pixel storage buffer, as this pixelref will not try |
23 * to delete it. | 24 * to delete it. |
24 * | 25 * |
25 * The pixelref will ref() the colortable (if not NULL). | 26 * The pixelref will ref() the colortable (if not NULL). |
26 * | 27 * |
27 * Returns NULL on failure. | 28 * Returns NULL on failure. |
28 */ | 29 */ |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void* fReleaseProcContext; | 101 void* fReleaseProcContext; |
101 | 102 |
102 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, | 103 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, |
103 ReleaseProc proc, void* context); | 104 ReleaseProc proc, void* context); |
104 | 105 |
105 typedef SkPixelRef INHERITED; | 106 typedef SkPixelRef INHERITED; |
106 }; | 107 }; |
107 | 108 |
108 | 109 |
109 #endif | 110 #endif |
OLD | NEW |