Update RenderEngine blur to snap an image of the full surface.
Snapping a subregion of a surface causes Skia's GPU surfaces to make
a copy of the pixels into a new buffer so that the dimensions of the
buffer match the requested size. By requesting a basic snapshot this
CL avoids any uncessary framebuffer copies.
Also refactor the code to start consolidating where blurs are used.
Test: tracing SysUI blurs
Bug: 176903027
Change-Id: I72a9e442e50bc6d945c601efca1fdd2ce7cdfcd1
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.h b/libs/renderengine/skia/SkiaGLRenderEngine.h
index 810fc2a..4f4a9d4 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.h
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.h
@@ -81,6 +81,7 @@
inline SkRect getSkRect(const Rect& layer);
inline SkRRect getRoundedRect(const LayerSettings* layer);
inline BlurRegion getBlurRegion(const LayerSettings* layer);
+ inline bool layerHasBlur(const LayerSettings* layer);
inline SkColor getSkColor(const vec4& color);
inline SkM44 getSkM44(const mat4& matrix);
inline SkPoint3 getSkPoint3(const vec3& vector);