GithubHelp home page GithubHelp logo

alibaba / gcanvas Goto Github PK

View Code? Open in Web Editor NEW
1.9K 75.0 206.0 90.36 MB

A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas

License: Apache License 2.0

Ruby 0.05% Java 2.24% Objective-C 0.98% JavaScript 8.63% C++ 34.41% C 51.75% GLSL 0.45% Objective-C++ 0.70% HTML 0.01% CMake 0.35% Shell 0.02% Dockerfile 0.02% Less 0.26% Pug 0.15%
opengl canvas 2d graphics webgl

gcanvas's Introduction

GCanvas is a cross-platform rendering engine for mobile devices developed by Alibaba. It is written with C++ based on OpenGL ES, so it can provide high performance 2D/WebGL rendering capabilities for JavaScript runtime. It also has browser-like canvas APIs, so it's very convenient and flexiable for use, especially for web developers.

Supported operating systems are Android 4.0+ (API 14) and iOS 8.0+.

Distribution

GCanvas

  • iOS GCanvas CocoaPods Version

  • Android com.taobao.gcanvas:core:1.1.0(publishing)

GCanvas NPM Package

Features

  • Cross-platform, support popular iOS and Android.
  • High performance, accelerate graphic draw by OpenGL ES.
  • Provide JavaScript runtime, such as Weex and ReactNative. convenient to use JavaScript API like HTML canvas.
  • Scalable Architecture, easy to implement a GCanvas bridge by yourself following the guide Custom Native Bridge .
  • Small size.

Introduction

See the Introduction to GCanvas for a detailed introduction to GCanvas.

Getting Started

We will continue to maintain the C++ core engine. And will no further update and support WeexReactNative and JS bridge.

Node

Follow Node Guide, use GCanvas in Node.js.

JavaScript

Try our Playground. GCanvas has browser-like canvas APIs, so almost all of the APIs are exactly same as HTML5 canvas. At this moment, we have already supported 90% of 2D APIs and 99% of WebGL APIs. You can find out those informations in 2D APIs and WebGL APIs.

Documentation

Check Documentation for more information.

Examples

We take Weex as example, code snippet of context 2d using GCanvas.

import { enable, WeexBridge, Image as GImage } from "@gcanvas/core";

var gcanvas = enable(this.$refs.canvas_holder, {bridge: WeexBridge});
var ctx = gcanvas.getContext("2d");
//rect
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 100, 100);

//rect
ctx.fillStyle = 'black';
ctx.fillRect(100, 100, 100, 100);
ctx.fillRect(25, 210, 700, 5);

//circle
ctx.arc(450, 200, 100, 0, Math.PI * 2, true);
ctx.fill();

var image = new GImage();
image.src = 'https://gw.alicdn.com/tfs/TB1KwRTlh6I8KJjy0FgXXXXzVXa-225-75.png';
image.onload = function(){
  ctx.drawImage(image, 100, 300);
};

Built With

  • Freetype - Used for font rendering on Android

Changelog

New Changelog record in CHANGELOG for details.

Open Issues

If you encounter a bug with GCanvas we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of GCanvas and OS you’re using. Please include a stack trace and reduced repro case when appropriate, too.

Contributing

Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests to us.

Authors

GCanvas Open Source Team

License

This project is licensed under the Apache LICENSE

gcanvas's People

Contributors

alibaba-oss avatar dvsoftware avatar eco747 avatar freedtice avatar jwxbond avatar luckzhiwei avatar lvfen avatar tuoxie007 avatar uniquecolin avatar yangxlei avatar yuanyan avatar yurovant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gcanvas's Issues

library not found for -lRCTGCanvas

I am using the react native bridge and it is working fine in Debug Scheme, but I get the following error when I try to Archive the project in xcode or generate a Release build:

Current behavior

when building the project for release:

xcodebuild "-project" "ios/BetClash.xcodeproj" "-scheme" "BetClash" "-configuration" "Release" "archive" "-verbose" | xcpretty

The linker fails with:

ld: library not found for -lRCTGCanvas

Expected behavior

It should build without errors.

Env:

node: v9.11.2
npm: 5.6.0
xcode: 9.4.1

Usage guide missing code causes NRE

This is in reference to the Usage section @ https://alibaba.github.io/GCanvas/docs/Integrate%20GCanvas%20on%20ReactNative.html

