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

Commit c21e3643 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Stop pretending USE_OPENGL_RENDERER is a thing"

parents 1c9c3f4e a2732a2b
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -16,10 +16,6 @@ else
    LOCAL_CFLAGS += -DPACKED=""
endif

ifeq ($(USE_OPENGL_RENDERER),true)
    LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER
endif

LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES

LOCAL_SRC_FILES:= \
@@ -247,11 +243,8 @@ LOCAL_SHARED_LIBRARIES := \
    libprocessgroup \
    libnativebridge

ifeq ($(USE_OPENGL_RENDERER),true)
    LOCAL_SHARED_LIBRARIES += libhwui
endif

LOCAL_SHARED_LIBRARIES += \
    libhwui \
    libdl

# we need to access the private Bionic header
+2 −6
Original line number Diff line number Diff line
@@ -363,24 +363,20 @@ static jobject Bitmap_copy(JNIEnv* env, jobject, jlong srcHandle,

static void Bitmap_destructor(JNIEnv* env, jobject, jlong bitmapHandle) {
    SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
#ifdef USE_OPENGL_RENDERER
    if (android::uirenderer::ResourceCache::hasInstance()) {
        android::uirenderer::ResourceCache::getInstance().destructor(bitmap);
        return;
    }
#endif // USE_OPENGL_RENDERER
    } else {
        delete bitmap;
    }
}

static jboolean Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) {
    SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
#ifdef USE_OPENGL_RENDERER
    if (android::uirenderer::ResourceCache::hasInstance()) {
        bool result;
        result = android::uirenderer::ResourceCache::getInstance().recycle(bitmap);
        return result ? JNI_TRUE : JNI_FALSE;
    }
#endif // USE_OPENGL_RENDERER
    bitmap->setPixels(NULL, NULL);
    return JNI_TRUE;
}
+2 −11
Original line number Diff line number Diff line
@@ -24,12 +24,6 @@

namespace android {

#ifdef USE_OPENGL_RENDERER
static const bool kUseOpenGLRenderer = true;
#else
static const bool kUseOpenGLRenderer = false;
#endif

using namespace uirenderer;

static jlong createFloat(JNIEnv* env, jobject clazz, jfloat initialValue) {
@@ -51,11 +45,8 @@ static JNINativeMethod gMethods[] = {
};

int register_android_graphics_CanvasProperty(JNIEnv* env) {
    if (kUseOpenGLRenderer) {
    return RegisterMethodsOrDie(env, "android/graphics/CanvasProperty", gMethods,
                                NELEM(gMethods));
}
    return 0;
}

}; // namespace android
+2 −4
Original line number Diff line number Diff line
@@ -80,15 +80,13 @@ public:

    static void finalize(JNIEnv* env, jobject, jlong patchHandle) {
        int8_t* patch = reinterpret_cast<int8_t*>(patchHandle);
#ifdef USE_OPENGL_RENDERER
        if (android::uirenderer::ResourceCache::hasInstance()) {
            Res_png_9patch* p = (Res_png_9patch*) patch;
            android::uirenderer::ResourceCache::getInstance().destructor(p);
            return;
        }
#endif // USE_OPENGL_RENDERER
        } else {
            delete[] patch;
        }
    }

    static void draw(JNIEnv* env, SkCanvas* canvas, SkRect& bounds, const SkBitmap* bitmap,
            Res_png_9patch* chunk, const SkPaint* paint, jint destDensity, jint srcDensity) {
+2 −4
Original line number Diff line number Diff line
@@ -38,14 +38,12 @@ public:

    static void finalizer(JNIEnv* env, jobject clazz, jlong objHandle) {
        SkPath* obj = reinterpret_cast<SkPath*>(objHandle);
#ifdef USE_OPENGL_RENDERER
        if (android::uirenderer::ResourceCache::hasInstance()) {
            android::uirenderer::ResourceCache::getInstance().destructor(obj);
            return;
        }
#endif
        } else {
            delete obj;
        }
    }

    static jlong init1(JNIEnv* env, jobject clazz) {
        return reinterpret_cast<jlong>(new SkPath());
Loading