diff options
author | Amith Yamasani <yamasani@google.com> | 2012-04-04 10:27:15 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-04-04 12:05:59 -0700 |
commit | ec4a50428d5f26a22df3edaf7e5b08f41d5cb54b (patch) | |
tree | cd47b15082ff35879cf6e22a86f44108f45920aa /core/jni/android/graphics/NinePatchPeeker.h | |
parent | 58a40a3e92f8a53ac1068f0839dec4a1707fa6fb (diff) | |
download | frameworks_base-ec4a50428d5f26a22df3edaf7e5b08f41d5cb54b.zip frameworks_base-ec4a50428d5f26a22df3edaf7e5b08f41d5cb54b.tar.gz frameworks_base-ec4a50428d5f26a22df3edaf7e5b08f41d5cb54b.tar.bz2 |
Embed layout padding in nine patch images
- Added a new custom PNG chunk that carries the layout padding ints.
- Extract the padding ticks from .9.png images and store in the chunk.
- Load the padding information at runtime into Bitmap and NinePatchDrawable.
- The new chunk is ordered first so that it doesn't cause a problem in older
versions of the platform.
Bug: 6087201
Change-Id: I5de46167a1d44b3ec21065b0c165e594b1dc8399
Diffstat (limited to 'core/jni/android/graphics/NinePatchPeeker.h')
-rw-r--r-- | core/jni/android/graphics/NinePatchPeeker.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/jni/android/graphics/NinePatchPeeker.h b/core/jni/android/graphics/NinePatchPeeker.h index 207536c..10d268a 100644 --- a/core/jni/android/graphics/NinePatchPeeker.h +++ b/core/jni/android/graphics/NinePatchPeeker.h @@ -28,17 +28,17 @@ public: NinePatchPeeker(SkImageDecoder* host) { // the host lives longer than we do, so a raw ptr is safe fHost = host; - fPatchIsValid = false; + fPatch = NULL; + fLayoutBounds = NULL; } ~NinePatchPeeker() { - if (fPatchIsValid) { - free(fPatch); - } + free(fPatch); + delete fLayoutBounds; } - bool fPatchIsValid; Res_png_9patch* fPatch; + int *fLayoutBounds; virtual bool peek(const char tag[], const void* data, size_t length); }; |