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

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

Issue 1266633003: Added registerChild; transforms, textures, glKey automatically handled. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: refactored to onGetGLProcessorKey; removed emitSamplers specialized template; fixed nits Created 5 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/effects/GrTextureDomain.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.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 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 , fTextureDomain(domain, mode) { 248 , fTextureDomain(domain, mode) {
249 SkASSERT(mode != GrTextureDomain::kRepeat_Mode || 249 SkASSERT(mode != GrTextureDomain::kRepeat_Mode ||
250 filterMode == GrTextureParams::kNone_FilterMode); 250 filterMode == GrTextureParams::kNone_FilterMode);
251 this->initClassID<GrTextureDomainEffect>(); 251 this->initClassID<GrTextureDomainEffect>();
252 } 252 }
253 253
254 GrTextureDomainEffect::~GrTextureDomainEffect() { 254 GrTextureDomainEffect::~GrTextureDomainEffect() {
255 255
256 } 256 }
257 257
258 void GrTextureDomainEffect::getGLProcessorKey(const GrGLSLCaps& caps, 258 void GrTextureDomainEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
259 GrProcessorKeyBuilder* b) const { 259 GrProcessorKeyBuilder* b) const {
260 GrGLTextureDomainEffect::GenKey(*this, caps, b); 260 GrGLTextureDomainEffect::GenKey(*this, caps, b);
261 } 261 }
262 262
263 GrGLFragmentProcessor* GrTextureDomainEffect::createGLInstance() const { 263 GrGLFragmentProcessor* GrTextureDomainEffect::createGLInstance() const {
264 return SkNEW_ARGS(GrGLTextureDomainEffect, (*this)); 264 return SkNEW_ARGS(GrGLTextureDomainEffect, (*this));
265 } 265 }
266 266
267 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 267 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
268 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); 268 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>();
(...skipping 30 matching lines...) Expand all
299 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; 299 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
300 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet; 300 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet;
301 return GrTextureDomainEffect::Create(d->fProcDataManager, 301 return GrTextureDomainEffect::Create(d->fProcDataManager,
302 d->fTextures[texIdx], 302 d->fTextures[texIdx],
303 matrix, 303 matrix,
304 domain, 304 domain,
305 mode, 305 mode,
306 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 306 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
307 coords); 307 coords);
308 } 308 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698