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

Commit 9d4efdf2 authored by John Reck's avatar John Reck
Browse files

Revert "A bunch more cleanups"

This reverts commit c294d128.

Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
parent 7809f835
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ public class ThreadedRenderer extends HardwareRenderer {
    @Override
    boolean copyLayerInto(final HardwareLayer layer, final Bitmap bitmap) {
        return nCopyLayerInto(mNativeProxy,
                layer.getDeferredLayerUpdater(), bitmap);
                layer.getDeferredLayerUpdater(), bitmap.getSkBitmap());
    }

    @Override
@@ -531,7 +531,7 @@ public class ThreadedRenderer extends HardwareRenderer {

    private static native long nCreateTextureLayer(long nativeProxy);
    private static native void nBuildLayer(long nativeProxy, long node);
    private static native boolean nCopyLayerInto(long nativeProxy, long layer, Bitmap bitmap);
    private static native boolean nCopyLayerInto(long nativeProxy, long layer, long bitmap);
    private static native void nPushLayerUpdate(long nativeProxy, long layer);
    private static native void nCancelLayerUpdate(long nativeProxy, long layer);
    private static native void nDetachSurfaceTexture(long nativeProxy, long layer);
+4 −2
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ SkColorType GraphicsJNI::getNativeBitmapColorType(JNIEnv* env, jobject jconfig)
    return legacyBitmapConfigToColorType(c);
}

android::Canvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) {
SkCanvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) {
    SkASSERT(env);
    SkASSERT(canvas);
    SkASSERT(env->IsInstanceOf(canvas, gCanvas_class));
@@ -381,7 +381,9 @@ android::Canvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) {
    if (!canvasHandle) {
        return NULL;
    }
    return reinterpret_cast<android::Canvas*>(canvasHandle);
    SkCanvas* c = reinterpret_cast<android::Canvas*>(canvasHandle)->asSkCanvas();
    SkASSERT(c);
    return c;
}

SkRegion* GraphicsJNI::getNativeRegion(JNIEnv* env, jobject region)
+1 −2
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
#include "SkPoint.h"
#include "SkRect.h"
#include "SkImageDecoder.h"
#include <Canvas.h>
#include <jni.h>

class SkBitmapRegionDecoder;
@@ -48,7 +47,7 @@ public:
    static SkPoint* jpointf_to_point(JNIEnv*, jobject jpointf, SkPoint* point);
    static void point_to_jpointf(const SkPoint& point, JNIEnv*, jobject jpointf);

    static android::Canvas* getNativeCanvas(JNIEnv*, jobject canvas);
    static SkCanvas* getNativeCanvas(JNIEnv*, jobject canvas);
    static SkBitmap* getSkBitmapDeprecated(JNIEnv*, jobject bitmap);
    static void getSkBitmap(JNIEnv*, jobject bitmap, SkBitmap* outBitmap);
    static SkPixelRef* getSkPixelRef(JNIEnv*, jobject bitmap);
+4 −5
Original line number Diff line number Diff line
@@ -80,12 +80,11 @@ static jlong Shader_setLocalMatrix(JNIEnv* env, jobject o, jlong shaderHandle, j

///////////////////////////////////////////////////////////////////////////////////////////////

static jlong BitmapShader_constructor(JNIEnv* env, jobject o, jobject jbitmap,
static jlong BitmapShader_constructor(JNIEnv* env, jobject o, jlong bitmapHandle,
                                      jint tileModeX, jint tileModeY)
{
    SkBitmap bitmap;
    GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap);
    SkShader* s = SkShader::CreateBitmapShader(bitmap,
    const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
    SkShader* s = SkShader::CreateBitmapShader(*bitmap,
                                        (SkShader::TileMode)tileModeX,
                                        (SkShader::TileMode)tileModeY);

@@ -250,7 +249,7 @@ static JNINativeMethod gShaderMethods[] = {
};

static JNINativeMethod gBitmapShaderMethods[] = {
    { "nativeCreate",     "(Landroid/graphics/Bitmap;II)J",  (void*)BitmapShader_constructor },
    { "nativeCreate",     "(JII)J",  (void*)BitmapShader_constructor },
};

static JNINativeMethod gLinearGradientMethods[] = {
+8 −13
Original line number Diff line number Diff line
@@ -39,22 +39,17 @@ static void finalizer(JNIEnv* env, jobject clazz, jlong canvasHandle) {
}

// Native wrapper constructor used by Canvas(Bitmap)
static jlong initRaster(JNIEnv* env, jobject, jobject jbitmap) {
    SkBitmap bitmap;
    if (jbitmap != NULL) {
        GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap);
    }
static jlong initRaster(JNIEnv* env, jobject, jlong bitmapHandle) {
    SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
    return reinterpret_cast<jlong>(Canvas::create_canvas(bitmap));
}

// Set the given bitmap as the new draw target (wrapped in a new SkCanvas),
// optionally copying canvas matrix & clip state.
static void setBitmap(JNIEnv* env, jobject, jlong canvasHandle, jobject jbitmap) {
    SkBitmap bitmap;
    if (jbitmap != NULL) {
        GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap);
    }
    get_canvas(canvasHandle)->setBitmap(bitmap);
static void setBitmap(JNIEnv* env, jobject, jlong canvasHandle, jlong bitmapHandle,
                      jboolean copyState) {
    SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
    get_canvas(canvasHandle)->setBitmap(bitmap, copyState);
}

static jboolean isOpaque(JNIEnv*, jobject, jlong canvasHandle) {
@@ -663,8 +658,8 @@ static void freeTextLayoutCaches(JNIEnv* env, jobject) {

static JNINativeMethod gMethods[] = {
    {"finalizer", "(J)V", (void*) CanvasJNI::finalizer},
    {"initRaster", "(Landroid/graphics/Bitmap;)J", (void*) CanvasJNI::initRaster},
    {"native_setBitmap", "(JLandroid/graphics/Bitmap;)V", (void*) CanvasJNI::setBitmap},
    {"initRaster", "(J)J", (void*) CanvasJNI::initRaster},
    {"native_setBitmap", "(JJZ)V", (void*) CanvasJNI::setBitmap},
    {"native_isOpaque","(J)Z", (void*) CanvasJNI::isOpaque},
    {"native_getWidth","(J)I", (void*) CanvasJNI::getWidth},
    {"native_getHeight","(J)I", (void*) CanvasJNI::getHeight},
Loading