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

Side by Side Diff: src/gpu/effects/GrCustomXfermodePriv.h

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/GrCustomXfermode.cpp ('k') | src/gpu/effects/GrDitherEffect.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 GrCustomXfermodePriv_DEFINED 8 #ifndef GrCustomXfermodePriv_DEFINED
9 #define GrCustomXfermodePriv_DEFINED 9 #define GrCustomXfermodePriv_DEFINED
10 10
(...skipping 11 matching lines...) Expand all
22 class GrTexture; 22 class GrTexture;
23 23
24 /////////////////////////////////////////////////////////////////////////////// 24 ///////////////////////////////////////////////////////////////////////////////
25 // Fragment Processor 25 // Fragment Processor
26 /////////////////////////////////////////////////////////////////////////////// 26 ///////////////////////////////////////////////////////////////////////////////
27 27
28 class GrCustomXferFP : public GrFragmentProcessor { 28 class GrCustomXferFP : public GrFragmentProcessor {
29 public: 29 public:
30 GrCustomXferFP(GrProcessorDataManager*, SkXfermode::Mode mode, GrTexture* ba ckground); 30 GrCustomXferFP(GrProcessorDataManager*, SkXfermode::Mode mode, GrTexture* ba ckground);
31 31
32 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con st override;
33
34 GrGLFragmentProcessor* createGLInstance() const override; 32 GrGLFragmentProcessor* createGLInstance() const override;
35 33
36 const char* name() const override { return "Custom Xfermode"; } 34 const char* name() const override { return "Custom Xfermode"; }
37 35
38 SkXfermode::Mode mode() const { return fMode; } 36 SkXfermode::Mode mode() const { return fMode; }
39 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; } 37 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; }
40 38
41 private: 39 private:
40 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override;
41
42 bool onIsEqual(const GrFragmentProcessor& other) const override; 42 bool onIsEqual(const GrFragmentProcessor& other) const override;
43 43
44 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; 44 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
45 45
46 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 46 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
47 47
48 SkXfermode::Mode fMode; 48 SkXfermode::Mode fMode;
49 GrCoordTransform fBackgroundTransform; 49 GrCoordTransform fBackgroundTransform;
50 GrTextureAccess fBackgroundAccess; 50 GrTextureAccess fBackgroundAccess;
51 51
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 GR_DECLARE_XP_FACTORY_TEST; 87 GR_DECLARE_XP_FACTORY_TEST;
88 88
89 SkXfermode::Mode fMode; 89 SkXfermode::Mode fMode;
90 GrBlendEquation fHWBlendEquation; 90 GrBlendEquation fHWBlendEquation;
91 91
92 typedef GrXPFactory INHERITED; 92 typedef GrXPFactory INHERITED;
93 }; 93 };
94 #endif 94 #endif
95 95
OLDNEW
« no previous file with comments | « src/gpu/effects/GrCustomXfermode.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698