summaryrefslogtreecommitdiffstats
path: root/core/jni/android_view_GLES20Canvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/jni/android_view_GLES20Canvas.cpp')
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index ece9636..142e194 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -31,6 +31,7 @@
#include <OpenGLRenderer.h>
#include <SkiaShader.h>
+#include <SkiaColorFilter.h>
#include <Rect.h>
#include <ui/Rect.h>
@@ -228,12 +229,13 @@ static void android_view_GLES20Canvas_drawRect(JNIEnv* env, jobject canvas,
}
// ----------------------------------------------------------------------------
-// Shaders
+// Shaders and color filters
// ----------------------------------------------------------------------------
-static void android_view_GLES20Canvas_resetShader(JNIEnv* env, jobject canvas,
+static void android_view_GLES20Canvas_resetModifiers(JNIEnv* env, jobject canvas,
OpenGLRenderer* renderer) {
renderer->resetShader();
+ renderer->resetColorFilter();
}
static void android_view_GLES20Canvas_setupShader(JNIEnv* env, jobject canvas,
@@ -241,6 +243,11 @@ static void android_view_GLES20Canvas_setupShader(JNIEnv* env, jobject canvas,
renderer->setupShader(shader);
}
+static void android_view_GLES20Canvas_setupColorFilter(JNIEnv* env, jobject canvas,
+ OpenGLRenderer* renderer, SkiaColorFilter* filter) {
+ renderer->setupColorFilter(filter);
+}
+
// ----------------------------------------------------------------------------
// Text
// ----------------------------------------------------------------------------
@@ -311,8 +318,9 @@ static JNINativeMethod gMethods[] = {
{ "nDrawColor", "(III)V", (void*) android_view_GLES20Canvas_drawColor },
{ "nDrawRect", "(IFFFFI)V", (void*) android_view_GLES20Canvas_drawRect },
- { "nResetShader", "(I)V", (void*) android_view_GLES20Canvas_resetShader },
+ { "nResetModifiers", "(I)V", (void*) android_view_GLES20Canvas_resetModifiers },
{ "nSetupShader", "(II)V", (void*) android_view_GLES20Canvas_setupShader },
+ { "nSetupColorFilter", "(II)V", (void*) android_view_GLES20Canvas_setupColorFilter },
{ "nDrawText", "(I[CIIFFII)V", (void*) android_view_GLES20Canvas_drawTextArray },
{ "nDrawText", "(ILjava/lang/String;IIFFII)V",