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

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

Issue 778453002: Remove backend factories (Closed) Base URL: https://skia.googlesource.com/skia.git@unichoice
Patch Set: cleanup Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 GrBicubicTextureEffect_DEFINED 8 #ifndef GrBicubicTextureEffect_DEFINED
9 #define GrBicubicTextureEffect_DEFINED 9 #define GrBicubicTextureEffect_DEFINED
10 10
11 #include "GrSingleTextureEffect.h" 11 #include "GrSingleTextureEffect.h"
12 #include "GrTextureDomain.h" 12 #include "GrTextureDomain.h"
13 #include "gl/GrGLProcessor.h" 13 #include "gl/GrGLProcessor.h"
14 #include "GrTBackendProcessorFactory.h"
15 14
16 class GrGLBicubicEffect; 15 class GrGLBicubicEffect;
17 class GrInvariantOutput; 16 class GrInvariantOutput;
18 17
19 class GrBicubicEffect : public GrSingleTextureEffect { 18 class GrBicubicEffect : public GrSingleTextureEffect {
20 public: 19 public:
21 enum { 20 enum {
22 kFilterTexelPad = 2, // Given a src rect in texels to be filtered, this number of 21 kFilterTexelPad = 2, // Given a src rect in texels to be filtered, this number of
23 // surrounding texels are needed by the kernel in x and y. 22 // surrounding texels are needed by the kernel in x and y.
24 }; 23 };
25 virtual ~GrBicubicEffect(); 24 virtual ~GrBicubicEffect();
26 25
27 static const char* Name() { return "Bicubic"; }
28 const float* coefficients() const { return fCoefficients; } 26 const float* coefficients() const { return fCoefficients; }
29 27
30 typedef GrGLBicubicEffect GLProcessor; 28 virtual const char* name() const SK_OVERRIDE { return "Bicubic"; }
31 29
32 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE; 30 virtual void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) cons t SK_OVERRIDE;
31
32 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
33
34 virtual uint32_t classID() const {
35 static uint32_t id = GenClassID();
36 return id;
37 }
33 38
34 const GrTextureDomain& domain() const { return fDomain; } 39 const GrTextureDomain& domain() const { return fDomain; }
35 40
36 /** 41 /**
37 * Create a simple filter effect with custom bicubic coefficients and option al domain. 42 * Create a simple filter effect with custom bicubic coefficients and option al domain.
38 */ 43 */
39 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien ts[16], 44 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien ts[16],
40 const SkRect* domain = NULL) { 45 const SkRect* domain = NULL) {
41 if (NULL == domain) { 46 if (NULL == domain) {
42 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode, 47 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 GrTextureDomain fDomain; 104 GrTextureDomain fDomain;
100 105
101 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 106 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
102 107
103 static const SkScalar gMitchellCoefficients[16]; 108 static const SkScalar gMitchellCoefficients[16];
104 109
105 typedef GrSingleTextureEffect INHERITED; 110 typedef GrSingleTextureEffect INHERITED;
106 }; 111 };
107 112
108 #endif 113 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698