Skip to content

Commit

Permalink
Graphics API improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Feb 20, 2019
1 parent 8245d0f commit ebfd53e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
@@ -1,7 +1,7 @@
/* /*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann * Copyright 2014 Ludwig M Brinckmann
* Copyright 2016 devemux86 * Copyright 2016-2019 devemux86
* Copyright 2017 usrusr * Copyright 2017 usrusr
* Copyright 2019 cpt1gl0 * Copyright 2019 cpt1gl0
* *
Expand Down Expand Up @@ -29,6 +29,9 @@ public interface GraphicContext {


void drawBitmap(Bitmap bitmap, Matrix matrix, Filter filter); 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, void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter); int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter);


Expand Down
@@ -1,7 +1,7 @@
/* /*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann * Copyright 2014 Ludwig M Brinckmann
* Copyright 2014-2018 devemux86 * Copyright 2014-2019 devemux86
* Copyright 2017 usrusr * Copyright 2017 usrusr
* Copyright 2019 cpt1gl0 * Copyright 2019 cpt1gl0
* *
Expand Down Expand Up @@ -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 @Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom, public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) { int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) {
Expand Down
@@ -1,6 +1,6 @@
/* /*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014-2017 devemux86 * Copyright 2014-2019 devemux86
* Copyright 2017 usrusr * Copyright 2017 usrusr
* Copyright 2019 cpt1gl0 * Copyright 2019 cpt1gl0
* *
Expand Down Expand Up @@ -182,6 +182,15 @@ public void drawBitmap(Bitmap bitmap, Matrix matrix, Filter filter) {
this.graphics2D.drawRenderedImage(applyFilter(AwtGraphicFactory.getBitmap(bitmap), filter), AwtGraphicFactory.getAffineTransform(matrix)); 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 @Override
public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom, public void drawBitmap(Bitmap bitmap, int srcLeft, int srcTop, int srcRight, int srcBottom,
int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) { int dstLeft, int dstTop, int dstRight, int dstBottom, Filter filter) {
Expand Down

0 comments on commit ebfd53e

Please sign in to comment.