The code is importing NativeModules but seems to be missing something like

ReactNativeBridge.GCanvasModule = NativeModules.GCanvasModule;

The call stack enable --> GBridge.callEnable --> GBridge.GCanvasModule.enable fails with a null reference error on GCanvasModule.

I don't know if this should be in the documentation for use, or in the file gcanvas.js/src/bridge/bridge-reactnative.js, since it's a prerequisite for anything working.

React Native: how to get good performance

OS: macOS High Sierra 10.13.2
Node: 6.11.1
npm: 3.10.10
Watchman: 4.7.0

react-native-cli: 2.0.1
react-native: 0.54.1

react-native-gcanvas : 0.02
gcanvas.js : ^0.05

Simulator (ios): 10.0 (SimulatorApp-835.5 CoreSimulator-494.33) - iPhone 6 - 11.2

I am writing an application where text is being rendered on the canvas whenever the user types in a <TextInput />. Mydraw() method is called whenever the text changes, which is, whenever the user types. I noticed that if on each call to draw() I execute canvas.getContext("2D"), the CPU starts going up and the iphone simulator becomes slow and irresponsive. By getting the canvas and saving the context in the state, and calling getContext("2D") only once, the performance is better, but still quite slow. In general though, even if I just do it once, as soon as I call getContext("2D") the CPU does rise quite a lot and stays high, even if the user is not typing.

Can't compile GCanvas due to error in Weex playground project

When building GCanvas by running ./GCanvas/GCanvas/gradlew build, and after disabling linting errors for the react native bridge, I receive the following error:

Execution failed for task ':bridges:weex-bridge:android:weex_playground:transformNativeLibsWithMergeJniLibsForDebug'.
> More than one file was found with OS independent path 'lib/armeabi/libgcanvas.so'

I'm compiling on Windows.

iOS 8系统上canvas竖线不显示

调用strokeRect方法或者closePath方法 ,在iOS 8手机上发现竖线不显示,iOS8以上系统机型显示正常
代码如下:
` var ref = this.$refs.canvas_holder;

  ref = enable(ref, {bridge: WeexBridge});
 
  var ctx = ref.getContext('2d');
  ctx.strokeRect(20,20,150,100);

`

` var ref = this.$refs.canvas_holder;
ref = enable(ref, {bridge: WeexBridge});
var ctx = ref.getContext('2d');

  ctx.beginPath();
  ctx.moveTo(20,20);
  ctx.lineTo(20,100);
  ctx.lineTo(70,100);
  ctx.closePath();
  ctx.stroke();

`
image

System.loadLibrary fails (Trying to write a bridge for NativeScript)

When initializing GTextureView, it throws:

03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.callJSMethodNative(Native Method)
03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.callJSMethod(Runtime.java:957)
03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.callJSMethod(Runtime.java:941)
03-23 13:56:47.570 24743 24743 E GTextureViewCallback:  at com.tns.Runtime.callJSMethod(Runtime.java:933)

which doesn't say much, but after a bit of digging I found this in GTextureViewCallback:

static {
	if(!INITIALIZED) {
		try {
			System.loadLibrary("gcanvas");
			System.loadLibrary("freetype");
			GCanvasJNI.setFontFamilies();
			INITIALIZED = true;
		} catch (Throwable var1) {
			GLog.e("GTextureViewCallback", "error when load library", var1);
		}
	}
}

So I tried executing System.loadLibrary("freetype") which failed:

JS: ERROR Error: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.nativescript.test-WSsnJQcOMx_opeWwBYpiIg==/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.test-WSsnJQcOMx_opeWwBYpiIg==/lib/x86, /data/app/org.nativescript.test-WSsnJQcOMx_opeWwBYpiIg==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libfreetype.so"

It's almost the same for System.loadLibrary("gcanvas").

Does anyone know what I'm doing wrong?

Update: I'm assuming it might be because there's no x86/x64 version of freetype and gcanvas specified in Android.mk, but it's kind of hard to test, because an arm-emulator takes forever to boot.

