Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: platform_tools/android/apps/canvasproof/src/main/jni/JavaInputStream.h

Issue 1258123004: android/apps: Add CanvasProof App; (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-04 (Friday) 13:29:02 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: platform_tools/android/apps/canvasproof/src/main/jni/JavaInputStream.h
diff --git a/platform_tools/android/apps/canvasproof/src/main/jni/JavaInputStream.h b/platform_tools/android/apps/canvasproof/src/main/jni/JavaInputStream.h
new file mode 100644
index 0000000000000000000000000000000000000000..e14e026552c44c9f080aaf2b7c9e421f236d9085
--- /dev/null
+++ b/platform_tools/android/apps/canvasproof/src/main/jni/JavaInputStream.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef JavaInputStream_DEFINED
+#define JavaInputStream_DEFINED
+
+#include <jni.h>
+#include "SkStream.h"
+
+class JavaInputStream : public SkStream {
+public:
+ JavaInputStream(JNIEnv*, jbyteArray javaBuffer, jobject javaIoInputStream);
+ bool isAtEnd() const override;
+ size_t read(void*, size_t) override;
+private:
+ JNIEnv* fEnv;
+ jobject fInputStream;
+ jbyteArray fJavaBuffer;
+ jclass fInputStreamClass;
+ jmethodID fReadMethodID;
+ jint fStartIndex;
+ jint fEndIndex;
+};
+
+#endif // JavaInputStream_DEFINED

Powered by Google App Engine
This is Rietveld 408576698