summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-10-26 15:11:25 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-26 15:11:26 -0700
commit3b6743cb518f090d7c3ac427122e54122ad85ce6 (patch)
treec72d4bc239168d3763d4771532a1026eb4985896 /src/com/android/gallery3d/ui
parent6e0655f27f5263f67caa6c48f15a36a63a6cce04 (diff)
parent4663598408ac2ca40c9d2009de1a74c5adbbe85f (diff)
downloadandroid_packages_apps_Snap-3b6743cb518f090d7c3ac427122e54122ad85ce6.tar.gz
android_packages_apps_Snap-3b6743cb518f090d7c3ac427122e54122ad85ce6.tar.bz2
android_packages_apps_Snap-3b6743cb518f090d7c3ac427122e54122ad85ce6.zip
Merge "Fix the black lines near edge of thumbnails" into gb-ub-photos-arches
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r--src/com/android/gallery3d/ui/TiledTexture.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/ui/TiledTexture.java b/src/com/android/gallery3d/ui/TiledTexture.java
index 8e26221bc..ce3fcc617 100644
--- a/src/com/android/gallery3d/ui/TiledTexture.java
+++ b/src/com/android/gallery3d/ui/TiledTexture.java
@@ -36,8 +36,8 @@ import java.util.ArrayList;
// upload the whole bitmap but we reduce the time of uploading each tile
// so it make the animation more smooth and prevents jank.
public class TiledTexture implements Texture {
- private static final int CONTENT_SIZE = 256;
- private static final int BORDER_SIZE = 0;
+ private static final int CONTENT_SIZE = 254;
+ private static final int BORDER_SIZE = 1;
private static final int TILE_SIZE = CONTENT_SIZE + 2 * BORDER_SIZE;
private static final int INIT_CAPACITY = 8;
@@ -50,6 +50,7 @@ public class TiledTexture implements Texture {
private static Bitmap sUploadBitmap;
private static Canvas sCanvas;
+ private static Paint sBitmapPaint;
private static Paint sPaint;
private int mUploadIndex = 0;
@@ -128,9 +129,9 @@ public class TiledTexture implements Texture {
protected Bitmap onGetBitmap() {
int x = BORDER_SIZE - offsetX;
int y = BORDER_SIZE - offsetY;
- int r = bitmap.getWidth() - x;
- int b = bitmap.getHeight() - y ;
- sCanvas.drawBitmap(bitmap, x, y, null);
+ int r = bitmap.getWidth() + x;
+ int b = bitmap.getHeight() + y ;
+ sCanvas.drawBitmap(bitmap, x, y, sBitmapPaint);
bitmap = null;
// draw borders if need
@@ -220,15 +221,18 @@ public class TiledTexture implements Texture {
public static void freeResources() {
sUploadBitmap = null;
sCanvas = null;
+ sBitmapPaint = null;
sPaint = null;
}
public static void prepareResources() {
sUploadBitmap = Bitmap.createBitmap(TILE_SIZE, TILE_SIZE, Config.ARGB_8888);
sCanvas = new Canvas(sUploadBitmap);
- sPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
+ sBitmapPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
+ sBitmapPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
+ sPaint = new Paint();
+ sPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
sPaint.setColor(Color.TRANSPARENT);
- sPaint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
}
// We want to draw the "source" on the "target".