华为荣耀8手机文本渐变填色不支持

  var ref = this.$refs.canvas_holder;
  ref = enable(ref, {bridge: WeexBridge});
  var ctx = ref.getContext('2d');

  ctx.font="20px Georgia";
  ctx.strokeText("Hello World!",10,50);

  ctx.font="30px Verdana";
  // 创建渐变
  var gradient=ctx.createLinearGradient(0,0,300,0);
  gradient.addColorStop("0","magenta");
  gradient.addColorStop("0.5","blue");
  gradient.addColorStop("1.0","red");
  // 用渐变填色
  ctx.strokeStyle=gradient;
  ctx.strokeText("Hello World2222222!",10,90);

执行上述代码在华为荣耀8手机上不显示下面的"Hello World2222222!",小米4c和锤子手机正常。

GCanvas doesn't work on Android

I'm unable to get this library to work on Android.

One thing I've noticed is that the render function in the JNI seems to be off.

In GCanvas/GCanvas/core/src/GCanvasJNI.h

JNIEXPORT void JNICALL Java_com_taobao_gcanvas_GCanvasJNI_render(
        JNIEnv *je, jclass jc, jobject jCanvasRender, jstring contextId,
jstring renderCommands);

the render method requires 5 arguments, where the first two are automatically populated.

But in GCanvas/GCanvas/android/gcanvas_library/src/com/taobao/gcanvas/GCanvasJNI.java the method is given this signature:

public static native void render(String contextID, String renderCommands);

Calling this java-method will populate jclass jCanvasRender with String contextID and jstring contextId with String renderCommands.

Changing the java-signature to public static native void render(Object canvasRender, String contextID, String renderCommands); and passing null to canvasRender will start the parser without throwing errors, but nothing is shown on the GTextureView.

EDIT: More specifically, I'm passing this: com.taobao.gcanvas.GCanvasJNI.render(null, "123", "THello from GCanvas,50,50,0.0;"), where 123 is the GTextureView id. The command is run within an attached TextureView.SurfaceTextureListener in onSurfaceTextureAvailable. Perhaps the command is wrong...

React native setup guide incomplete

When trying to setup a simple react native project (created by react-native init) and following the official guide, you end up with the following build issues for android:

Building and installing the app on the device (cd android && ./gradlew installDebug...
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
	at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:645)
	at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608)
	at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
	at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.java:603)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
	at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
	at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy11.afterEvaluate(Unknown Source)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
	at org.gradle.api.internal.project.DefaultProjectAccessListener.evaluateProjectAndDiscoverTasks(DefaultProjectAccessListener.java:32)
	at org.gradle.api.internal.project.DefaultProjectAccessListener.beforeResolvingProjectDependency(DefaultProjectAccessListener.java:28)
	at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency.beforeResolved(DefaultProjectDependency.java:90)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.ProjectIvyDependencyDescriptorFactory.createDependencyDescriptor(ProjectIvyDependencyDescriptorFactory.java:39)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependencyDescriptorFactory.createDependencyDescriptor(DefaultDependencyDescriptorFactory.java:35)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependenciesToModuleDescriptorConverter.addDependencies(DefaultDependenciesToModuleDescriptorConverter.java:43)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependenciesToModuleDescriptorConverter.addDependencyDescriptors(DefaultDependenciesToModuleDescriptorConverter.java:36)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.DefaultConfigurationComponentMetaDataBuilder.addDependencies(DefaultConfigurationComponentMetaDataBuilder.java:51)
	at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.DefaultConfigurationComponentMetaDataBuilder.addConfigurations(DefaultConfigurationComponentMetaDataBuilder.java:39)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.toRootComponentMetaData(DefaultConfiguration.java:557)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver$DefaultResolveContextToComponentResolver.resolve(DefaultArtifactDependencyResolver.java:144)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:74)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver$1.execute(DefaultArtifactDependencyResolver.java:90)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver$1.execute(DefaultArtifactDependencyResolver.java:80)
	at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:39)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:80)
	at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:41)
	at org.gradle.internal.Factories$1.create(Factories.java:22)
	at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:192)
	at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
	at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:187)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:64)
	at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:39)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:91)
	at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyConfigurationResolver.resolve(SelfResolvingDependencyConfigurationResolver.java:40)
	at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolve(ShortCircuitEmptyConfigurationResolver.java:52)
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolve(ErrorHandlingConfigurationResolver.java:43)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:372)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:347)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:340)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
	at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:497)
	at com.android.build.gradle.internal.DependencyManager.gatherDependencies(DependencyManager.java:375)
	at com.android.build.gradle.internal.DependencyManager.resolveDependencyForConfig(DependencyManager.java:278)
	at com.android.build.gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:155)
	at com.android.build.gradle.internal.TaskManager.resolveDependencies(TaskManager.java:364)
	at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:636)
	at com.android.build.gradle.internal.VariantManager$9.call(VariantManager.java:633)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
	at com.android.build.gradle.internal.profile.SpanRecorders.record(SpanRecorders.java:44)
	at com.android.build.gradle.internal.VariantManager.createVariantData(VariantManager.java:629)
	at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:823)
	at com.android.build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:494)
	at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:269)
	at com.android.build.gradle.internal.VariantManager$1.call(VariantManager.java:266)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
	at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:265)
	at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:688)
	at com.android.build.gradle.BasePlugin$11.call(BasePlugin.java:685)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
	at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:683)
	at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608)
	at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
	at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.java:603)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
	at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
	at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy11.afterEvaluate(Unknown Source)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
	at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
	at org.gradle.internal.Factories$1.create(Factories.java:22)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
	at org.gradle.launcher.Main.doAction(Main.java:33)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

