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

Side by Side Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.h » ('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 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 #include "GrTextureDomain.h" 8 #include "GrTextureDomain.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 const SkMatrix& matrix, 220 const SkMatrix& matrix,
221 const SkRect& domain, 221 const SkRect& domain,
222 GrTextureDomain::Mode mode, 222 GrTextureDomain::Mode mode,
223 GrTextureParams::FilterMode f ilterMode, 223 GrTextureParams::FilterMode f ilterMode,
224 GrCoordSet coordSet) { 224 GrCoordSet coordSet) {
225 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; 225 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1};
226 if (GrTextureDomain::kIgnore_Mode == mode || 226 if (GrTextureDomain::kIgnore_Mode == mode ||
227 (GrTextureDomain::kClamp_Mode == mode && domain.contains(kFullRect))) { 227 (GrTextureDomain::kClamp_Mode == mode && domain.contains(kFullRect))) {
228 return GrSimpleTextureEffect::Create(procDataManager, texture, matrix, f ilterMode); 228 return GrSimpleTextureEffect::Create(procDataManager, texture, matrix, f ilterMode);
229 } else { 229 } else {
230 230 return new GrTextureDomainEffect(procDataManager, texture, matrix, domai n, mode, filterMode,
231 return SkNEW_ARGS(GrTextureDomainEffect, (procDataManager, 231 coordSet);
232 texture,
233 matrix,
234 domain,
235 mode,
236 filterMode,
237 coordSet));
238 } 232 }
239 } 233 }
240 234
241 GrTextureDomainEffect::GrTextureDomainEffect(GrProcessorDataManager* procDataMan ager, 235 GrTextureDomainEffect::GrTextureDomainEffect(GrProcessorDataManager* procDataMan ager,
242 GrTexture* texture, 236 GrTexture* texture,
243 const SkMatrix& matrix, 237 const SkMatrix& matrix,
244 const SkRect& domain, 238 const SkRect& domain,
245 GrTextureDomain::Mode mode, 239 GrTextureDomain::Mode mode,
246 GrTextureParams::FilterMode filterM ode, 240 GrTextureParams::FilterMode filterM ode,
247 GrCoordSet coordSet) 241 GrCoordSet coordSet)
248 : GrSingleTextureEffect(procDataManager, texture, matrix, filterMode, coordS et) 242 : GrSingleTextureEffect(procDataManager, texture, matrix, filterMode, coordS et)
249 , fTextureDomain(domain, mode) { 243 , fTextureDomain(domain, mode) {
250 SkASSERT(mode != GrTextureDomain::kRepeat_Mode || 244 SkASSERT(mode != GrTextureDomain::kRepeat_Mode ||
251 filterMode == GrTextureParams::kNone_FilterMode); 245 filterMode == GrTextureParams::kNone_FilterMode);
252 this->initClassID<GrTextureDomainEffect>(); 246 this->initClassID<GrTextureDomainEffect>();
253 } 247 }
254 248
255 GrTextureDomainEffect::~GrTextureDomainEffect() { 249 GrTextureDomainEffect::~GrTextureDomainEffect() {
256 250
257 } 251 }
258 252
259 void GrTextureDomainEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, 253 void GrTextureDomainEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
260 GrProcessorKeyBuilder* b) const { 254 GrProcessorKeyBuilder* b) const {
261 GrGLTextureDomainEffect::GenKey(*this, caps, b); 255 GrGLTextureDomainEffect::GenKey(*this, caps, b);
262 } 256 }
263 257
264 GrGLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const { 258 GrGLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const {
265 return SkNEW_ARGS(GrGLTextureDomainEffect, (*this)); 259 return new GrGLTextureDomainEffect(*this);
266 } 260 }
267 261
268 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 262 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
269 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); 263 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>();
270 return this->fTextureDomain == s.fTextureDomain; 264 return this->fTextureDomain == s.fTextureDomain;
271 } 265 }
272 266
273 void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst { 267 void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst {
274 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper 268 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper
275 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { 269 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
(...skipping 24 matching lines...) Expand all
300 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; 294 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
301 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet; 295 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet;
302 return GrTextureDomainEffect::Create(d->fProcDataManager, 296 return GrTextureDomainEffect::Create(d->fProcDataManager,
303 d->fTextures[texIdx], 297 d->fTextures[texIdx],
304 matrix, 298 matrix,
305 domain, 299 domain,
306 mode, 300 mode,
307 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 301 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
308 coords); 302 coords);
309 } 303 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698