Skip to content
Permalink
Browse files

Graphics API improvements

  • Loading branch information...
devemux86 committed Feb 20, 2019
1 parent 8245d0f commit ebfd53e77611052615150917c6884f3d6c12dea4
@@ -1,7 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann
* Copyright 2016 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2017 usrusr
* Copyright 2019 cpt1gl0
*
@@ -29,6 +29,9 @@

void drawBitmap(Bitmap bitmap, Matrix matrix, Filter filter);

void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom);

void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter);

@@ -1,7 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann
* Copyright 2014-2018 devemux86
* Copyright 2014-2019 devemux86
* Copyright 2017 usrusr
* Copyright 2019 cpt1gl0
*
@@ -136,6 +136,15 @@ public void drawBitmap(Bitmap bitmap, Matrix matrix, Filter filter) {
}
}

@Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom) {
this.canvas.drawBitmap(AndroidGraphicFactory.getBitmap(bitmap),
new Rect(srcLeft, srcTop, srcRight, srcBottom),
new Rect(dstLeft, dstTop, dstRight, dstBottom),
this.bitmapPaint);
}

@Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) {
@@ -1,6 +1,6 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014-2017 devemux86
* Copyright 2014-2019 devemux86
* Copyright 2017 usrusr
* Copyright 2019 cpt1gl0
*
@@ -182,6 +182,15 @@ public void drawBitmap(Bitmap bitmap, Matrix matrix, Filter filter) {
this.graphics2D.drawRenderedImage(applyFilter(AwtGraphicFactory.getBitmap(bitmap), filter), AwtGraphicFactory.getAffineTransform(matrix));
}

@Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom) {
this.graphics2D.drawImage(AwtGraphicFactory.getBitmap(bitmap),
dstLeft, dstTop, dstRight, dstBottom,
srcLeft, srcTop, srcRight, srcBottom,
null);
}

@Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) {

0 comments on commit ebfd53e

Please sign in to comment.
You can’t perform that action at this time.