OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 * The content of SkImage is always immutable, though the actual storage may | 34 * The content of SkImage is always immutable, though the actual storage may |
35 * change, if for example that image can be re-created via encoded data or | 35 * change, if for example that image can be re-created via encoded data or |
36 * other means. | 36 * other means. |
37 * | 37 * |
38 * SkImage always has a non-zero dimensions. If there is a request to create a
new image, either | 38 * SkImage always has a non-zero dimensions. If there is a request to create a
new image, either |
39 * directly or via SkSurface, and either of the requested dimensions are zero,
then NULL will be | 39 * directly or via SkSurface, and either of the requested dimensions are zero,
then NULL will be |
40 * returned. | 40 * returned. |
41 */ | 41 */ |
42 class SK_API SkImage : public SkRefCnt { | 42 class SK_API SkImage : public SkRefCnt { |
43 public: | 43 public: |
44 SK_DECLARE_INST_COUNT(SkImage) | |
45 | |
46 typedef SkImageInfo Info; | 44 typedef SkImageInfo Info; |
47 typedef void* ReleaseContext; | 45 typedef void* ReleaseContext; |
48 | 46 |
49 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); | 47 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); |
50 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 48 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
51 | 49 |
52 typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext); | 50 typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext); |
53 | 51 |
54 /** | 52 /** |
55 * Return a new Image referencing the specified pixels. These must remain v
alid and unchanged | 53 * Return a new Image referencing the specified pixels. These must remain v
alid and unchanged |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 bool peekPixels(SkPixmap* pixmap) const; | 163 bool peekPixels(SkPixmap* pixmap) const; |
166 | 164 |
167 // DEPRECATED | 165 // DEPRECATED |
168 GrTexture* getTexture() const; | 166 GrTexture* getTexture() const; |
169 | 167 |
170 /** | 168 /** |
171 * Returns true if the image is texture backed. | 169 * Returns true if the image is texture backed. |
172 */ | 170 */ |
173 bool isTextureBacked() const; | 171 bool isTextureBacked() const; |
174 | 172 |
175 /** | 173 /** |
176 * Retrieves the backend API handle of the texture. If flushPendingGrContex
tReads then the | 174 * Retrieves the backend API handle of the texture. If flushPendingGrContex
tReads then the |
177 * GrContext will issue to the backend API any deferred read operations on
the texture before | 175 * GrContext will issue to the backend API any deferred read operations on
the texture before |
178 * returning. | 176 * returning. |
179 */ | 177 */ |
180 GrBackendObject getTextureHandle(bool flushPendingGrContextReads) const; | 178 GrBackendObject getTextureHandle(bool flushPendingGrContextReads) const; |
181 | 179 |
182 /** | 180 /** |
183 * Copy the pixels from the image into the specified buffer (pixels + rowBy
tes), | 181 * Copy the pixels from the image into the specified buffer (pixels + rowBy
tes), |
184 * converting them into the requested format (dstInfo). The image pixels ar
e read | 182 * converting them into the requested format (dstInfo). The image pixels ar
e read |
185 * starting at the specified (srcX,srcY) location. | 183 * starting at the specified (srcX,srcY) location. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 const int fWidth; | 270 const int fWidth; |
273 const int fHeight; | 271 const int fHeight; |
274 const uint32_t fUniqueID; | 272 const uint32_t fUniqueID; |
275 | 273 |
276 static uint32_t NextUniqueID(); | 274 static uint32_t NextUniqueID(); |
277 | 275 |
278 typedef SkRefCnt INHERITED; | 276 typedef SkRefCnt INHERITED; |
279 }; | 277 }; |
280 | 278 |
281 #endif | 279 #endif |
OLD | NEW |