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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 struct Info { | 58 struct Info { |
59 int fWidth; | 59 int fWidth; |
60 int fHeight; | 60 int fHeight; |
61 ColorType fColorType; | 61 ColorType fColorType; |
62 AlphaType fAlphaType; | 62 AlphaType fAlphaType; |
63 }; | 63 }; |
64 | 64 |
65 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); | 65 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); |
66 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 66 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
67 static SkImage* NewEncodedData(SkData*); | 67 static SkImage* NewEncodedData(SkData*); |
68 static SkImage* NewTexture(GrTexture*); | 68 |
| 69 /** |
| 70 * GrTexture is a more logical parameter for this factory, but its |
| 71 * interactions with scratch cache still has issues, so for now we take |
| 72 * SkBitmap instead. This will be changed in the future. skbug.com/1449 |
| 73 */ |
| 74 static SkImage* NewTexture(const SkBitmap&); |
69 | 75 |
70 int width() const { return fWidth; } | 76 int width() const { return fWidth; } |
71 int height() const { return fHeight; } | 77 int height() const { return fHeight; } |
72 uint32_t uniqueID() const { return fUniqueID; } | 78 uint32_t uniqueID() const { return fUniqueID; } |
73 | 79 |
74 /** | 80 /** |
75 * Return the GrTexture that stores the image pixels. Calling getTexture | 81 * Return the GrTexture that stores the image pixels. Calling getTexture |
76 * does not affect the reference count of the GrTexture object. | 82 * does not affect the reference count of the GrTexture object. |
77 * Will return NULL if the image does not use a texture. | 83 * Will return NULL if the image does not use a texture. |
78 */ | 84 */ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const int fWidth; | 122 const int fWidth; |
117 const int fHeight; | 123 const int fHeight; |
118 const uint32_t fUniqueID; | 124 const uint32_t fUniqueID; |
119 | 125 |
120 static uint32_t NextUniqueID(); | 126 static uint32_t NextUniqueID(); |
121 | 127 |
122 typedef SkRefCnt INHERITED; | 128 typedef SkRefCnt INHERITED; |
123 }; | 129 }; |
124 | 130 |
125 #endif | 131 #endif |
OLD | NEW |