Clip blur to bounds of layer
The blur operation takes a snapshot of the whole surface and previously, it would blur all of it. This CL restricts the blur operation+drawing only to the layer bounds. So layers in split screen would only blur half the screen for example. In addition, this saves some GPU cycles. This CL computes the bounds of the layer that is requesting background blur and passes an SkRect to the BlurFilter. The snapshot is always taken in the original surface orientation (for phones this is portrait). We need the correct bounds to restrict the blur operation to and separately we need the correct bounds to draw the blurred surface on the screen canvas. These are different if the screen surface canvas is already transformed. To simplify this, we save the transformations done to the canvas in a matrix and apply them after the blurred surface is drawn. That makes the blurred surface and the screen surface in the same orientation and simplifies the computation of the rect bounds. Bug: 171681577 Test: put blurs in the dim layer && check that dialog in split screen blurs only its own surface + when changing orientation Change-Id: Iad114567752ecd18a08cf19f83b4f759b069aded
Loading
Please register or sign in to comment