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

Commit 0b2a66c7 authored by Sergei Vasilinetc's avatar Sergei Vasilinetc Committed by Android (Google) Code Review
Browse files

Merge "Fix getConfig function for hw bitmaps"

parents db10a209 19b4b019
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -712,6 +712,9 @@ static jint Bitmap_rowBytes(JNIEnv* env, jobject, jlong bitmapHandle) {

static jint Bitmap_config(JNIEnv* env, jobject, jlong bitmapHandle) {
    LocalScopedBitmap bitmap(bitmapHandle);
    if (bitmap->bitmap().isHardware()) {
        return GraphicsJNI::hardwareLegacyBitmapConfig();
    }
    return GraphicsJNI::colorTypeToLegacyBitmapConfig(bitmap->info().colorType());
}

+4 −0
Original line number Diff line number Diff line
@@ -366,6 +366,10 @@ bool GraphicsJNI::isHardwareConfig(JNIEnv* env, jobject jconfig) {
    return c == kHardware_LegacyBitmapConfig;
}

jint GraphicsJNI::hardwareLegacyBitmapConfig() {
    return kHardware_LegacyBitmapConfig;
}

android::Canvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) {
    SkASSERT(env);
    SkASSERT(canvas);
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ public:
    static SkColorType getNativeBitmapColorType(JNIEnv*, jobject jconfig);

    static bool isHardwareConfig(JNIEnv* env, jobject jconfig);
    static jint hardwareLegacyBitmapConfig();

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