Loading tools/layoutlib/bridge/.classpath +1 −0 Original line number Diff line number Diff line Loading @@ -8,5 +8,6 @@ <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/resources/resources-prebuilt.jar"/> <classpathentry kind="output" path="bin"/> </classpath> tools/layoutlib/bridge/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ layoutlib_api-prebuilt layoutlib_api-prebuilt \ resources-prebuilt LOCAL_STATIC_JAVA_LIBRARIES := \ temp_layoutlib \ Loading tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import com.android.resources.Density; import android.content.res.AssetManager; import android.content.res.Resources; Loading Loading @@ -462,9 +462,9 @@ public class BitmapFactory { // into is.read(...) This number is not related to the value passed // to mark(...) above. try { ResourceDensity density = ResourceDensity.MEDIUM; Density density = Density.MEDIUM; if (opts != null) { density = ResourceDensity.getEnum(opts.inDensity); density = Density.getEnum(opts.inDensity); } bm = Bitmap_Delegate.createBitmap(is, true, density); } catch (IOException e) { Loading tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +8 −8 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.resources.Density; import android.graphics.Bitmap.Config; import android.os.Parcel; Loading Loading @@ -89,12 +89,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ public static Bitmap createBitmap(File input, boolean isMutable, ResourceDensity density) public static Bitmap createBitmap(File input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the file. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading @@ -107,12 +107,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ public static Bitmap createBitmap(InputStream input, boolean isMutable, ResourceDensity density) public static Bitmap createBitmap(InputStream input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the stream. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading @@ -126,11 +126,11 @@ public final class Bitmap_Delegate { * @see Bitmap#getDensity() */ public static Bitmap createBitmap(BufferedImage image, boolean isMutable, ResourceDensity density) throws IOException { Density density) throws IOException { // create a delegate with the given image. Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading Loading @@ -425,7 +425,7 @@ public final class Bitmap_Delegate { // the density doesn't matter, it's set by the Java method. return createBitmap(delegate, false /*isMutable*/, ResourceDensity.DEFAULT_DENSITY /*density*/); Density.DEFAULT_DENSITY /*density*/); } /*package*/ static void nativePrepareToDraw(int nativeBitmap) { Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ public class BridgeRenderSession extends RenderSession { return mSession.getImage(); } @Override public boolean isAlphaChannelImage() { return mSession.isAlphaChannelImage(); } @Override public List<ViewInfo> getRootViews() { return mSession.getViewInfos(); Loading Loading
tools/layoutlib/bridge/.classpath +1 −0 Original line number Diff line number Diff line Loading @@ -8,5 +8,6 @@ <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/resources/resources-prebuilt.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
tools/layoutlib/bridge/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ layoutlib_api-prebuilt layoutlib_api-prebuilt \ resources-prebuilt LOCAL_STATIC_JAVA_LIBRARIES := \ temp_layoutlib \ Loading
tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import com.android.resources.Density; import android.content.res.AssetManager; import android.content.res.Resources; Loading Loading @@ -462,9 +462,9 @@ public class BitmapFactory { // into is.read(...) This number is not related to the value passed // to mark(...) above. try { ResourceDensity density = ResourceDensity.MEDIUM; Density density = Density.MEDIUM; if (opts != null) { density = ResourceDensity.getEnum(opts.inDensity); density = Density.getEnum(opts.inDensity); } bm = Bitmap_Delegate.createBitmap(is, true, density); } catch (IOException e) { Loading
tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +8 −8 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.resources.Density; import android.graphics.Bitmap.Config; import android.os.Parcel; Loading Loading @@ -89,12 +89,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ public static Bitmap createBitmap(File input, boolean isMutable, ResourceDensity density) public static Bitmap createBitmap(File input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the file. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading @@ -107,12 +107,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ public static Bitmap createBitmap(InputStream input, boolean isMutable, ResourceDensity density) public static Bitmap createBitmap(InputStream input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the stream. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading @@ -126,11 +126,11 @@ public final class Bitmap_Delegate { * @see Bitmap#getDensity() */ public static Bitmap createBitmap(BufferedImage image, boolean isMutable, ResourceDensity density) throws IOException { Density density) throws IOException { // create a delegate with the given image. Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.ARGB_8888); return createBitmap(delegate, isMutable, density.getDpi()); return createBitmap(delegate, isMutable, density.getDpiValue()); } /** Loading Loading @@ -425,7 +425,7 @@ public final class Bitmap_Delegate { // the density doesn't matter, it's set by the Java method. return createBitmap(delegate, false /*isMutable*/, ResourceDensity.DEFAULT_DENSITY /*density*/); Density.DEFAULT_DENSITY /*density*/); } /*package*/ static void nativePrepareToDraw(int nativeBitmap) { Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ public class BridgeRenderSession extends RenderSession { return mSession.getImage(); } @Override public boolean isAlphaChannelImage() { return mSession.isAlphaChannelImage(); } @Override public List<ViewInfo> getRootViews() { return mSession.getViewInfos(); Loading