OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrTextureMaker_DEFINED | 8 #ifndef GrTextureMaker_DEFINED |
9 #define GrTextureMaker_DEFINED | 9 #define GrTextureMaker_DEFINED |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 FilterConstraint filterConstraint, | 65 FilterConstraint filterConstraint, |
66 bool coordsLimitedToConstraintRect, | 66 bool coordsLimitedToConstraintRect, |
67 const GrTextureParams::FilterMode* filterOrN
ullForBicubic, | 67 const GrTextureParams::FilterMode* filterOrN
ullForBicubic, |
68 SkSourceGammaTreatment) = 0; | 68 SkSourceGammaTreatment) = 0; |
69 | 69 |
70 virtual ~GrTextureProducer() {} | 70 virtual ~GrTextureProducer() {} |
71 | 71 |
72 int width() const { return fWidth; } | 72 int width() const { return fWidth; } |
73 int height() const { return fHeight; } | 73 int height() const { return fHeight; } |
74 bool isAlphaOnly() const { return fIsAlphaOnly; } | 74 bool isAlphaOnly() const { return fIsAlphaOnly; } |
| 75 virtual SkColorSpace* getColorSpace() = 0; |
75 | 76 |
76 protected: | 77 protected: |
77 GrTextureProducer(int width, int height, bool isAlphaOnly) | 78 GrTextureProducer(int width, int height, bool isAlphaOnly) |
78 : fWidth(width) | 79 : fWidth(width) |
79 , fHeight(height) | 80 , fHeight(height) |
80 , fIsAlphaOnly(isAlphaOnly) {} | 81 , fIsAlphaOnly(isAlphaOnly) {} |
81 | 82 |
82 /** Helper for creating a key for a copy from an original key. */ | 83 /** Helper for creating a key for a copy from an original key. */ |
83 static void MakeCopyKeyFromOrigKey(const GrUniqueKey& origKey, | 84 static void MakeCopyKeyFromOrigKey(const GrUniqueKey& origKey, |
84 const CopyParams& copyParams, | 85 const CopyParams& copyParams, |
(...skipping 16 matching lines...) Expand all Loading... |
101 */ | 102 */ |
102 virtual void makeCopyKey(const CopyParams&, GrUniqueKey* copyKey) = 0; | 103 virtual void makeCopyKey(const CopyParams&, GrUniqueKey* copyKey) = 0; |
103 | 104 |
104 /** | 105 /** |
105 * If a stretched version of the texture is generated, it may be cached (ass
uming that | 106 * If a stretched version of the texture is generated, it may be cached (ass
uming that |
106 * makeCopyKey() returns true). In that case, the maker is notified in case
it | 107 * makeCopyKey() returns true). In that case, the maker is notified in case
it |
107 * wants to note that for when the maker is destroyed. | 108 * wants to note that for when the maker is destroyed. |
108 */ | 109 */ |
109 virtual void didCacheCopy(const GrUniqueKey& copyKey) = 0; | 110 virtual void didCacheCopy(const GrUniqueKey& copyKey) = 0; |
110 | 111 |
111 virtual SkColorSpace* getColorSpace() = 0; | |
112 | |
113 private: | 112 private: |
114 const int fWidth; | 113 const int fWidth; |
115 const int fHeight; | 114 const int fHeight; |
116 const bool fIsAlphaOnly; | 115 const bool fIsAlphaOnly; |
117 | 116 |
118 typedef SkNoncopyable INHERITED; | 117 typedef SkNoncopyable INHERITED; |
119 }; | 118 }; |
120 | 119 |
121 /** | 120 /** |
122 * Base class for sources that start out as textures. Optionally allows for a co
ntent area subrect. | 121 * Base class for sources that start out as textures. Optionally allows for a co
ntent area subrect. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 207 |
209 GrContext* context() const { return fContext; } | 208 GrContext* context() const { return fContext; } |
210 | 209 |
211 private: | 210 private: |
212 GrContext* fContext; | 211 GrContext* fContext; |
213 | 212 |
214 typedef GrTextureProducer INHERITED; | 213 typedef GrTextureProducer INHERITED; |
215 }; | 214 }; |
216 | 215 |
217 #endif | 216 #endif |
OLD | NEW |