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

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

Issue 23779003: first cut at HQ GPU scaling; refactored existing bicubic scaler (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final version for trybots Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBicubicImageFilter.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrBicubicTextureEffect_DEFINED
9 #define GrBicubicTextureEffect_DEFINED
10
11 #include "GrSingleTextureEffect.h"
12 #include "GrDrawEffect.h"
13 #include "gl/GrGLEffect.h"
14 #include "gl/GrGLEffectMatrix.h"
15 #include "GrTBackendEffectFactory.h"
16
17 class GrGLBicubicEffect;
18
19 class GrBicubicEffect : public GrSingleTextureEffect {
20 public:
21 virtual ~GrBicubicEffect();
22
23 static const char* Name() { return "Bicubic"; }
24 const float* coefficients() const { return fCoefficients; }
25
26 typedef GrGLBicubicEffect GLEffect;
27
28 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
29 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE;
30
31 static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16]) {
32 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, coefficients))) ;
33 return CreateEffectRef(effect);
34 }
35
36 static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16],
37 const SkMatrix& matrix,
38 const GrTextureParams& p,
39 CoordsType coordsType = kLocal_CoordsType) {
40 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, coefficients, m atrix, p, coordsType)));
41 return CreateEffectRef(effect);
42 }
43
44 static GrEffectRef* Create(GrTexture* tex) {
45 return Create(tex, gMitchellCoefficients);
46 }
47
48 static GrEffectRef* Create(GrTexture* tex,
49 const SkMatrix& matrix,
50 const GrTextureParams& p,
51 CoordsType coordsType = kLocal_CoordsType) {
52 return Create(tex, gMitchellCoefficients, matrix, p, coordsType);
53 }
54
55 private:
56 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16]);
57 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
58 const SkMatrix &matrix, const GrTextureParams &p, CoordsType coordsType);
59 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
60 float fCoefficients[16];
61
62 GR_DECLARE_EFFECT_TEST;
63
64 static const SkScalar gMitchellCoefficients[16];
65
66 typedef GrSingleTextureEffect INHERITED;
67 };
68
69 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBicubicImageFilter.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698