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) | |
20 /** | 19 /** |
21 * Return a new SkMallocPixelRef with the provided pixel storage, rowBytes, | 20 * Return a new SkMallocPixelRef with the provided pixel storage, rowBytes, |
22 * and optional colortable. The caller is responsible for managing the | 21 * and optional colortable. The caller is responsible for managing the |
23 * lifetime of the pixel storage buffer, as this pixelref will not try | 22 * lifetime of the pixel storage buffer, as this pixelref will not try |
24 * to delete it. | 23 * to delete it. |
25 * | 24 * |
26 * The pixelref will ref() the colortable (if not NULL). | 25 * The pixelref will ref() the colortable (if not NULL). |
27 * | 26 * |
28 * Returns NULL on failure. | 27 * Returns NULL on failure. |
29 */ | 28 */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void* fReleaseProcContext; | 104 void* fReleaseProcContext; |
106 | 105 |
107 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, | 106 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, |
108 ReleaseProc proc, void* context); | 107 ReleaseProc proc, void* context); |
109 | 108 |
110 typedef SkPixelRef INHERITED; | 109 typedef SkPixelRef INHERITED; |
111 }; | 110 }; |
112 | 111 |
113 | 112 |
114 #endif | 113 #endif |
OLD | NEW |