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

Commit 4defed42 authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge changes I3814b491,Ic3a7f4c0 into honeycomb

* changes:
  Pass SkRegion::toString() through to java.
  Remove optimization to isInContentArea that wasn't working.
parents 62097ad6 120856c5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -154,6 +154,16 @@ static void Region_scale(JNIEnv* env, jobject region, jfloat scale, jobject dst)
        scale_rgn(rgn, *rgn, scale);
}

static jstring Region_toString(JNIEnv* env, jobject clazz, SkRegion* region) {
    char* str = region->toString();
    if (str == NULL) {
        return NULL;
    }
    jstring result = env->NewStringUTF(str);
    free(str);
    return result;
}

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

static SkRegion* Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
@@ -262,6 +272,7 @@ static JNINativeMethod gRegionMethods[] = {
    { "quickReject",            "(Landroid/graphics/Region;)Z",     (void*)Region_quickRejectRgn    },
    { "scale",                  "(FLandroid/graphics/Region;)V",    (void*)Region_scale             },
    { "translate",              "(IILandroid/graphics/Region;)V",   (void*)Region_translate         },
    { "nativeToString",         "(I)Ljava/lang/String;",            (void*)Region_toString          },
    // parceling methods
    { "nativeCreateFromParcel", "(Landroid/os/Parcel;)I",           (void*)Region_createFromParcel  },
    { "nativeWriteToParcel",    "(ILandroid/os/Parcel;)Z",          (void*)Region_writeToParcel     },
+7 −1
Original line number Diff line number Diff line
@@ -287,6 +287,10 @@ public class Region implements Parcelable {
                        region2.mNativeRegion, op.nativeInt);
    }

    public String toString() {
        return nativeToString(mNativeRegion);
    }

    //////////////////////////////////////////////////////////////////////////
    
    public static final Parcelable.Creator<Region> CREATOR
@@ -357,6 +361,8 @@ public class Region implements Parcelable {
        return mNativeRegion;
    }

    private static native boolean nativeEquals(int native_r1, int native_r2);

    private static native int nativeConstructor();
    private static native void nativeDestructor(int native_region);

@@ -381,5 +387,5 @@ public class Region implements Parcelable {
    private static native boolean nativeWriteToParcel(int native_region,
                                                      Parcel p);

    private static native boolean nativeEquals(int native_r1, int native_r2);
    private static native String nativeToString(int native_region);
}
+6 −9
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    View mNotificationScroller;
    View mNotificationGlow;
    ViewGroup mContentFrame;
    Rect mContentArea;
    Rect mContentArea = new Rect();
    View mSettingsView;
    View mScrim, mGlow;
    ViewGroup mContentParent;
@@ -136,7 +136,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    @Override
    public void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        mContentArea = null;
    }

    public void onClick(View v) {
@@ -165,13 +164,11 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    }

    public boolean isInContentArea(int x, int y) {
        if (mContentArea == null) {
            mContentArea = new Rect(mContentFrame.getLeft(),
                    mTitleArea.getTop(),
                    mContentFrame.getRight(),
                    mContentFrame.getBottom());
        mContentArea.left = mContentFrame.getLeft();
        mContentArea.top = mTitleArea.getTop();
        mContentArea.right = mContentFrame.getRight();
        mContentArea.bottom = mContentFrame.getBottom();
        offsetDescendantRectToMyCoords(mContentParent, mContentArea);
        }
        return mContentArea.contains(x, y);
    }