diff options
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/BitmapHolder.java')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/BitmapHolder.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/BitmapHolder.java b/platform/android/src/com/artifex/mupdfdemo/BitmapHolder.java new file mode 100644 index 00000000..5816e7bb --- /dev/null +++ b/platform/android/src/com/artifex/mupdfdemo/BitmapHolder.java @@ -0,0 +1,25 @@ +package com.artifex.mupdfdemo; + +import android.graphics.Bitmap; + +public class BitmapHolder { + private Bitmap bm; + + public BitmapHolder() { + bm = null; + } + + public synchronized void setBm(Bitmap abm) { + if (bm != null && bm != abm) + bm.recycle(); + bm = abm; + } + + public synchronized void drop() { + bm = null; + } + + public synchronized Bitmap getBm() { + return bm; + } +} |