FAILURE: Build failed with an exception.

* Where:
Build file '/home/uuser/react-native/gcanvas/node_modules/react-native-gcanvas/android/build.gradle' line: 3

* What went wrong:
A problem occurred evaluating project ':react-native-gcanvas'.
> Extension with name 'groups' does not exist. Currently registered extension names: [ext]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.424 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
gradle -version

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Linux 4.15.12-1-ARCH amd64

package.json

{
  "name": "gcanvas",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "gcanvas.js": "0.0.6",
    "react": "~16.0.0",
    "react-native": "0.41.0-rc.1",
    "react-native-gcanvas": "0.0.4"
  },
  "devDependencies": {
    "babel-jest": "22.4.3",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.3",
    "react-test-renderer": "^16.3.0-alpha.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

React Native with GCanvas run error

Hi, I am developing a React Native app.

I run a demo with GCanvas in iOS device. I got a error was

failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(/Users/James/GCanvasDemo/node_modules/gcanvas.js/src/index.js: Unknown plugin "transform-decorators-legacy" specified in "/Users/James/GCanvasDemo/node_modules/gcanvas.js/.babelrc" at 2, attempted to resolve relative to "/Users/James/GCanvasDemo/node_modules/gcanvas.js" (null))

The project configration were following. How to make it work. Thanks a lot for your feedback.

Env information

    os: macOS High Sierra 10.13.2
    node: 9.9.0
    npm: 5.6.0
    watchman: 4.9.0
    react-native-cli: 2.0.1
    react-native: 0.55.4
    react-native-gcanvas : 0.0.7-dev
    gcanvas.js : 0.0.8

App.js

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';

import {
  requireNativeComponent,
  findNodeHandle,
  NativeModules
} from 'react-native';


import {
  GCanvasView,
} from 'react-native-gcanvas';

import { enable, ReactNativeBridge, Image as GImage } from "gcanvas.js/src/index.js";

ReactNativeBridge.GCanvasModule = NativeModules.GCanvasModule;
ReactNativeBridge.Platform = Platform;

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' +
    'Cmd+D or shake for dev menu',
  android: 'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit App.js
        </Text>
        <Text style={styles.instructions}>
          {instructions}
        </Text>
      </View>
    );
  }
}

Package.json

    {
      "name": "GCanvasDemo",
      "version": "0.0.1",
      "private": true,
      "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
      },
      "dependencies": {
        "gcanvas.js": "0.0.8",
        "react": "16.3.1",
        "react-native": "0.55.4",
        "react-native-gcanvas": "0.0.7-dev"
      },
      "devDependencies": {
        "babel-jest": "22.4.4",
        "babel-preset-react-native": "4.0.0",
        "jest": "22.4.4",
        "react-test-renderer": "16.3.1"
      },
      "jest": {
        "preset": "react-native"
      }
    }

.babelrc

    {
      "presets": ["react-native"]
    }

mismatch between gcanvas.js and weex-gcanvas module(IOS)

Hi, I'm using the gcanvas.min.js( compiled from source) and weex-gcanvas(installed using cocoapods).
I found the interfaces between gcanvas.js and weex module are not consistent.
eg, the gcanvas.js is calling the bindImageTexture interface like this:

