Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 873057b3 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Remove obsolete code."

parents 75fd93c0 66e9af6c
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ public final class ViewAncestor extends Handler implements ViewParent,
        View.AttachInfo.Callbacks, HardwareRenderer.HardwareDrawCallbacks {
    private static final String TAG = "ViewAncestor";
    private static final boolean DBG = false;
    private static final boolean SHOW_FPS = false;
    private static final boolean LOCAL_LOGV = false;
    /** @noinspection PointlessBooleanExpression*/
    private static final boolean DEBUG_DRAW = false || LOCAL_LOGV;
@@ -130,8 +129,6 @@ public final class ViewAncestor extends Handler implements ViewParent,
    static final ArrayList<ComponentCallbacks> sConfigCallbacks
            = new ArrayList<ComponentCallbacks>();
    
    private static int sDrawTime;

    long mLastTrackballTime = 0;
    final TrackballAxis mTrackballAxisX = new TrackballAxis();
    final TrackballAxis mTrackballAxisY = new TrackballAxis();
@@ -1813,14 +1810,6 @@ public final class ViewAncestor extends Handler implements ViewParent,
                        mView.dispatchConsistencyCheck(ViewDebug.CONSISTENCY_DRAWING);
                    }

                    if (SHOW_FPS || ViewDebug.DEBUG_SHOW_FPS) {
                        int now = (int)SystemClock.elapsedRealtime();
                        if (sDrawTime != 0) {
                            nativeShowFPS(canvas, now - sDrawTime);
                        }
                        sDrawTime = now;
                    }

                    if (ViewDebug.DEBUG_PROFILE_DRAWING) {
                        EventLog.writeEvent(60000, SystemClock.elapsedRealtime() - startTime);
                    }
@@ -4502,6 +4491,4 @@ public final class ViewAncestor extends Handler implements ViewParent,
            }
        }
    }

    private static native void nativeShowFPS(Canvas canvas, int durationMillis);
}
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ LOCAL_SRC_FILES:= \
	android_view_Display.cpp \
	android_view_Surface.cpp \
	android_view_TextureView.cpp \
	android_view_ViewAncestor.cpp \
	android_view_InputChannel.cpp \
	android_view_InputQueue.cpp \
	android_view_KeyEvent.cpp \
+0 −2
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ extern int register_android_view_Display(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
extern int register_android_view_TextureView(JNIEnv* env);
extern int register_android_view_ViewAncestor(JNIEnv* env);
extern int register_android_database_CursorWindow(JNIEnv* env);
extern int register_android_database_SQLiteCompiledSql(JNIEnv* env);
extern int register_android_database_SQLiteDatabase(JNIEnv* env);
@@ -1121,7 +1120,6 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_view_GLES20Canvas),
    REG_JNI(register_android_view_Surface),
    REG_JNI(register_android_view_TextureView),
    REG_JNI(register_android_view_ViewAncestor),
    REG_JNI(register_com_google_android_gles_jni_EGLImpl),
    REG_JNI(register_com_google_android_gles_jni_GLImpl),
    REG_JNI(register_android_opengl_jni_GLES10),
+0 −95
Original line number Diff line number Diff line
/*
 * 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.
 */

#include <stdio.h>
#include <assert.h>
#include <sys/socket.h>

#include <core/SkCanvas.h>
#include <core/SkDevice.h>
#include <core/SkPaint.h>
#include <utils/SkGLCanvas.h>
#include "GraphicsJNI.h"

#include "jni.h"
#include <nativehelper/JNIHelp.h>
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>

// ----------------------------------------------------------------------------

namespace android {

static int gPrevDur;

static void android_view_ViewAncestor_showFPS(JNIEnv* env, jobject, jobject jcanvas,
                                          jint dur) {
    NPE_CHECK_RETURN_VOID(env, jcanvas);
    SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, jcanvas);
    const SkBitmap& bm = canvas->getDevice()->accessBitmap(false);
    int height = bm.height();
    SkScalar bot = SkIntToScalar(height);

    if (height < 200) {
        return;
    }

    SkMatrix m;
    SkRect   r;
    SkPaint  p;
    char    str[4];

    dur = (gPrevDur + dur) >> 1;
    gPrevDur = dur;

    dur = 1000 / dur;
    str[3] = (char)('0' + dur % 10); dur /= 10;
    str[2] = (char)('0' + dur % 10); dur /= 10;
    str[1] = (char)('0' + dur % 10); dur /= 10;
    str[0] = (char)('0' + dur % 10);

    m.reset();
    r.set(0, bot-SkIntToScalar(10), SkIntToScalar(26), bot);
    p.setAntiAlias(true);
    p.setTextSize(SkIntToScalar(10));

    canvas->save();
    canvas->setMatrix(m);
    canvas->clipRect(r, SkRegion::kReplace_Op);
    p.setColor(SK_ColorWHITE);
    canvas->drawPaint(p);
    p.setColor(SK_ColorBLACK);
    canvas->drawText(str, 4, SkIntToScalar(1), bot - SK_Scalar1, p);
    canvas->restore();
}


// ----------------------------------------------------------------------------

const char* const kClassPathName = "android/view/ViewAncestor";

static JNINativeMethod gMethods[] = {
    {   "nativeShowFPS", "(Landroid/graphics/Canvas;I)V",
                                        (void*)android_view_ViewAncestor_showFPS }
};

int register_android_view_ViewAncestor(JNIEnv* env) {
    return AndroidRuntime::registerNativeMethods(env,
            kClassPathName, gMethods, NELEM(gMethods));
}

};