We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d81f0b2 commit 2ba7381Copy full SHA for 2ba7381
core/src/processing/a2d/PGraphicsAndroid2D.java
@@ -183,8 +183,12 @@ public void requestDraw() {
183
184
protected Canvas checkCanvas() {
185
if ((canvas == null || sized) && (useBitmap || !primaryGraphics)) {
186
- if (bitmap != null) bitmap.recycle();
187
- bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
+ if (bitmap == null || bitmap.getWidth() * bitmap.getHeight() < width * height) {
+ if (bitmap != null) bitmap.recycle();
188
+ bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
189
+ } else {
190
+ bitmap.reconfigure(width, height, bitmap.getConfig());
191
+ }
192
canvas = new Canvas(bitmap);
193
sized = false;
194
}
0 commit comments