diff options
author | Xavier Ducrohet <xav@android.com> | 2010-11-29 17:49:19 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-11-30 14:59:48 -0800 |
commit | 645b8a905ad70a7d0623dfbbfe6da720da038de9 (patch) | |
tree | 539839f309b7d83d10002c31de932c3580da6b27 /layoutlib_api/src/com/android/layoutlib/api/SceneParams.java | |
parent | 7aebcab2414437c477570804d602a8b163d964de (diff) | |
download | sdk-645b8a905ad70a7d0623dfbbfe6da720da038de9.zip sdk-645b8a905ad70a7d0623dfbbfe6da720da038de9.tar.gz sdk-645b8a905ad70a7d0623dfbbfe6da720da038de9.tar.bz2 |
ADT/Layoutlib: New API to let the caller instantiate the bitmap.
This allows us to use a bitmap more compatible with SWT.
In ADT's case, because the bitmap needs to be converted to SWT
before being displayed, we create a BufferedImage using a byte[]
instead of a int[] so that we can simply do an array copy.
Also, we reuse the generated BufferedImage unless the size changed,
which lets us see less GC during animation playback.
Change-Id: I0062a4f4442ff6469cf0ad4f501c1fbe8c719400
Diffstat (limited to 'layoutlib_api/src/com/android/layoutlib/api/SceneParams.java')
-rw-r--r-- | layoutlib_api/src/com/android/layoutlib/api/SceneParams.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/layoutlib_api/src/com/android/layoutlib/api/SceneParams.java b/layoutlib_api/src/com/android/layoutlib/api/SceneParams.java index 0eb9768..1bbd96a 100644 --- a/layoutlib_api/src/com/android/layoutlib/api/SceneParams.java +++ b/layoutlib_api/src/com/android/layoutlib/api/SceneParams.java @@ -64,6 +64,8 @@ public class SceneParams { private int mCustomBackgroundColor; private long mTimeout; + private IImageFactory mImageFactory = null; + /** * * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the @@ -136,6 +138,7 @@ public class SceneParams { mCustomBackgroundEnabled = params.mCustomBackgroundEnabled; mCustomBackgroundColor = params.mCustomBackgroundColor; mTimeout = params.mTimeout; + mImageFactory = params.mImageFactory; } public void setCustomBackgroundColor(int color) { @@ -147,6 +150,10 @@ public class SceneParams { mTimeout = timeout; } + public void setImageFactory(IImageFactory imageFactory) { + mImageFactory = imageFactory; + } + public IXmlPullParser getLayoutDescription() { return mLayoutDescription; } @@ -214,4 +221,8 @@ public class SceneParams { public long getTimeout() { return mTimeout; } + + public IImageFactory getImageFactory() { + return mImageFactory; + } } |