GCanvasModule.bindImageTexture([src, imageId], componentId);

The first param is an array, while the same interface implemented in WXGCanvasModule.m:

- (void)bindImageTexture:(NSString*)src componentId:(NSString*)componentId callback:(WXModuleCallback)callback

the first param is a string.

so obviously this won't work. Probably I should not use the latest gcanvas.js, but AFAIK, there is no way to install gcanvas.js that matches the version of weex-gcanvas. "npm install weex-gcanvas" does not give me the right gcanvas.js.

This is not a flaw in code, but somebody should update the package.

Saving an image with toDataURL or getImageData

Hi thank you for the great lib, it's a life saver :)

Would it be possible to get one of these two function in?
I'd be happy to help, however i don't know ios (nor do i own a mac) so i could only help with the android implementation.

P.S. I notice that the api docu says that "getImageData" is already in, but the api does not seem to be exposed (at least not in the react-native brige).

Best Regards

Android drawImage 565的图片,画出来是花屏

GRenderer::bindTexture方法中,对internalformat和format根据BitmapInfo的format进行了校正,但是type没有进行校正,导致图片绘制出来是花屏。
image
GL_RGB对应的type为:GL_UNSIGNED_SHORT_5_6_5,需要加上红框中的代码

Build fails on iOS and Android

iOS

Build fails with

./node_modules/react-native-gcanvas/ios/RCTGCanvasView.h:23:9: 'GCanvas/GCanvasViewProtocol.h' file not found

Following the latest docs (and using react-native-gcanvas v 0.0.5 and gcanvas v 0.0.7), there is no ./node_modules/react-native-gcanvas/ios/GCanvas.framework file (after running react-native link react-native-gcanvas).

Android

Build fails with

Extension with name 'groups' does not exist. Currently registered extension names: [ext]

Relevant line is group = rootProject.extensions.groups.Bridge in ./node_modules/react-native-gcanvas/android/build.gradle. Gradle version is 3.1.0.

Build failure for react native / ios

Working on a project created with the current version of create-react-native-app followed by running npm eject and using Xcode 9.1:

I receive the following build errors:

=== BUILD TARGET RCTGCanvas OF PROJECT RCTGCanvas WITH CONFIGURATION Debug ===



Check dependencies







Write auxiliary files

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-generated-files.hmap

/bin/mkdir -p /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas.LinkFileList

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-target-headers.hmap

/bin/mkdir -p /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/RCTGCanvas_vers.c

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-project-headers.hmap

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-non-framework-target-headers.hmap

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas.hmap

write-file /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-own-target-headers.hmap





CompileC /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasModule.o RCTGCanvasModule.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

    cd /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios

    export LANG=en_US.US-ASCII

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxxx/Library/Android/sdk/platform-tools/"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fmodules -fmodules-cache-path=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=11.1 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Index/DataStore -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-generated-files.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-own-target-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-target-headers.hmap -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-project-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/include -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/arm64 -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios -MMD -MT dependencies -MF /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasModule.d --serialize-diagnostics /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasModule.dia -c /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios/RCTGCanvasModule.m -o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasModule.o





CompileC /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasView.o RCTGCanvasView.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

    cd /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios

    export LANG=en_US.US-ASCII

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxxx/Library/Android/sdk/platform-tools/"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fmodules -fmodules-cache-path=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=11.1 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Index/DataStore -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-generated-files.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-own-target-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-target-headers.hmap -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-project-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/include -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/arm64 -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios -MMD -MT dependencies -MF /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasView.d --serialize-diagnostics /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasView.dia -c /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios/RCTGCanvasView.m -o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasView.o



CompileC /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasViewManager.o RCTGCanvasViewManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

    cd /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios

    export LANG=en_US.US-ASCII

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxxx/Library/Android/sdk/platform-tools/"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fmodules -fmodules-cache-path=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=11.1 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Index/DataStore -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-generated-files.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-own-target-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-target-headers.hmap -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-project-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-

newuicontrols/ios/build/Build/Products/Debug-iphoneos/include -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/arm64 -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios -MMD -MT dependencies -MF /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasViewManager.d --serialize-diagnostics /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasViewManager.dia -c /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios/RCTGCanvasViewManager.m -o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvasViewManager.o



