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

Side by Side Diff: src/gpu/effects/GrCustomXfermode.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/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.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 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 #include "effects/GrCustomXfermode.h" 8 #include "effects/GrCustomXfermode.h"
9 #include "effects/GrCustomXfermodePriv.h" 9 #include "effects/GrCustomXfermodePriv.h"
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 this->initClassID<GrCustomXferFP>(); 480 this->initClassID<GrCustomXferFP>();
481 481
482 SkASSERT(background); 482 SkASSERT(background);
483 fBackgroundTransform.reset(kLocal_GrCoordSet, background, 483 fBackgroundTransform.reset(kLocal_GrCoordSet, background,
484 GrTextureParams::kNone_FilterMode); 484 GrTextureParams::kNone_FilterMode);
485 this->addCoordTransform(&fBackgroundTransform); 485 this->addCoordTransform(&fBackgroundTransform);
486 fBackgroundAccess.reset(background); 486 fBackgroundAccess.reset(background);
487 this->addTextureAccess(&fBackgroundAccess); 487 this->addTextureAccess(&fBackgroundAccess);
488 } 488 }
489 489
490 void GrCustomXferFP::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui lder* b) const { 490 void GrCustomXferFP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB uilder* b) const {
491 GLCustomXferFP::GenKey(*this, caps, b); 491 GLCustomXferFP::GenKey(*this, caps, b);
492 } 492 }
493 493
494 GrGLFragmentProcessor* GrCustomXferFP::createGLInstance() const { 494 GrGLFragmentProcessor* GrCustomXferFP::createGLInstance() const {
495 return SkNEW_ARGS(GLCustomXferFP, (*this)); 495 return SkNEW_ARGS(GLCustomXferFP, (*this));
496 } 496 }
497 497
498 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const { 498 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const {
499 const GrCustomXferFP& s = other.cast<GrCustomXferFP>(); 499 const GrCustomXferFP& s = other.cast<GrCustomXferFP>();
500 return fMode == s.fMode; 500 return fMode == s.fMode;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 809 }
810 810
811 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); 811 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory);
812 GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) { 812 GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) {
813 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, 813 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1,
814 SkXfermode::kLastSeparableMode); 814 SkXfermode::kLastSeparableMode);
815 815
816 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); 816 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode)));
817 } 817 }
818 818
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698