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
misc stubbing for ctr2
This commit is contained in:
@@ -365,6 +365,8 @@ public class Canvas {
|
||||
native_drawLine(cairo_context, widget, startX, startY, stopX, stopY, paint.getColor());
|
||||
}
|
||||
|
||||
public void setBitmap(Bitmap bitmap) {}
|
||||
|
||||
private static native void native_drawLine(long cairo_context, long widget, float startX, float startY, float stopX, float stopY, int paint_color); // TODO: pass all the other relevant parameters extracted from paint
|
||||
private static native void native_drawBitmap(long cairo_context, long widget, long pixbuf, float src_x, float src_y, float dest_x, float dest_y, Paint paint); // TODO: make use of "paint"?
|
||||
private static native void native_rotate(long cairo_context, long widget, float angle);
|
||||
|
||||
7
src/api-impl/android/graphics/Color.java
Normal file
7
src/api-impl/android/graphics/Color.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package android.graphics;
|
||||
|
||||
public class Color {
|
||||
public static int argb(int alpha, int red, int green, int blue) {
|
||||
return (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
|
||||
}
|
||||
}
|
||||
@@ -124,4 +124,48 @@ public class Paint {
|
||||
public /*native*/ float getFontMetrics(FontMetrics metrics) {return 0;}
|
||||
public /*native*/ int getFontMetricsInt(FontMetricsInt fmi) {return 0;}
|
||||
|
||||
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
||||
|
||||
public Xfermode setXfermode(Xfermode xfermode) {return xfermode;}
|
||||
|
||||
public enum Cap {
|
||||
/**
|
||||
* The stroke ends with the path, and does not project beyond it.
|
||||
*/
|
||||
BUTT (0),
|
||||
/**
|
||||
* The stroke projects out as a semicircle, with the center at the
|
||||
* end of the path.
|
||||
*/
|
||||
ROUND (1),
|
||||
/**
|
||||
* The stroke projects out as a square, with the center at the end
|
||||
* of the path.
|
||||
*/
|
||||
SQUARE (2);
|
||||
|
||||
|
||||
private Cap(int nativeInt) {}
|
||||
}
|
||||
|
||||
public enum Join {
|
||||
/**
|
||||
* The outer edges of a join meet at a sharp angle
|
||||
*/
|
||||
MITER (0),
|
||||
/**
|
||||
* The outer edges of a join meet in a circular arc.
|
||||
*/
|
||||
ROUND (1),
|
||||
/**
|
||||
* The outer edges of a join meet with a straight line
|
||||
*/
|
||||
BEVEL (2);
|
||||
|
||||
private Join(int nativeInt) {}
|
||||
}
|
||||
|
||||
public void setStrokeCap(Cap cap) {}
|
||||
|
||||
public void setStrokeJoin(Join join) {}
|
||||
}
|
||||
|
||||
63
src/api-impl/android/graphics/PorterDuff.java
Normal file
63
src/api-impl/android/graphics/PorterDuff.java
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2006 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.graphics;
|
||||
|
||||
public class PorterDuff {
|
||||
|
||||
// these value must match their native equivalents. See SkPorterDuff.h
|
||||
public enum Mode {
|
||||
/** [0, 0] */
|
||||
CLEAR (0),
|
||||
/** [Sa, Sc] */
|
||||
SRC (1),
|
||||
/** [Da, Dc] */
|
||||
DST (2),
|
||||
/** [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] */
|
||||
SRC_OVER (3),
|
||||
/** [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc] */
|
||||
DST_OVER (4),
|
||||
/** [Sa * Da, Sc * Da] */
|
||||
SRC_IN (5),
|
||||
/** [Sa * Da, Sa * Dc] */
|
||||
DST_IN (6),
|
||||
/** [Sa * (1 - Da), Sc * (1 - Da)] */
|
||||
SRC_OUT (7),
|
||||
/** [Da * (1 - Sa), Dc * (1 - Sa)] */
|
||||
DST_OUT (8),
|
||||
/** [Da, Sc * Da + (1 - Sa) * Dc] */
|
||||
SRC_ATOP (9),
|
||||
/** [Sa, Sa * Dc + Sc * (1 - Da)] */
|
||||
DST_ATOP (10),
|
||||
/** [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc] */
|
||||
XOR (11),
|
||||
/** [Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] */
|
||||
DARKEN (12),
|
||||
/** [Sa + Da - Sa*Da,
|
||||
Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] */
|
||||
LIGHTEN (13),
|
||||
/** [Sa * Da, Sc * Dc] */
|
||||
MULTIPLY (14),
|
||||
/** [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] */
|
||||
SCREEN (15),
|
||||
/** Saturate(S + D) */
|
||||
ADD (16),
|
||||
OVERLAY (17);
|
||||
|
||||
Mode(int nativeInt) {}
|
||||
}
|
||||
}
|
||||
5
src/api-impl/android/graphics/PorterDuffXfermode.java
Normal file
5
src/api-impl/android/graphics/PorterDuffXfermode.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.graphics;
|
||||
|
||||
public class PorterDuffXfermode extends Xfermode {
|
||||
public PorterDuffXfermode(PorterDuff.Mode mode) {}
|
||||
}
|
||||
5
src/api-impl/android/graphics/Xfermode.java
Normal file
5
src/api-impl/android/graphics/Xfermode.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.graphics;
|
||||
|
||||
public class Xfermode {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user