summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/graphics
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-08-31 16:02:40 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-09-02 11:23:49 -0700
commitf28e6afafdc8b5afbdf99910668a38f9252bfb47 (patch)
tree1c0b61713bb0a4e87391b9ac690d7e0577717c20 /src/com/android/launcher3/graphics
parent35908f9e67b9cdae917385ef9e67e168cb0c93b3 (diff)
downloadandroid_packages_apps_Trebuchet-f28e6afafdc8b5afbdf99910668a38f9252bfb47.tar.gz
android_packages_apps_Trebuchet-f28e6afafdc8b5afbdf99910668a38f9252bfb47.tar.bz2
android_packages_apps_Trebuchet-f28e6afafdc8b5afbdf99910668a38f9252bfb47.zip
Some optimizations in blur outline generator
1) Using ALPHA_8 as the start and end bitmap. This removes one extra bitmap generation step 2) Using ByteBuffer on ALPHA_8 bitmap for clipAlpha. This allows us to use byteArray instead of intArray for representing pixels Change-Id: I1b654c439fd491b6b91180ddc562bb97fad857aa
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r--src/com/android/launcher3/graphics/DragPreviewProvider.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/com/android/launcher3/graphics/DragPreviewProvider.java b/src/com/android/launcher3/graphics/DragPreviewProvider.java
index e078d9b15..bc91c15be 100644
--- a/src/com/android/launcher3/graphics/DragPreviewProvider.java
+++ b/src/com/android/launcher3/graphics/DragPreviewProvider.java
@@ -27,7 +27,6 @@ import android.widget.TextView;
import com.android.launcher3.HolographicOutlineHelper;
import com.android.launcher3.Launcher;
import com.android.launcher3.PreloadIconDrawable;
-import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.folder.FolderIcon;
@@ -134,14 +133,12 @@ public class DragPreviewProvider {
* Responsibility for the bitmap is transferred to the caller.
*/
public Bitmap createDragOutline(Canvas canvas) {
- final int outlineColor = mView.getResources().getColor(R.color.outline_color);
final Bitmap b = Bitmap.createBitmap(mView.getWidth() + DRAG_BITMAP_PADDING,
- mView.getHeight() + DRAG_BITMAP_PADDING, Bitmap.Config.ARGB_8888);
-
+ mView.getHeight() + DRAG_BITMAP_PADDING, Bitmap.Config.ALPHA_8);
canvas.setBitmap(b);
drawDragView(canvas);
HolographicOutlineHelper.obtain(mView.getContext())
- .applyExpensiveOutlineWithBlur(b, canvas, outlineColor, outlineColor);
+ .applyExpensiveOutlineWithBlur(b, canvas);
canvas.setBitmap(null);
return b;
}