OSDN Git Service

ADT/Layoutlib: New API to let the caller instantiate the bitmap.
authorXavier Ducrohet <xav@android.com>
Tue, 30 Nov 2010 01:49:19 +0000 (17:49 -0800)
committerXavier Ducrohet <xav@android.com>
Tue, 30 Nov 2010 22:59:48 +0000 (14:59 -0800)
commit645b8a905ad70a7d0623dfbbfe6da720da038de9
tree539839f309b7d83d10002c31de932c3580da6b27
parent7aebcab2414437c477570804d602a8b163d964de
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
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageOverlay.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/Overlay.java
layoutlib_api/src/com/android/layoutlib/api/IImageFactory.java [new file with mode: 0644]
layoutlib_api/src/com/android/layoutlib/api/SceneParams.java