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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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
« no previous file with comments | « src/gpu/effects/GrBezierEffect.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
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
(...skipping 23 matching lines...) Expand all
34 */ 34 */
35 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex, 35 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
36 const SkScalar coefficients[16], 36 const SkScalar coefficients[16],
37 const SkRect* domain = NULL) { 37 const SkRect* domain = NULL) {
38 if (NULL == domain) { 38 if (NULL == domain) {
39 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode, 39 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode,
40 SkShader::kClamp_Ti leMode }; 40 SkShader::kClamp_Ti leMode };
41 return Create(procDataManager, tex, coefficients, 41 return Create(procDataManager, tex, coefficients,
42 GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTile Modes); 42 GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTile Modes);
43 } else { 43 } else {
44 return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficien ts, 44 return new GrBicubicEffect(procDataManager, tex, coefficients,
45 GrCoordTransform::MakeDivByTextu reWHMatrix(tex), 45 GrCoordTransform::MakeDivByTextureWHMatri x(tex), *domain);
46 *domain));
47 } 46 }
48 } 47 }
49 48
50 /** 49 /**
51 * Create a Mitchell filter effect with specified texture matrix and x/y til e modes. 50 * Create a Mitchell filter effect with specified texture matrix and x/y til e modes.
52 */ 51 */
53 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex, 52 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
54 const SkMatrix& matrix, 53 const SkMatrix& matrix,
55 SkShader::TileMode tileModes[2]) { 54 SkShader::TileMode tileModes[2]) {
56 return Create(procDataManager, tex, gMitchellCoefficients, matrix, tileM odes); 55 return Create(procDataManager, tex, gMitchellCoefficients, matrix, tileM odes);
57 } 56 }
58 57
59 /** 58 /**
60 * Create a filter effect with custom bicubic coefficients, the texture matr ix, and the x/y 59 * Create a filter effect with custom bicubic coefficients, the texture matr ix, and the x/y
61 * tilemodes. 60 * tilemodes.
62 */ 61 */
63 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex, 62 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
64 const SkScalar coefficients[16], const Sk Matrix& matrix, 63 const SkScalar coefficients[16], const Sk Matrix& matrix,
65 const SkShader::TileMode tileModes[2]) { 64 const SkShader::TileMode tileModes[2]) {
66 return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficients, matrix, tileModes)); 65 return new GrBicubicEffect(procDataManager, tex, coefficients, matrix, t ileModes);
67 } 66 }
68 67
69 /** 68 /**
70 * Create a Mitchell filter effect with a texture matrix and a domain. 69 * Create a Mitchell filter effect with a texture matrix and a domain.
71 */ 70 */
72 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex, 71 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
73 const SkMatrix& matrix, const SkRect& dom ain) { 72 const SkMatrix& matrix, const SkRect& dom ain) {
74 return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, gMitchellCoeff icients, matrix, 73 return new GrBicubicEffect(procDataManager, tex, gMitchellCoefficients, matrix, domain);
75 domain));
76 } 74 }
77 75
78 /** 76 /**
79 * Determines whether the bicubic effect should be used based on the transfo rmation from the 77 * Determines whether the bicubic effect should be used based on the transfo rmation from the
80 * local coords to the device. Returns true if the bicubic effect should be used. filterMode 78 * local coords to the device. Returns true if the bicubic effect should be used. filterMode
81 * is set to appropriate filtering mode to use regardless of the return resu lt (e.g. when this 79 * is set to appropriate filtering mode to use regardless of the return resu lt (e.g. when this
82 * returns false it may indicate that the best fallback is to use kMipMap, k Bilerp, or 80 * returns false it may indicate that the best fallback is to use kMipMap, k Bilerp, or
83 * kNearest). 81 * kNearest).
84 */ 82 */
85 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, 83 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice,
(...skipping 17 matching lines...) Expand all
103 GrTextureDomain fDomain; 101 GrTextureDomain fDomain;
104 102
105 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 103 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
106 104
107 static const SkScalar gMitchellCoefficients[16]; 105 static const SkScalar gMitchellCoefficients[16];
108 106
109 typedef GrSingleTextureEffect INHERITED; 107 typedef GrSingleTextureEffect INHERITED;
110 }; 108 };
111 109
112 #endif 110 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698