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

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

Issue 2242373002: simplify GrTextureAdjuster given there is only one subclass (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 | « src/gpu/GrImageIDTextureAdjuster.cpp ('k') | 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 sk_sp<GrFragmentProcessor> createFragmentProcessor( 136 sk_sp<GrFragmentProcessor> createFragmentProcessor(
137 const SkMatrix& textureMatrix, 137 const SkMatrix& textureMatrix,
138 const SkRect& constraintRect, 138 const SkRect& constraintRect,
139 FilterConstraint, 139 FilterConstraint,
140 bool coordsLimitedToConstraintRect, 140 bool coordsLimitedToConstraintRect,
141 const GrTextureParams::FilterMode* filterOrNullF orBicubic, 141 const GrTextureParams::FilterMode* filterOrNullF orBicubic,
142 SkColorSpace* dstColorSpace, 142 SkColorSpace* dstColorSpace,
143 SkSourceGammaTreatment) override; 143 SkSourceGammaTreatment) override;
144 144
145 // We do not ref the texture nor the colorspace, so the caller must keep the m in scope while
146 // this Adjuster is alive.
147 GrTextureAdjuster(GrTexture*, const SkIRect& area, uint32_t uniqueID, SkColo rSpace*);
148
145 protected: 149 protected:
146 /** The whole texture is content. */ 150 SkColorSpace* getColorSpace() override;
147 explicit GrTextureAdjuster(GrTexture* original, bool isAlphaOnly) 151 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
148 : INHERITED(original->width(), original->height(), isAlphaOnly) 152 void didCacheCopy(const GrUniqueKey& copyKey) override;
149 , fOriginal(original) {}
150
151 GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea, bool isAl phaOnly);
152 153
153 GrTexture* originalTexture() const { return fOriginal; } 154 GrTexture* originalTexture() const { return fOriginal; }
154 155
155 /** Returns the content area or null for the whole original texture */ 156 /** Returns the content area or null for the whole original texture */
156 const SkIRect* contentAreaOrNull() { return fContentArea.getMaybeNull(); } 157 const SkIRect* contentAreaOrNull() { return fContentArea.getMaybeNull(); }
157 158
158 private: 159 private:
159 SkTLazy<SkIRect> fContentArea; 160 SkTLazy<SkIRect> fContentArea;
160 GrTexture* fOriginal; 161 GrTexture* fOriginal;
162 SkColorSpace* fColorSpace;
163 uint32_t fUniqueID;
161 164
162 GrTexture* refCopy(const CopyParams &copyParams); 165 GrTexture* refCopy(const CopyParams &copyParams);
163 166
164 typedef GrTextureProducer INHERITED; 167 typedef GrTextureProducer INHERITED;
165 }; 168 };
166 169
167 /** 170 /**
168 * Base class for sources that start out as something other than a texture (enco ded image, 171 * Base class for sources that start out as something other than a texture (enco ded image,
169 * picture, ...). 172 * picture, ...).
170 */ 173 */
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 213
211 GrContext* context() const { return fContext; } 214 GrContext* context() const { return fContext; }
212 215
213 private: 216 private:
214 GrContext* fContext; 217 GrContext* fContext;
215 218
216 typedef GrTextureProducer INHERITED; 219 typedef GrTextureProducer INHERITED;
217 }; 220 };
218 221
219 #endif 222 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.cpp ('k') | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698