CompileC /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas_vers.o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/RCTGCanvas_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler

    cd /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios

    export LANG=en_US.US-ASCII

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxxx/Library/Android/sdk/platform-tools/"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fmodules -fmodules-cache-path=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -fstrict-aliasing -Wdeprecated-declarations -miphoneos-version-min=11.1 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Index/DataStore -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-generated-files.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-own-target-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-all-target-headers.hmap -iquote /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/RCTGCanvas-project-headers.hmap -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/include -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/arm64 -I/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos -F/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios -MMD -MT dependencies -MF /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas_vers.d --serialize-diagnostics /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas_vers.dia -c /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/DerivedSources/RCTGCanvas_vers.c -o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas_vers.o





Libtool /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a normal arm64

    cd /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/node_modules/react-native-gcanvas/ios

    export IPHONEOS_DEPLOYMENT_TARGET=11.1

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxxx/Library/Android/sdk/platform-tools/"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -L/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos -filelist /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Intermediates.noindex/RCTGCanvas.build/Debug-iphoneos/RCTGCanvas.build/Objects-normal/arm64/RCTGCanvas.LinkFileList -framework GCanvas -o /Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a





[...]



ld: warning: object file (/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a(RCTGCanvasView.o)) was built for newer iOS version (11.1) than being linked (8.0)

ld: warning: object file (/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a(RCTGCanvasViewManager.o)) was built for newer iOS version (11.1) than being linked (8.0)

ld: warning: object file (/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a(RCTGCanvasModule.o)) was built for newer iOS version (11.1) than being linked (8.0)

ld: warning: object file (/Users/xxxx/Desktop/xxxx-cordova/xxxx-newuicontrols/ios/build/Build/Products/Debug-iphoneos/libRCTGCanvas.a(RCTGCanvas_vers.o)) was built for newer iOS version (11.1) than being linked (8.0)

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_GCanvasModule", referenced from:

      objc-class-ref in libRCTGCanvas.a(RCTGCanvasModule.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)







** BUILD FAILED **







The following commands produced analyzer issues:

	Analyze Base/RCTModuleMethod.mm

(1 command with analyzer issues)





The following build commands failed:



	Ld build/Build/Products/Debug-iphoneos/xxxxnewuicontrols.app/xxxxnewuicontrols normal arm64

(1 failure)

Add support for x86 (Android)

Sorry for all the issues, but I think GCanvas is an extremely important step towards better cross platform development.

I tried compiling GCanvas core and FreeType for Android x86 and got no errors. Have this architecture been left out because of subtle bugs? There might not be many Android devices out there running on x86, but the Android simulator usually does. I tried starting an arm-based simulator, which took approx. 30 minutes to boot and then crashed after trying to transfer some code for a long time.

安卓下背景不透明,fillText有锯齿

image

<template>
    <scroller>
        <image :src="linkImg.bg" class="bg"></image>
        <div class="chart">
            <gcanvas ref="canvas_holder" style="top: 0; width:750;height:1000;"></gcanvas>
        </div>

    </scroller>
</template>
<style scoped lang="stylus">
    .bg{
        width:750px;
        height:325px;
        position: absolute;
        left:0px;
        top: 0px;
    }
    .chart{
        position: absolute;
        right:0px;
        width:750px;
        top: 0px;
    }
</style>
<script>
    const { enable, WeexBridge, Image: GImage } = require('gcanvas.js');
    export default {
        data(){
            return {
                linkImg: {
                    bg: 'https://ss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=1036463264,495157344&fm=173&s=B5A17933145167DCDC1835CC0300A020&w=218&h=146&img.JPEG'
                },
            }
        },
		mounted: function () {
            let ref = this.$refs.canvas_holder;
            ref = enable(ref, {bridge: WeexBridge});
            let ctx = ref.getContext('2d');
			ctx.font="40px Arial";
			ctx.fillText("Hello World!@#$%^&*()_+-=",10,50)
        }
    }
</script>

Cant find RCTGCanvasView on android for react native bridge

Hi,

according to

import React, { Component, PropTypes } from 'react';
import { requireNativeComponent, View } from 'react-native';

var RCTGCanvasView = requireNativeComponent('RCTGCanvasView', GCanvasView);

