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

Commit 746f8681 authored by Matt Sarett's avatar Matt Sarett
Browse files

Rename SkBitmapRegionDecoder to BitmapRegionDecoder

This is temporary, we are planning to delete this class.
Renaming will allow us to have an SkBitmapRegionDecoder class
in Skia.

Change-Id: I8d24d481d4e8cf782f578fa6deb6e3245c998a37
parent 8382f98f
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -39,14 +39,14 @@

using namespace android;

class SkBitmapRegionDecoder {
class BitmapRegionDecoder {
public:
    SkBitmapRegionDecoder(SkImageDecoder* decoder, int width, int height) {
    BitmapRegionDecoder(SkImageDecoder* decoder, int width, int height) {
        fDecoder = decoder;
        fWidth = width;
        fHeight = height;
    }
    ~SkBitmapRegionDecoder() {
    ~BitmapRegionDecoder() {
        delete fDecoder;
    }

@@ -91,7 +91,7 @@ static jobject createBitmapRegionDecoder(JNIEnv* env, SkStreamRewindable* stream
        return nullObjectReturn("decoder->buildTileIndex returned false");
    }

    SkBitmapRegionDecoder *bm = new SkBitmapRegionDecoder(decoder, width, height);
    BitmapRegionDecoder *bm = new BitmapRegionDecoder(decoder, width, height);
    return GraphicsJNI::createBitmapRegionDecoder(env, bm);
}

@@ -166,7 +166,7 @@ static jobject nativeNewInstanceFromAsset(JNIEnv* env, jobject clazz,
 */
static jobject nativeDecodeRegion(JNIEnv* env, jobject, jlong brdHandle,
                                jint start_x, jint start_y, jint width, jint height, jobject options) {
    SkBitmapRegionDecoder *brd = reinterpret_cast<SkBitmapRegionDecoder*>(brdHandle);
    BitmapRegionDecoder *brd = reinterpret_cast<BitmapRegionDecoder*>(brdHandle);
    jobject tileBitmap = NULL;
    SkImageDecoder *decoder = brd->getDecoder();
    int sampleSize = 1;
@@ -245,17 +245,17 @@ static jobject nativeDecodeRegion(JNIEnv* env, jobject, jlong brdHandle,
}

static jint nativeGetHeight(JNIEnv* env, jobject, jlong brdHandle) {
    SkBitmapRegionDecoder *brd = reinterpret_cast<SkBitmapRegionDecoder*>(brdHandle);
    BitmapRegionDecoder *brd = reinterpret_cast<BitmapRegionDecoder*>(brdHandle);
    return static_cast<jint>(brd->getHeight());
}

static jint nativeGetWidth(JNIEnv* env, jobject, jlong brdHandle) {
    SkBitmapRegionDecoder *brd = reinterpret_cast<SkBitmapRegionDecoder*>(brdHandle);
    BitmapRegionDecoder *brd = reinterpret_cast<BitmapRegionDecoder*>(brdHandle);
    return static_cast<jint>(brd->getWidth());
}

static void nativeClean(JNIEnv* env, jobject, jlong brdHandle) {
    SkBitmapRegionDecoder *brd = reinterpret_cast<SkBitmapRegionDecoder*>(brdHandle);
    BitmapRegionDecoder *brd = reinterpret_cast<BitmapRegionDecoder*>(brdHandle);
    delete brd;
}

+1 −1
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ int GraphicsJNI::getBitmapAllocationByteCount(JNIEnv* env, jobject javaBitmap)
    return env->CallIntMethod(javaBitmap, gBitmap_getAllocationByteCountMethodID);
}

jobject GraphicsJNI::createBitmapRegionDecoder(JNIEnv* env, SkBitmapRegionDecoder* bitmap)
jobject GraphicsJNI::createBitmapRegionDecoder(JNIEnv* env, BitmapRegionDecoder* bitmap)
{
    SkASSERT(bitmap != NULL);

+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include <Canvas.h>
#include <jni.h>

class SkBitmapRegionDecoder;
class BitmapRegionDecoder;
class SkCanvas;

namespace android {
@@ -90,7 +90,7 @@ public:

    static jobject createRegion(JNIEnv* env, SkRegion* region);

    static jobject createBitmapRegionDecoder(JNIEnv* env, SkBitmapRegionDecoder* bitmap);
    static jobject createBitmapRegionDecoder(JNIEnv* env, BitmapRegionDecoder* bitmap);

    static android::Bitmap* allocateJavaPixelRef(JNIEnv* env, SkBitmap* bitmap,
            SkColorTable* ctable);