You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
GskCanvas.drawBitmap(): reuse GdkTexture objects
This commit is contained in:
@@ -25,7 +25,7 @@ public class BitmapDrawable extends Drawable {
|
||||
|
||||
public BitmapDrawable(Resources res, Bitmap bitmap) {
|
||||
this.bitmap = bitmap;
|
||||
this.paintable = native_paintable_from_pixbuf(bitmap.pixbuf);
|
||||
this.paintable = bitmap.getTexture();
|
||||
}
|
||||
|
||||
public Bitmap getBitmap() {
|
||||
@@ -40,6 +40,4 @@ public class BitmapDrawable extends Drawable {
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
static native long native_paintable_from_pixbuf(long pixbuf);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class VectorDrawable extends Drawable {
|
||||
String svg = sb.toString();
|
||||
byte[] bytes = svg.getBytes();
|
||||
Bitmap bm = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
||||
this.paintable = BitmapDrawable.native_paintable_from_pixbuf(bm.pixbuf);
|
||||
this.paintable = bm.getTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user