diff options
author | Romain Guy <romainguy@android.com> | 2010-07-16 14:12:24 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2010-07-16 14:12:24 -0700 |
commit | 079ba2c85b15e882629b8d188f5fbdb42f7f8eea (patch) | |
tree | dcdad4233c75952bea11e4d5b945996a0f930a9a /core/jni | |
parent | ebd6f94dbdafdb14d620d2bd8e08535a309f266a (diff) | |
download | frameworks_base-079ba2c85b15e882629b8d188f5fbdb42f7f8eea.zip frameworks_base-079ba2c85b15e882629b8d188f5fbdb42f7f8eea.tar.gz frameworks_base-079ba2c85b15e882629b8d188f5fbdb42f7f8eea.tar.bz2 |
Improve clip support (add intersect, union and replace.)
This change also modifies the way the clip is stored. The clip is now
always stored in screen-space coordinates.
Change-Id: I96375784d82dfe975bc6477a159e6866e7052487
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_view_GLES20Canvas.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp index dbf482e..e5aa5dd 100644 --- a/core/jni/android_view_GLES20Canvas.cpp +++ b/core/jni/android_view_GLES20Canvas.cpp @@ -23,6 +23,7 @@ #include <SkCanvas.h> #include <SkMatrix.h> #include <SkPaint.h> +#include <SkRegion.h> #include <SkXfermode.h> #include <OpenGLRenderer.h> @@ -120,13 +121,15 @@ static bool android_view_GLES20Canvas_quickReject(JNIEnv* env, jobject canvas, } static bool android_view_GLES20Canvas_clipRectF(JNIEnv* env, jobject canvas, - OpenGLRenderer* renderer, jfloat left, jfloat top, jfloat right, jfloat bottom) { - return renderer->clipRect(left, top, right, bottom); + OpenGLRenderer* renderer, jfloat left, jfloat top, jfloat right, jfloat bottom, + SkRegion::Op op) { + return renderer->clipRect(left, top, right, bottom, op); } static bool android_view_GLES20Canvas_clipRect(JNIEnv* env, jobject canvas, - OpenGLRenderer* renderer, jint left, jint top, jint right, jint bottom) { - return renderer->clipRect(float(left), float(top), float(right), float(bottom)); + OpenGLRenderer* renderer, jint left, jint top, jint right, jint bottom, + SkRegion::Op op) { + return renderer->clipRect(float(left), float(top), float(right), float(bottom), op); } static bool android_view_GLES20Canvas_getClipBounds(JNIEnv* env, jobject canvas, @@ -257,8 +260,8 @@ static JNINativeMethod gMethods[] = { { "nSaveLayerAlpha", "(IFFFFII)I", (void*) android_view_GLES20Canvas_saveLayerAlpha }, { "nQuickReject", "(IFFFFI)Z", (void*) android_view_GLES20Canvas_quickReject }, - { "nClipRect", "(IFFFF)Z", (void*) android_view_GLES20Canvas_clipRectF }, - { "nClipRect", "(IIIII)Z", (void*) android_view_GLES20Canvas_clipRect }, + { "nClipRect", "(IFFFFI)Z", (void*) android_view_GLES20Canvas_clipRectF }, + { "nClipRect", "(IIIIII)Z", (void*) android_view_GLES20Canvas_clipRect }, { "nTranslate", "(IFF)V", (void*) android_view_GLES20Canvas_translate }, { "nRotate", "(IF)V", (void*) android_view_GLES20Canvas_rotate }, |