GPU-based Gaussian blur.
This is a first stab at implementing a GPU-based
Gaussian blur in Ganesh. The convolution shader is implemented as a new
filtering mode. There are several known issues:
- no support for blur types other than "normal"
- FBO truncation problem at high zoom values
- uses bilinear for upsampling instead of Mitchell
Review URL: http://codereview.appspot.com/4645082/
git-svn-id: http://skia.googlecode.com/svn/trunk@1830 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLProgram.h b/gpu/src/GrGLProgram.h
index edd4737..60a7177 100644
--- a/gpu/src/GrGLProgram.h
+++ b/gpu/src/GrGLProgram.h
@@ -114,6 +114,7 @@
enum FetchMode {
kSingle_FetchMode,
k2x2_FetchMode,
+ kConvolution_FetchMode,
kFetchModeCnt,
};
@@ -132,6 +133,7 @@
uint8_t fModulation; // casts to enum Modulation
uint8_t fFetchMode; // casts to enum FetchMode
uint8_t fCoordMapping; // casts to enum CoordMapping
+ uint8_t fKernelWidth;
inline bool isEnabled() const {
return fOptFlags & kIsEnabled_OptFlagBit;
@@ -197,12 +199,16 @@
GrGLint fSamplerUni;
GrGLint fRadial2Uni;
GrGLint fTexDomUni;
+ GrGLint fKernelUni;
+ GrGLint fImageIncrementUni;
void reset() {
fTextureMatrixUni = kUnusedUniform;
fNormalizedTexelSizeUni = kUnusedUniform;
fSamplerUni = kUnusedUniform;
fRadial2Uni = kUnusedUniform;
fTexDomUni = kUnusedUniform;
+ fKernelUni = kUnusedUniform;
+ fImageIncrementUni = kUnusedUniform;
}
};