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 21 matching lines...) Expand all Loading... |
32 * other means. | 32 * other means. |
33 */ | 33 */ |
34 class SK_API SkImage : public SkRefCnt { | 34 class SK_API SkImage : public SkRefCnt { |
35 public: | 35 public: |
36 SK_DECLARE_INST_COUNT(SkImage) | 36 SK_DECLARE_INST_COUNT(SkImage) |
37 | 37 |
38 typedef SkImageInfo Info; | 38 typedef SkImageInfo Info; |
39 | 39 |
40 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); | 40 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); |
41 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 41 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
42 static SkImage* NewEncodedData(SkData*); | |
43 | 42 |
44 /** | 43 /** |
45 * GrTexture is a more logical parameter for this factory, but its | 44 * GrTexture is a more logical parameter for this factory, but its |
46 * interactions with scratch cache still has issues, so for now we take | 45 * interactions with scratch cache still has issues, so for now we take |
47 * SkBitmap instead. This will be changed in the future. skbug.com/1449 | 46 * SkBitmap instead. This will be changed in the future. skbug.com/1449 |
48 */ | 47 */ |
49 static SkImage* NewTexture(const SkBitmap&); | 48 static SkImage* NewTexture(const SkBitmap&); |
50 | 49 |
51 virtual bool isOpaque() const { return false; } | 50 virtual bool isOpaque() const { return false; } |
52 | 51 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 * On failure, false will be returned, and bitmap will unmodified. | 140 * On failure, false will be returned, and bitmap will unmodified. |
142 */ | 141 */ |
143 // On ice for now: | 142 // On ice for now: |
144 // - should it respect the particular colortype/alphatype of the src | 143 // - should it respect the particular colortype/alphatype of the src |
145 // - should it have separate entrypoints for preallocated and not bitmaps? | 144 // - should it have separate entrypoints for preallocated and not bitmaps? |
146 // - isn't it enough to allow the caller to draw() the image into a canvas? | 145 // - isn't it enough to allow the caller to draw() the image into a canvas? |
147 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; | 146 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; |
148 }; | 147 }; |
149 | 148 |
150 #endif | 149 #endif |
OLD | NEW |