summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java')
-rw-r--r--src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java b/src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java
index c4837ad4a..cc14bf65f 100644
--- a/src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java
+++ b/src/com/android/gallery3d/filtershow/cache/TripleBufferBitmap.java
@@ -30,6 +30,7 @@ public class TripleBufferBitmap {
private boolean mNeedsSwap = false;
private final Bitmap.Config mBitmapConfig = Bitmap.Config.ARGB_8888;
+ private boolean mNeedsRepaint = true;
public TripleBufferBitmap() {
@@ -68,4 +69,17 @@ public class TripleBufferBitmap {
mConsumer = intermediate;
mNeedsSwap = false;
}
+
+ public synchronized void invalidate() {
+ mNeedsRepaint = true;
+ }
+
+ public synchronized boolean checkRepaintNeeded() {
+ if (mNeedsRepaint) {
+ mNeedsRepaint = false;
+ return true;
+ }
+ return false;
+ }
+
}