From dafbf247ee4d0c14d501a23612115ab3a1306288 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 15 Jul 2011 16:44:39 -0700 Subject: [PATCH] Remove unused code Change-Id: I7f7fc6bac03c92087037fc56b78fc43a1e93dae5 --- core/jni/Android.mk | 1 - core/jni/AndroidRuntime.cpp | 1 - .../com_android_internal_graphics_NativeUtils.cpp | 60 ---------------------- .../com/android/internal/graphics/NativeUtils.java | 40 --------------- 4 files changed, 102 deletions(-) delete mode 100644 core/jni/com_android_internal_graphics_NativeUtils.cpp delete mode 100644 graphics/java/com/android/internal/graphics/NativeUtils.java diff --git a/core/jni/Android.mk b/core/jni/Android.mk index 58e7c8df2c39..06dc083695a1 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -145,7 +145,6 @@ LOCAL_SRC_FILES:= \ android_server_Watchdog.cpp \ android_ddm_DdmHandleNativeHeap.cpp \ com_android_internal_os_ZygoteInit.cpp \ - com_android_internal_graphics_NativeUtils.cpp \ android_backup_BackupDataInput.cpp \ android_backup_BackupDataOutput.cpp \ android_backup_FileBackupHelperBase.cpp \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 23c6da7a1b59..75b1e7bd3b16 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -115,7 +115,6 @@ extern int register_android_graphics_Region(JNIEnv* env); extern int register_android_graphics_SurfaceTexture(JNIEnv* env); extern int register_android_graphics_Xfermode(JNIEnv* env); extern int register_android_graphics_PixelFormat(JNIEnv* env); -extern int register_com_android_internal_graphics_NativeUtils(JNIEnv *env); extern int register_android_view_Display(JNIEnv* env); extern int register_android_view_GLES20Canvas(JNIEnv* env); extern int register_android_view_Surface(JNIEnv* env); diff --git a/core/jni/com_android_internal_graphics_NativeUtils.cpp b/core/jni/com_android_internal_graphics_NativeUtils.cpp deleted file mode 100644 index 9cc43606fac5..000000000000 --- a/core/jni/com_android_internal_graphics_NativeUtils.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 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. - */ - -#define LOG_TAG "AWT" - -#include "jni.h" -#include "JNIHelp.h" -#include "GraphicsJNI.h" -#include - -#include "SkCanvas.h" -#include "SkDevice.h" -#include "SkPicture.h" -#include "SkTemplates.h" - -namespace android -{ - -static jboolean scrollRect(JNIEnv* env, jobject graphics2D, jobject canvas, jobject rect, int dx, int dy) { - if (canvas == NULL) { - jniThrowNullPointerException(env, NULL); - return false; - } - - SkIRect src, *srcPtr = NULL; - if (NULL != rect) { - GraphicsJNI::jrect_to_irect(env, rect, &src); - srcPtr = &src; - } - SkCanvas* c = GraphicsJNI::getNativeCanvas(env, canvas); - const SkBitmap& bitmap = c->getDevice()->accessBitmap(true); - return bitmap.scrollRect(srcPtr, dx, dy, NULL); -} - -static JNINativeMethod method_table[] = { - { "nativeScrollRect", - "(Landroid/graphics/Canvas;Landroid/graphics/Rect;II)Z", - (void*)scrollRect} -}; - -int register_com_android_internal_graphics_NativeUtils(JNIEnv *env) { - return AndroidRuntime::registerNativeMethods( - env, "com/android/internal/graphics/NativeUtils", - method_table, NELEM(method_table)); -} - -} diff --git a/graphics/java/com/android/internal/graphics/NativeUtils.java b/graphics/java/com/android/internal/graphics/NativeUtils.java deleted file mode 100644 index c91b7d9ddf97..000000000000 --- a/graphics/java/com/android/internal/graphics/NativeUtils.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008 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 com.android.internal.graphics; - -import android.graphics.Canvas; -import android.graphics.Rect; - -public final class NativeUtils { - /** - * This class is uninstantiable. - */ - private NativeUtils() { - // This space intentionally left blank. - } - - /** - * Scroll a rectangular portion of a canvas. - * - * @param canvas the canvas to manipulate - * @param src the source rectangle - * @param dx horizontal offset - * @param dy vertical offset - */ - public static native boolean nativeScrollRect(Canvas canvas, Rect src, - int dx, int dy); -} -- 2.11.0