export default class GCanvasView extends Component {
	static propTypes = {
		// isOffscreen: PropTypes.bool,
		...View.propTypes
	};

	render() {
		return ( <RCTGCanvasView {...this.props} /> );
	};
}

GCanvasView is the native component RCTGCanvasView however I cant find the android implementation, nor using REACT_CLASS either.

Working demo on Expo.io

Hi,

I have tried the demo on my snack expo without luck.

I have the following error:

Device: (1068:6932) Failed to install module 'react-native-gcanvas': Tried to register two views with the same name RCTGCanvasView

Any ideas?

无法在ReactNative下使用webgl

在集成GCanvas到ReactNative环境后,我发现使用webgl context连基本的clearColor和clear都无法工作,后来自己摸索了一会,发现bridge-reactnative.js里的flushNative和callNative实现是空的,我把bridge-weex.js里的代码挪过去后,就可以正常工作了。我想问GCanvas对于ReactNative下webgl的支持是尚未完成状态吗?

我的ReactNative项目依赖如下:

"dependencies": {
    "gcanvas.js": "0.0.8",
    "react": "16.2.0",
    "react-native": "0.52.0",
    "react-native-gcanvas": "0.0.7-dev"
  }

使用代码:

let gl = ref.getContext('webgl')
gl.clearColor(1.0, 1.0, 0.0, 1.0);
gl.enable(gl.DEPTH_TEST);
gl.depthFunc(gl.LEQUAL);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);

react native 闪退

这是运行的环境参数:
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.1
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.0 => 0.54.0

react-native-gcanvas : 0.01
gcanvas.js : 0.06

用的 link 方式 关联项目: react-native link react-native-gcanvas

然后试运行了官网给的例子,只要加上GCanvasView 就会闪退,或者目前项目只能运行在RN某个版本?还是有其他问题?

Gcanvas crash on iOS

	0 Metal 0x0000000184ccd828 _newFunctionWithGLIR + 60
	1 AppleMetalGLRenderer 0x00000001a272628c __ZN16GLRFunctionCache19newFunctionWithGLIREPU23objcproto12MTLDeviceSPI11objc_objectPvPU27objcproto16OS_dispatch_data8NSObject15MTLFunctionType + 80
	2 AppleMetalGLRenderer 0x00000001a2715278 __ZN21GLDPipelineProgramRec19createMetalFunctionEP13GLDProgramRecjj + 440
	3 AppleMetalGLRenderer 0x00000001a2715380 __ZN21GLDPipelineProgramRec6updateEP13GLDProgramRecjRPU22objcproto11MTLFunction11objc_object + 92
	4 AppleMetalGLRenderer 0x00000001a271426c __ZN13GLDContextRec18loadCurrentProgramEP13GLDProgramRecP21GLDPipelineProgramRecPjj + 64
	5 AppleMetalGLRenderer 0x00000001a2714408 __ZN13GLDContextRec27loadCurrentPipelineProgramsEPj + 272
	6 AppleMetalGLRenderer 0x00000001a2726a90 gldUpdateDispatch + 528
	7 GLEngine 0x00000001a34d8880 _gleDoDrawDispatchCoreES2 + 624
	8 GLEngine 0x00000001a34ac628 _glDrawArraysInstanced_STD_ES2Exec + 244
	9 Target 0x000000010346a478 __ZN14GCanvasContext21SendVertexBufferToGPUEj (GCanvas2dContext.cpp:891)
	10 Target 0x0000000102eeae24 __ZN7GCanvas7drawFBOEv (GCanvas2dContext.h:204)
	11 Target 0x0000000102eeafd4 __ZN7GCanvas6RenderEPKci (DynArray.h:63)
	12 Target 0x0000000102dbc874 -[GCanvasPlugin execCommands] (GCanvasPlugin.mm:117)
	13 Target 0x0000000102e5f3b0 __38-[WXGCanvasModule glkView:drawInRect:]_block_invoke (WXGCanvasModule.m:469)
	14 libdispatch.dylib 0x0000000182946a14 __dispatch_client_callout + 16
	15 libdispatch.dylib 0x00000001829550ac __dispatch_sync_invoke_and_complete_recurse + 64
	16 libdispatch.dylib 0x0000000182954ba8 __dispatch_sync_wait + 516
	17 Target 0x0000000102e5f0d0 -[WXGCanvasModule glkView:drawInRect:] (WXGCanvasModule.m:444)
	18 GLKit 0x000000018feab92c -[GLKView _display:] + 216
	19 QuartzCore 0x000000018700a8a4 -[CALayer display] + 188
	20 QuartzCore 0x0000000186f7c3d4 __ZN2CA7Context18commit_transactionEPNS_11TransactionE + 520
	21 QuartzCore 0x0000000186fa3b40 __ZN2CA11Transaction6commitEv + 540
	22 QuartzCore 0x0000000186fa4980 __ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
	23 CoreFoundation 0x0000000182f6ecdc ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
	24 CoreFoundation 0x0000000182f6c694 ___CFRunLoopDoObservers + 412
	25 CoreFoundation 0x0000000182f6cc50 ___CFRunLoopRun + 1292
	26 CoreFoundation 0x0000000182e8cc58 CFRunLoopRunSpecific + 428
	27 GraphicsServices 0x0000000184d38f84 GSEventRunModal + 96
	28 UIKit 0x000000018c5e55c4 UIApplicationMain + 232
	29 Target 0x00000001030ffd28 main (main.m:18)
	30 libdyld.dylib 0x00000001829ac56c _start + 4
	
	SEGV_ACCERR

