consistent formatting
This commit is contained in:
@@ -31,11 +31,12 @@ public class AndroidBitmap implements org.oscim.backend.canvas.Bitmap {
|
||||
/**
|
||||
* @param format ignored always ARGB8888
|
||||
*/
|
||||
public AndroidBitmap(int width, int height, int format){
|
||||
public AndroidBitmap(int width, int height, int format) {
|
||||
mBitmap = android.graphics.Bitmap
|
||||
.createBitmap(width, height, android.graphics.Bitmap.Config.ARGB_8888);
|
||||
.createBitmap(width, height, android.graphics.Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
AndroidBitmap(android.graphics.Bitmap bitmap){
|
||||
|
||||
AndroidBitmap(android.graphics.Bitmap bitmap) {
|
||||
mBitmap = bitmap;
|
||||
}
|
||||
|
||||
@@ -72,7 +73,7 @@ public class AndroidBitmap implements org.oscim.backend.canvas.Bitmap {
|
||||
|
||||
if (replace)
|
||||
GLUtils.texSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, mBitmap, format,
|
||||
type);
|
||||
type);
|
||||
else
|
||||
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, format, mBitmap, type, 0);
|
||||
|
||||
|
||||
@@ -10,19 +10,21 @@ public class AndroidCanvas implements Canvas {
|
||||
public AndroidCanvas() {
|
||||
this.canvas = new android.graphics.Canvas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBitmap(Bitmap bitmap) {
|
||||
this.canvas.setBitmap(((AndroidBitmap)bitmap).mBitmap);
|
||||
this.canvas.setBitmap(((AndroidBitmap) bitmap).mBitmap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawText(String string, float x, float y, Paint stroke) {
|
||||
this.canvas.drawText(string, x, y, ((AndroidPaint)stroke).mPaint);
|
||||
this.canvas.drawText(string, x, y, ((AndroidPaint) stroke).mPaint);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBitmap(Bitmap bitmap, float x, float y) {
|
||||
this.canvas.drawBitmap(((AndroidBitmap)bitmap).mBitmap, x, y, null);
|
||||
this.canvas.drawBitmap(((AndroidBitmap) bitmap).mBitmap, x, y, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -100,10 +100,10 @@ public final class AndroidGraphics extends CanvasAdapter {
|
||||
return new AndroidBitmap(((BitmapDrawable) drawable).getBitmap());
|
||||
}
|
||||
|
||||
android.graphics.Bitmap bitmap = android.graphics.Bitmap.createBitmap(
|
||||
drawable.getIntrinsicWidth(),
|
||||
drawable.getIntrinsicHeight(),
|
||||
Config.ARGB_8888);
|
||||
android.graphics.Bitmap bitmap = android.graphics.Bitmap
|
||||
.createBitmap(drawable.getIntrinsicWidth(),
|
||||
drawable.getIntrinsicHeight(),
|
||||
Config.ARGB_8888);
|
||||
|
||||
android.graphics.Canvas canvas = new android.graphics.Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
|
||||
@@ -63,7 +63,7 @@ class AndroidPaint implements Paint {
|
||||
|
||||
AndroidPaint() {
|
||||
mPaint = new android.graphics.Paint(
|
||||
android.graphics.Paint.ANTI_ALIAS_FLAG);
|
||||
android.graphics.Paint.ANTI_ALIAS_FLAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,10 +92,12 @@ class AndroidPaint implements Paint {
|
||||
}
|
||||
|
||||
android.graphics.Bitmap androidBitmap = android.graphics.Bitmap
|
||||
.createBitmap(bitmap.getPixels(), bitmap.getWidth(),
|
||||
bitmap.getHeight(), Config.ARGB_8888);
|
||||
.createBitmap(bitmap.getPixels(),
|
||||
bitmap.getWidth(),
|
||||
bitmap.getHeight(),
|
||||
Config.ARGB_8888);
|
||||
Shader shader = new BitmapShader(androidBitmap, TileMode.REPEAT,
|
||||
TileMode.REPEAT);
|
||||
TileMode.REPEAT);
|
||||
mPaint.setShader(shader);
|
||||
}
|
||||
|
||||
@@ -113,7 +115,7 @@ class AndroidPaint implements Paint {
|
||||
@Override
|
||||
public void setStrokeCap(Cap cap) {
|
||||
android.graphics.Paint.Cap androidCap = android.graphics.Paint.Cap
|
||||
.valueOf(cap.name());
|
||||
.valueOf(cap.name());
|
||||
mPaint.setStrokeCap(androidCap);
|
||||
}
|
||||
|
||||
@@ -140,7 +142,7 @@ class AndroidPaint implements Paint {
|
||||
@Override
|
||||
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
||||
Typeface typeface = Typeface.create(getTypeface(fontFamily),
|
||||
getStyle(fontStyle));
|
||||
getStyle(fontStyle));
|
||||
mPaint.setTypeface(typeface);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user