Commit Graph

889 Commits

Author SHA1 Message Date
James Chen ee5faac763 Move logic of flipY and premultiplyAlpha from jsb_opengl_manual.cpp to CCGLUtils.cpp. (#1249)
* Native Renderer supports GL_UNPACK_FLIP_Y_WEBGL & GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL.
And adds ccFlipYOrPremultiptyAlphaIfNeeded, ccIsUnpackFlipY, ccIsPremultiplyAlpha, ccPixelStorei GL utils.

* seval_to_TextureSubImageOption: uint16_t* -> uint32_t* since width * height * 4 may bigger than 65536 bytes.

* Move logic of flipY and premultiplyAlpha from jsb_opengl_manual.cpp to CCGLUtils.cpp.

* Reverts.
2018-05-18 15:53:28 +08:00
minggo 8a76997242 adapt mac resolution (#1248) 2018-05-18 11:57:12 +08:00
minggo 7a2a9374ec Technique support setting COLOR4 and COLOR3 (#1246) 2018-05-17 16:15:51 +08:00
minggo 4a13d0e15e Downsample (#1245)
* support render texture

* use texture unit 0

* add functions to set device pixel ratio

* add ccDeleteBuffers again

* fix according comments
2018-05-17 14:05:05 +08:00
James Chen 07cc734c8c setAnimationInterval -> setPreferredFramesPerSecond and binds setPreferredFramesPerSeconds. (#1244)
* setAnimationInterval -> setPreferredFramesPerSecond.

* Binds setPreferredFramesPerSeconds.

* typo fix in CCApplication-win32.cpp
2018-05-16 18:06:26 +08:00
James Chen 357d87d8bc WebGLObject inherits from cocos2d::Ref. autorelease it instead of deleting it to avoid to use invalid WebGL objects. (#1243) 2018-05-16 10:18:58 +08:00
James Chen 2e174ff1c2 Supports dispatching custom event for EventDispatcher. (#1240)
* Adds __jsbInvocationCount for SpiderMonkey.

* Supports dispatching custom event for EventDispatcher.
2018-05-14 17:19:03 +08:00
James Chen 6ff58a79df FlipPixelsY logic fix. (#1239) 2018-05-11 21:42:43 +08:00
James Chen 727a4911d4 [runtime] Adds jsb.openURL, __getOSVersion, __getCurrentLanguage interfaces. (#1238) 2018-05-11 16:03:17 +08:00
minggo 9ca6dac357 fix musk issue (#1231) 2018-05-08 11:21:41 +08:00
minggo 12676d6f2b put debug related files into debugger folder 2018-04-28 14:37:09 +08:00
James Chen 15656be8d6 Removes unused js glue code. (#1221) 2018-04-27 13:45:30 +08:00
James Chen 57f8268e14 Display whether GL Opt mode is enabled! (#1216) 2018-04-26 16:46:40 +08:00
James Chen ae5c569345 Adds jsb.openDebugView interface, supports to display JSB invocation count. (#1214)
* Adds jsb.openDebugView interface, supports to display JSB invocation count.

* Removes unused log in JniImp.cpp.

* Removes unused log in Cocos2dxRenderer.java
2018-04-26 15:59:20 +08:00
minggo 87a4301d8f unify js_loadImage (#1210)
* fix Texture2D::addSubImage()

* unify the logic of js_loadImage

* simplify codes
2018-04-24 16:27:03 +08:00
James Chen 4d9d82ecee fix memory issue in jsb.loadImage. (#1206) 2018-04-20 19:32:13 +08:00
minggo 6fd4846eea Optimize (#1205)
* fix some bugs

* fix binding codes of Texture2D::updateSubImage()

* optimize memory usage
2018-04-20 19:25:23 +08:00
James Chen ad94db2c71 Binds getFramebufferAttachmentParameter and fix memory issues in uniform[1234]v. (#1204)
* Binds getFramebufferAttachmentParameter and fix memory issues in uniform[1234]v.

* FPS uses integer.

* revert.

* Removes unused import package.
2018-04-20 17:25:10 +08:00
James Chen f944be8574 Adds DebugView support. (#1203) 2018-04-20 14:53:16 +08:00
minggo d98484654f Optimize (#1202)
* fix some bugs

* fix binding codes of Texture2D::updateSubImage()
2018-04-20 14:31:52 +08:00
James Chen a1321302b4 Rename __gl to __ccgl to avoid conflict. Memory issue fixes in JSB_glGetProgramInfoLog and JSB_glGetShaderInfoLog (#1201)
* Revert "Removes FPS display code in Cocos2dxRenderer.java."

This reverts commit 71984ef41c.

* Rename __gl to __ccgl to avoid conflict.

* memory issue fixes in JSB_glGetProgramInfoLog and JSB_glGetShaderInfoLog

* Adds FIXME for FPS display in Cocos2dxRenderer.java.
2018-04-20 10:35:33 +08:00
James Chen a6c1a1301f Removes glClear fixme. 2018-04-19 13:47:16 +08:00
James Chen 1fa4ea0e6f Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/renderer/gfx/IndexBuffer.cpp
#	cocos/renderer/gfx/VertexBuffer.cpp
2018-04-19 11:23:36 +08:00
minggo 0505ee928a Optimize (#1199)
* optimize performace

* optimize performance
2018-04-18 17:47:46 +08:00
James Chen 207605bbff Bind getVertexAttrib & getVertexAttribOffset 2018-04-17 23:10:25 +08:00
James Chen 8294fd9776 tex[Sub]Image2D supports passing nullptr as data. 2018-04-16 15:56:41 +08:00
James Chen fde80e75b2 flushCommands -> _flushCommands 2018-04-14 21:16:51 +08:00
James Chen c1a0786234 remove unused comments, register gl functions inside __gl variable. 2018-04-14 20:53:00 +08:00
James Chen 58310293f2 more cache fix. 2018-04-14 15:59:18 +08:00
James Chen fb0eb1bd48 ENABLE GL STATE CACHE by default. Uses JSB_GL_CHECK_VOID in glFlushCommand 2018-04-14 15:15:42 +08:00
James Chen 3dfe05f4cc glBindXXX glActiveTexture cache. 2018-04-14 13:43:44 +08:00
James Chen 746dc35354 Uses custom framebufferRenderbuffer, renderbufferStorage. 2018-04-13 14:25:54 +08:00
minggo 4e43879c52 improve performance of binding codes of VertexBuffer::setFormat() (#1193) 2018-04-13 14:24:32 +08:00
minggo 59d24e1fdc fix memory leaks (#1192) 2018-04-12 16:07:21 +08:00
James Chen 22c9dd2b5a FPS output., file:// scheme check. glTexSubImage2D binding fix. 2018-04-12 14:57:34 +08:00
minggo 3113af6176 optimize performance (#1191) 2018-04-12 11:44:11 +08:00
minggo ba8944c72a Optimize (#1190)
* h5 adapt

* don't bind Technique, Effect, Pass and Model
2018-04-11 11:32:33 +08:00
James Chen f9f1228e51 bindFramebuffer fix. 2018-04-10 19:05:06 +08:00
James Chen 508f7aabdd Adds gl optimaization support. 2018-04-10 17:39:57 +08:00
James Chen 29ac7a11a4 Reverts glViewPoint binding. 2018-04-09 13:57:42 +08:00
James Chen 912eb6bf33 setCanvasBufferUpdateCallback should be private method. 2018-04-09 13:57:06 +08:00
James Chen a750c0ec4c More standard WebGL Binding.
WebGLRenderingContext, WebGLTexture, WebGLBuffer, WebGLRenderBuffer, WebGLFramebuffer, WebGLProgram, WebGLShader.
2018-04-08 21:32:43 +08:00
Joseph Pan 036c13ea94 Fix local reference table overflow error problem. (#1178)
* Fix local reference table error problem.

* Modify the patch according to review comment.

* Fix a variable name.
2018-04-04 18:06:06 +08:00
James Chen ed017b2e01 Merge branch 'runtime' into new-renderer
# Conflicts:
#	cocos/renderer/gfx/Texture2D.cpp
2018-04-03 21:04:15 +08:00
James Chen 016553cdf3 [mac] Shader version should be at least 120 to fix "GLSL 110 does not allow sub- or super-matrix constructors" issue. (#1179)
* Don't use regex match for getting base64 string. Uses string pointer offset instead.

* [mac] Shader version should be at least 120 to fix "GLSL 110 does not allow sub- or super-matrix constructors" issue.

* bug fix of shaderSource.find("#version", ...);
2018-04-03 10:09:13 +08:00
minggo 2ba3e815d2 h5 adapt (#1176) 2018-03-30 17:57:38 +08:00
James Chen 8dc0f35714 [ios] Fixes bugs about multisampling and GL_DEPTCH_STENCIL_ATTACHMENT (#1175)
* [ios] Fixes bugs about multisampling.

* [ios] Should use opengl es2

* Fixes compilation issues in DeviceGraphics after switching back to opengles2.

* glFramebufferRenderbuffer GL_DEPTH_STENCIL_ATTACHMENT fix in webgl binding.

* Comment some code of invoking opengles3.0 methods in gfx/Texture2D.cpp.
2018-03-30 17:44:08 +08:00
James Chen d92ab3cbe7 touch event should also pass pageX, pageY. jsb.loadImage supports data base64 string. (#1174)
* touch event should also pass pageX, pageY.

* jsb.loadImage supports data base64 string.
2018-03-30 07:41:59 +08:00
minggo f4e3f9e8f6 adapt h5 (#1170) 2018-03-28 09:47:05 +08:00
James Chen deda8af50a premultiply alpha works. (#1169)
* premultiply alpha works.

* GL_UNPACK_COLORSPACE_CONVERSION_WEBGL isn't supported.
2018-03-27 15:38:47 +08:00