summaryrefslogtreecommitdiff
path: root/libs/hwui/jni/CreateJavaOutputStreamAdaptor.h
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2019-10-24 11:49:54 -0400
committerDerek Sollenberger <djsollen@google.com>2020-02-19 21:13:34 -0500
commit83ccff716f160d3f9665732d50a7974f5f8e890a (patch)
tree7c26a638798a8999b186809b9133bc34f2743728 /libs/hwui/jni/CreateJavaOutputStreamAdaptor.h
parent710895ed782641341bdbf6efc2d0b9bf22fd27f8 (diff)
Move android.graphics JNI & APEX files into HWUI
The graphics JNI code is now separate from libandroid_runtime and it along with HWUI headers are no longer visible to targets outside the boundary of what is to become the UI mainline module The exposed headers to targets outside the module are now restriced to C APIs contained in the apex header directory. Bug: 137655431 Test: CtsUiRenderingTestCases Change-Id: I30d34055b6870dc1039f190a88f4a747cee17300
Diffstat (limited to 'libs/hwui/jni/CreateJavaOutputStreamAdaptor.h')
-rw-r--r--libs/hwui/jni/CreateJavaOutputStreamAdaptor.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/libs/hwui/jni/CreateJavaOutputStreamAdaptor.h b/libs/hwui/jni/CreateJavaOutputStreamAdaptor.h
new file mode 100644
index 000000000000..fccd4717c4b7
--- /dev/null
+++ b/libs/hwui/jni/CreateJavaOutputStreamAdaptor.h
@@ -0,0 +1,43 @@
+#ifndef _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_
+#define _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_
+
+//#include <android_runtime/AndroidRuntime.h>
+#include "jni.h"
+
+class SkMemoryStream;
+class SkStream;
+class SkStreamRewindable;
+class SkWStream;
+
+/**
+ * Return an adaptor from a Java InputStream to an SkStream.
+ * Does not support rewind.
+ * @param env JNIEnv object.
+ * @param stream Pointer to Java InputStream.
+ * @param storage Java byte array for retrieving data from the
+ * Java InputStream.
+ * @param swallowExceptions Whether to call ExceptionClear() after
+ * an Exception is thrown. If false, it is up to the client to
+ * clear or propagate the exception.
+ * @return SkStream Simple subclass of SkStream which supports its
+ * basic methods like reading. Only valid until the calling
+ * function returns, since the Java InputStream is not managed
+ * by the SkStream.
+ */
+SkStream* CreateJavaInputStreamAdaptor(JNIEnv* env, jobject stream, jbyteArray storage,
+ bool swallowExceptions = true);
+
+/**
+ * Copy a Java InputStream. The result will be rewindable.
+ * @param env JNIEnv object.
+ * @param stream Pointer to Java InputStream.
+ * @param storage Java byte array for retrieving data from the
+ * Java InputStream.
+ * @return SkStreamRewindable The data in stream will be copied
+ * to a new SkStreamRewindable.
+ */
+SkStreamRewindable* CopyJavaInputStream(JNIEnv* env, jobject stream, jbyteArray storage);
+
+SkWStream* CreateJavaOutputStreamAdaptor(JNIEnv* env, jobject stream, jbyteArray storage);
+
+#endif // _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_