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

Unified Diff: src/effects/SkGpuBlurUtils.h

Issue 1962903003: Make SkGpuBlurUtils::GaussianBlur more drawContext centric (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix sk_sp bug Created 4 years, 7 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/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkGpuBlurUtils.h
diff --git a/src/effects/SkGpuBlurUtils.h b/src/effects/SkGpuBlurUtils.h
index 8bc4377f5980af690cf3efd364450c2f7cf63b37..0d37f158be9c0270dc44efe9a5e50b9e3bed2ecb 100644
--- a/src/effects/SkGpuBlurUtils.h
+++ b/src/effects/SkGpuBlurUtils.h
@@ -9,19 +9,18 @@
#define SkGpuBlurUtils_DEFINED
#if SK_SUPPORT_GPU
-#include "GrTextureProvider.h"
+#include "GrDrawContext.h"
-class GrTexture;
class GrContext;
-#endif
+class GrTexture;
struct SkRect;
namespace SkGpuBlurUtils {
-
-#if SK_SUPPORT_GPU
/**
- * Applies a 2D Gaussian blur to a given texture.
+ * Applies a 2D Gaussian blur to a given texture. The blurred result is returned
+ * as a drawContext in case the caller wishes to future draw into the result.
+ * Note: one of sigmaX and sigmaY should be non-zero!
* @param context The GPU context
* @param srcTexture The source texture to be blurred.
* @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc...)
@@ -30,18 +29,17 @@ namespace SkGpuBlurUtils {
* no pixels will be sampled outside of this rectangle.
* @param sigmaX The blur's standard deviation in X.
* @param sigmaY The blur's standard deviation in Y.
- * @return the blurred texture, which may be srcTexture reffed, or a
- * new texture. It is the caller's responsibility to unref this texture.
+ * @return The drawContext containing the blurred result.
*/
- GrTexture* GaussianBlur(GrContext* context,
- GrTexture* srcTexture,
- bool gammaCorrect,
- const SkRect& dstBounds,
- const SkRect* srcBounds,
- float sigmaX,
- float sigmaY);
-#endif
+ sk_sp<GrDrawContext> GaussianBlur(GrContext* context,
+ GrTexture* srcTexture,
+ bool gammaCorrect,
+ const SkRect& dstBounds,
+ const SkRect* srcBounds,
+ float sigmaX,
+ float sigmaY);
};
#endif
+#endif
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698