summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-11-29 21:10:24 -0800
committerXavier Ducrohet <xav@android.com>2010-11-29 21:10:24 -0800
commit30c77d689ead610685a5e0bd4078b44eb89360ff (patch)
tree059523ffd0a206933d0aa75e5a3f10fcda8a0aa0 /tools
parent40c01e3826771c1106517e00c5e7d3f328bc450e (diff)
downloadframeworks_base-30c77d689ead610685a5e0bd4078b44eb89360ff.zip
frameworks_base-30c77d689ead610685a5e0bd4078b44eb89360ff.tar.gz
frameworks_base-30c77d689ead610685a5e0bd4078b44eb89360ff.tar.bz2
LayoutLib: get AWT image from new image factory.
Change-Id: Ib760af8a77fefac2571b8b4e48b4728e158aab2f
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
index 0859976..8a07767 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
@@ -440,8 +440,13 @@ public class LayoutSceneImpl {
// draw the views
// create the BufferedImage into which the layout will be rendered.
- mImage = new BufferedImage(renderScreenWidth, renderScreenHeight - mScreenOffset,
- BufferedImage.TYPE_INT_ARGB);
+ if (mParams.getImageFactory() != null) {
+ mImage = mParams.getImageFactory().getImage(renderScreenWidth,
+ renderScreenHeight - mScreenOffset);
+ } else {
+ mImage = new BufferedImage(renderScreenWidth, renderScreenHeight - mScreenOffset,
+ BufferedImage.TYPE_INT_ARGB);
+ }
if (mParams.isCustomBackgroundEnabled()) {
Graphics2D gc = mImage.createGraphics();
@@ -482,7 +487,7 @@ public class LayoutSceneImpl {
// log it
mParams.getLogger().error(t);
- return new SceneResult("Unknown error during inflation.", t);
+ return new SceneResult("Unknown error during rendering.", t);
}
}