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

Unified Diff: src/effects/GrCircleBlurFragmentProcessor.h

Issue 2242973002: Improvements for circluar blurs in GPU backend. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix double to float conversion on windows Created 4 years, 4 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 | « no previous file | src/effects/GrCircleBlurFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/GrCircleBlurFragmentProcessor.h
diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h
index 89c067c43b10a4786c27bbc47cdb3412e670f814..7754a2eda482644139c058ce543b75374b3a5f3d 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.h
+++ b/src/effects/GrCircleBlurFragmentProcessor.h
@@ -28,29 +28,14 @@ public:
SkString dumpInfo() const override {
SkString str;
- str.appendf("Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], Sigma %.2f, solidR: %.2f, "
- "textureR: %.2f",
+ str.appendf("Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], solidR: %.2f, textureR: %.2f",
fCircle.fLeft, fCircle.fTop, fCircle.fRight, fCircle.fBottom,
- fSigma, fSolidRadius, fTextureRadius);
+ fSolidRadius, fTextureRadius);
return str;
}
static sk_sp<GrFragmentProcessor> Make(GrTextureProvider*textureProvider,
- const SkRect& circle, float sigma) {
- float solidRadius;
- float textureRadius;
-
- SkAutoTUnref<GrTexture> profile(CreateCircleBlurProfileTexture(textureProvider,
- circle,
- sigma,
- &solidRadius,
- &textureRadius));
- if (!profile) {
- return nullptr;
- }
- return sk_sp<GrFragmentProcessor>(
- new GrCircleBlurFragmentProcessor(circle, sigma, solidRadius, textureRadius, profile));
- }
+ const SkRect& circle, float sigma);
private:
// This nested GLSL processor implementation is defined in the cpp file.
@@ -61,8 +46,8 @@ private:
* The x texture coord should map from 0 to 1 across the radius range of solidRadius to
* solidRadius + textureRadius.
*/
- GrCircleBlurFragmentProcessor(const SkRect& circle, float sigma,
- float solidRadius, float textureRadius, GrTexture* blurProfile);
+ GrCircleBlurFragmentProcessor(const SkRect& circle, float textureRadius, float innerRadius,
+ GrTexture* blurProfile);
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
@@ -70,21 +55,14 @@ private:
bool onIsEqual(const GrFragmentProcessor& other) const override {
const GrCircleBlurFragmentProcessor& cbfp = other.cast<GrCircleBlurFragmentProcessor>();
- // fOffset is computed from the circle width and the sigma
- return this->fCircle == cbfp.fCircle && fSigma == cbfp.fSigma;
+ return fCircle == cbfp.fCircle && fSolidRadius == cbfp.fSolidRadius &&
+ fTextureRadius == cbfp.fTextureRadius;
}
void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
- static GrTexture* CreateCircleBlurProfileTexture(GrTextureProvider*,
- const SkRect& circle,
- float sigma,
- float* solidRadius,
- float* textureRadius);
-
SkRect fCircle;
- float fSigma;
- float fSolidRadius;
+ SkScalar fSolidRadius;
float fTextureRadius;
GrTextureAccess fBlurProfileAccess;
« no previous file with comments | « no previous file | src/effects/GrCircleBlurFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698