From 00d82d3d5dd713b286fa7f58d38086089a981c28 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 25 Feb 2013 15:00:36 -0800 Subject: Disable clipping where unnecessary This change prevents the renderer from using a stencil buffer to render rotated CellLayouts. Change-Id: I0414f59ed45502323ab588820ceb4a5e3ec17140 --- src/com/cyanogenmod/trebuchet/CellLayout.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/cyanogenmod/trebuchet/CellLayout.java') diff --git a/src/com/cyanogenmod/trebuchet/CellLayout.java b/src/com/cyanogenmod/trebuchet/CellLayout.java index 76865af3f..21f6725ab 100644 --- a/src/com/cyanogenmod/trebuchet/CellLayout.java +++ b/src/com/cyanogenmod/trebuchet/CellLayout.java @@ -182,6 +182,11 @@ public class CellLayout extends ViewGroup { // A ViewGroup usually does not draw, but CellLayout needs to draw a rectangle to show // the user where a dragged item will land when dropped. setWillNotDraw(false); + // CellLayout guarantees its children are not laid out outside of its bounds, + // child clipping is thus unnecessary and disabling it offers better performance + // when we rotate the whole layout + setClipChildren(false); + setClipToPadding(false); mLauncher = (Launcher) context; TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0); -- cgit v1.2.3