Remove unneccessary #isHardwareAccelerated
Test: CameraTests#testBasicTranslate Change-Id: I2b5378edc3c975609bd1b427eac5677f87f601ac
This commit is contained in:
@@ -96,10 +96,12 @@ static void Camera_getMatrix(JNIEnv* env, jobject obj, jlong matrixHandle) {
|
||||
}
|
||||
|
||||
static void Camera_applyToCanvas(JNIEnv* env, jobject obj, jlong canvasHandle) {
|
||||
SkCanvas* canvas = reinterpret_cast<android::Canvas*>(canvasHandle)->asSkCanvas();
|
||||
android::Canvas* canvas = reinterpret_cast<android::Canvas*>(canvasHandle);
|
||||
jlong viewHandle = env->GetLongField(obj, gNativeInstanceFieldID);
|
||||
Sk3DView* v = reinterpret_cast<Sk3DView*>(viewHandle);
|
||||
v->applyToCanvas(canvas);
|
||||
SkMatrix matrix;
|
||||
v->getMatrix(&matrix);
|
||||
canvas->concat(matrix);
|
||||
}
|
||||
|
||||
static jfloat Camera_dotWithNormal(JNIEnv* env, jobject obj,
|
||||
|
||||
@@ -22,8 +22,6 @@ package android.graphics;
|
||||
* {@link Canvas}.
|
||||
*/
|
||||
public class Camera {
|
||||
private Matrix mMatrix;
|
||||
|
||||
/**
|
||||
* Creates a new camera, with empty transformations.
|
||||
*/
|
||||
@@ -149,13 +147,7 @@ public class Camera {
|
||||
* @param canvas The Canvas to set the transform matrix onto
|
||||
*/
|
||||
public void applyToCanvas(Canvas canvas) {
|
||||
if (canvas.isHardwareAccelerated()) {
|
||||
if (mMatrix == null) mMatrix = new Matrix();
|
||||
getMatrix(mMatrix);
|
||||
canvas.concat(mMatrix);
|
||||
} else {
|
||||
nativeApplyToCanvas(canvas.getNativeCanvasWrapper());
|
||||
}
|
||||
nativeApplyToCanvas(canvas.getNativeCanvasWrapper());
|
||||
}
|
||||
|
||||
public native float dotWithNormal(float dx, float dy, float dz);
|
||||
|
||||
Reference in New Issue
Block a user