Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 2174843002: Connect dst color space in a few places (removing TODOs) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 * width, just the raw coords). 58 * width, just the raw coords).
59 * @param filterOrNullForBicubic If non-null indicates the filter mode. If null means 59 * @param filterOrNullForBicubic If non-null indicates the filter mode. If null means
60 * use bicubic filtering. 60 * use bicubic filtering.
61 **/ 61 **/
62 virtual sk_sp<GrFragmentProcessor> createFragmentProcessor( 62 virtual sk_sp<GrFragmentProcessor> createFragmentProcessor(
63 const SkMatrix& textureMatrix, 63 const SkMatrix& textureMatrix,
64 const SkRect& constraintRect, 64 const SkRect& constraintRect,
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 SkColorSpace* dstColorSpace,
68 SkSourceGammaTreatment) = 0; 69 SkSourceGammaTreatment) = 0;
69 70
70 virtual ~GrTextureProducer() {} 71 virtual ~GrTextureProducer() {}
71 72
72 int width() const { return fWidth; } 73 int width() const { return fWidth; }
73 int height() const { return fHeight; } 74 int height() const { return fHeight; }
74 bool isAlphaOnly() const { return fIsAlphaOnly; } 75 bool isAlphaOnly() const { return fIsAlphaOnly; }
75 virtual SkColorSpace* getColorSpace() = 0; 76 virtual SkColorSpace* getColorSpace() = 0;
76 77
77 protected: 78 protected:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 does not match subset's dimensions then the contents are scaled to fit t he copy.*/ 132 does not match subset's dimensions then the contents are scaled to fit t he copy.*/
132 GrTexture* refTextureSafeForParams(const GrTextureParams&, SkSourceGammaTrea tment, 133 GrTexture* refTextureSafeForParams(const GrTextureParams&, SkSourceGammaTrea tment,
133 SkIPoint* outOffset); 134 SkIPoint* outOffset);
134 135
135 sk_sp<GrFragmentProcessor> createFragmentProcessor( 136 sk_sp<GrFragmentProcessor> createFragmentProcessor(
136 const SkMatrix& textureMatrix, 137 const SkMatrix& textureMatrix,
137 const SkRect& constraintRect, 138 const SkRect& constraintRect,
138 FilterConstraint, 139 FilterConstraint,
139 bool coordsLimitedToConstraintRect, 140 bool coordsLimitedToConstraintRect,
140 const GrTextureParams::FilterMode* filterOrNullF orBicubic, 141 const GrTextureParams::FilterMode* filterOrNullF orBicubic,
142 SkColorSpace* dstColorSpace,
141 SkSourceGammaTreatment) override; 143 SkSourceGammaTreatment) override;
142 144
143 protected: 145 protected:
144 /** The whole texture is content. */ 146 /** The whole texture is content. */
145 explicit GrTextureAdjuster(GrTexture* original, bool isAlphaOnly) 147 explicit GrTextureAdjuster(GrTexture* original, bool isAlphaOnly)
146 : INHERITED(original->width(), original->height(), isAlphaOnly) 148 : INHERITED(original->width(), original->height(), isAlphaOnly)
147 , fOriginal(original) {} 149 , fOriginal(original) {}
148 150
149 GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea, bool isAl phaOnly); 151 GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea, bool isAl phaOnly);
150 152
(...skipping 21 matching lines...) Expand all
172 does not match width()/height() then the contents of the original must b e scaled to fit 174 does not match width()/height() then the contents of the original must b e scaled to fit
173 the texture. */ 175 the texture. */
174 GrTexture* refTextureForParams(const GrTextureParams&, SkSourceGammaTreatmen t); 176 GrTexture* refTextureForParams(const GrTextureParams&, SkSourceGammaTreatmen t);
175 177
176 sk_sp<GrFragmentProcessor> createFragmentProcessor( 178 sk_sp<GrFragmentProcessor> createFragmentProcessor(
177 const SkMatrix& textureMatrix, 179 const SkMatrix& textureMatrix,
178 const SkRect& constraintRect, 180 const SkRect& constraintRect,
179 FilterConstraint filterConstraint, 181 FilterConstraint filterConstraint,
180 bool coordsLimitedToConstraintRect, 182 bool coordsLimitedToConstraintRect,
181 const GrTextureParams::FilterMode* filterOrNullF orBicubic, 183 const GrTextureParams::FilterMode* filterOrNullF orBicubic,
184 SkColorSpace* dstColorSpace,
182 SkSourceGammaTreatment) override; 185 SkSourceGammaTreatment) override;
183 186
184 protected: 187 protected:
185 GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly) 188 GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly)
186 : INHERITED(width, height, isAlphaOnly) 189 : INHERITED(width, height, isAlphaOnly)
187 , fContext(context) {} 190 , fContext(context) {}
188 191
189 /** 192 /**
190 * Return the maker's "original" texture. It is the responsibility of the m aker to handle any 193 * Return the maker's "original" texture. It is the responsibility of the m aker to handle any
191 * caching of the original if desired. 194 * caching of the original if desired.
(...skipping 15 matching lines...) Expand all
207 210
208 GrContext* context() const { return fContext; } 211 GrContext* context() const { return fContext; }
209 212
210 private: 213 private:
211 GrContext* fContext; 214 GrContext* fContext;
212 215
213 typedef GrTextureProducer INHERITED; 216 typedef GrTextureProducer INHERITED;
214 }; 217 };
215 218
216 #endif 219 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698