Gcanvas与weex sdk 0.19版本不兼容

weex team is releasing a new version(0.19),it makes lots of changes and GCanvas can not work well with this version for now,for example,WXDomObject class was removed in android code.Is there a plan to release a new gcanvas version to fix that?

React Native: Android Sample don't work

node: v10.1.0
react-native-cli: 2.0.1
react-native: 0.55.4

按照文档接入的 Android Sample,运行之后显示

Error while updating property 'backgroundColor' of a view managed by: GCanvasView

null

TextureView doesn't support displaying a background drawable

Please check Gradle wrapper into git

I tried copying a Gradle wrapper from another project and GCanvas gets compiled until it reaches the react native bridge, where the build is abortet:

Execution failed for task ':bridges:react-native-bridge:react-native-gcanvas:android:lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

The problem occurs because I have a different version of Gradle than the one you're using. It was easily solved by adding the suggested fix, but It is "expected" that the Gradle wrapper is committed to version control, as per the docs:

To make the Wrapper files available to other developers and execution environments you’ll need to check them into version control. All Wrapper files including the JAR file are very small in size. Adding the JAR file to version control is expected. Some organizations do not allow projects to submit binary files to version control. At the moment there are no alternative options to the approach.

Feature request: measureText() Method for Grapics 2D context

Hello there.

I am developing an app for which the measureText() method of the 2D context is vital.
I need to know the width of any given string using the current font (including any newspaces \n) to make sure it fits in the canvas.
It would be awesome to have that implemented in GCanvas.

Are you already working on it and have an idea of when it could be available?
Otherwise, if you have no time I'd be happy to contribute and implement it (would need a small introduction tho).

Thank you.

Android 设置background-color:transparent不生效

grenderer.cpp::renderLoop里面,对background-color色,先clearScreen再设置clearColor,导致clearScreen使用默认的白色,设置的backgrounf-color:transparent样式无效。修改renderLoop方法中setClearColor和onSurfaceChange方法的调用时序可以解决。

Difficulties integrating on React Native

Hi there!

Congratulations for your effort. Can't wait to try this out.

I am developing a React Native app and followed the instructions to integrate GCanvas.

The steps were the following:
npm install react-native-gcanvas --save
nom install gcanvas.js --save
react-native link react-native-gcanvas

When I

react-native run-ios

or

react-native run-android

.. I get build errors:

In the case of iOS:

CanvasView.h:12:9: fatal error: 'GCanvas/GCanvasViewProtocol.h' file not found

In Android:

Extension with name 'sdks' does not exist. Currently registered extension names: [ext]

What are the pre-conditions to make it work?

I used to have Gradle plugin 2.2.1 and moved to 3.0.1, but still same issue.

Thanks a lot for your feedback!
Best,

OS: macOS High Sierra 10.13.2
Node: 6.11.1
npm: 3.10.10
Watchman: 4.7.0

react-native-cli: 2.0.1
react-native: 0.54.1

react-native-gcanvas : 0.01
gcanvas.js : ^0.05

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.