Make blur surface with bounds of layer
This CL changes the blur logic to take a snapshot only of the layer, not
the whole screen.
This has 2 benefits:
1. The blur shader samples only within the bounds of the surface, so
this change fixes a black frame around the blurred layer
2. The blur surface is smaller when the layer is not fullscreen, so less
information gets copied around
Bug: 174464919
Test: check background blur doesn't have a black frame
Test: check blur regions are in place
Change-Id: Ic31742248cc8441225503af48f13e6ef95a59443
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.h b/libs/renderengine/skia/SkiaGLRenderEngine.h
index f5eed1e..ef06bfa 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.h
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.h
@@ -77,15 +77,15 @@
inline BlurRegion getBlurRegion(const LayerSettings* layer);
inline SkColor getSkColor(const vec4& color);
inline SkM44 getSkM44(const mat4& matrix);
- inline SkMatrix getDrawTransform(const LayerSettings* layer, const SkMatrix& screenTransform);
inline SkPoint3 getSkPoint3(const vec3& vector);
base::unique_fd flush();
bool waitFence(base::unique_fd fenceFd);
void drawShadow(SkCanvas* canvas, const SkRect& casterRect, float casterCornerRadius,
const ShadowSettings& shadowSettings);
- void drawBlurRegion(SkCanvas* canvas, const BlurRegion& blurRegion,
- const SkMatrix& drawTransform, sk_sp<SkSurface> blurrendSurface);
+ void drawBlurRegion(SkCanvas* canvas, const BlurRegion& blurRegion, const SkRect& layerRect,
+ sk_sp<SkSurface> blurredSurface);
+ SkMatrix getBlurShaderTransform(const SkCanvas* canvas, const SkRect& layerRect);
EGLDisplay mEGLDisplay;
EGLContext mEGLContext;