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

Unified Diff: src/gpu/effects/GrConvolutionEffect.h

Issue 20789003: Small optimization for convolution shader: only apply the bounds check in (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Make direction() context Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvolutionEffect.h
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index 265150a92c2504359744200dbb4190b002bf289a..56a54b4a6a8d7599e52ab8828c01f3d0a24d8b03 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -26,14 +26,14 @@ public:
Direction dir,
int halfWidth,
const float* kernel,
- bool useCropRect,
- float cropRect[4]) {
+ bool useBounds,
+ float bounds[2]) {
AutoEffectUnref effect(SkNEW_ARGS(GrConvolutionEffect, (tex,
dir,
halfWidth,
kernel,
- useCropRect,
- cropRect)));
+ useBounds,
+ bounds)));
return CreateEffectRef(effect);
}
@@ -42,14 +42,14 @@ public:
Direction dir,
int halfWidth,
float gaussianSigma,
- bool useCropRect,
- float cropRect[4]) {
+ bool useBounds,
+ float bounds[2]) {
AutoEffectUnref effect(SkNEW_ARGS(GrConvolutionEffect, (tex,
dir,
halfWidth,
gaussianSigma,
- useCropRect,
- cropRect)));
+ useBounds,
+ bounds)));
return CreateEffectRef(effect);
}
@@ -57,8 +57,8 @@ public:
const float* kernel() const { return fKernel; }
- const float* cropRect() const { return fCropRect; }
- bool useCropRect() const { return fUseCropRect; }
+ const float* bounds() const { return fBounds; }
+ bool useBounds() const { return fUseBounds; }
static const char* Name() { return "Convolution"; }
@@ -86,22 +86,22 @@ public:
protected:
float fKernel[kMaxKernelWidth];
- bool fUseCropRect;
- float fCropRect[4];
+ bool fUseBounds;
+ float fBounds[2];
private:
GrConvolutionEffect(GrTexture*, Direction,
int halfWidth,
const float* kernel,
- bool useCropRect,
- float cropRect[4]);
+ bool useBounds,
+ float bounds[2]);
/// Convolve with a Gaussian kernel
GrConvolutionEffect(GrTexture*, Direction,
int halfWidth,
float gaussianSigma,
- bool useCropRect,
- float cropRect[4]);
+ bool useBounds,
+ float bounds[2]);
virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698