diff options
Diffstat (limited to 'android/src/com/artifex/mupdfdemo/BitmapHolder.java')
-rw-r--r-- | android/src/com/artifex/mupdfdemo/BitmapHolder.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/android/src/com/artifex/mupdfdemo/BitmapHolder.java b/android/src/com/artifex/mupdfdemo/BitmapHolder.java new file mode 100644 index 00000000..f563e897 --- /dev/null +++ b/android/src/com/artifex/mupdfdemo/BitmapHolder.java @@ -0,0 +1,21 @@ +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 Bitmap getBm() { + return bm; + } +} |