summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_canvas_gles2.cpp
AgeCommit message (Collapse)Author
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-26Effective DisplayServer separation, rename X11 -> LinuxBSDJuan Linietsky
2020-02-11A lot of progress with canvas rendering, still far from working.Juan Linietsky
2020-02-11Refactored RID/RID_Owner to always use O(1) allocation.Juan Linietsky
* Implements a growing chunked allocator * Removed redudant methods get and getptr, only getornull is supported now.
2020-01-08RasterizerCanvas: Use getornull to fetch light occluder polygonRémi Verschelde
Fixes #21286 when the occluder is not fully configured.
2020-01-03Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fixRémi Verschelde
Fixed antialiasing option for Polygon2D with concave/hollow shapes
2020-01-01Fixed antialiasing option for Polygon2DPouleyKetchoupp
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases. Fixes #34568
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-11Flip cull mode when rendering flipped Light2D and LightOccluder2DBojidar Marinov
Fixes #32993
2019-11-28Fixed antialiased option for Polygon2D / Line2DPouleyKetchoupp
Polygon2D: The property wasn't used anymore after switching from canvas_item_add_polygon() to canvas_item_add_triangle_array() for drawing. Line2D: Added the same property as for Polygon2D & fixed smooth line drawing to use indices correctly. Fixes #26823
2019-11-20Merge pull request #33583 from qarmin/fix_overflows_unitializedRémi Verschelde
Fix some overflows and unitialized variables
2019-11-20Fix some overflows and unitialized variablesRafał Mikrut
2019-11-11Improve glBufferSubData usage where safeclayjohn
2019-11-07Partial revert of #32657, undoing line shifting by 0.5Rémi Verschelde
As discussed in #32657, this can't be done here as lines can be used with a canvas scale, and this breaks them. A suggestion is to do the pixel shifting at matrix level instead. Fixes #33393. Fixes #33421.
2019-10-26Merge pull request #32657 from ptrojahn/linesRémi Verschelde
Fix draw_rect
2019-10-11Fix draw_rectPaul Trojahn
OpenGL uses the diamond exit rule to rasterize lines. If we don't shift the points down and to the right by 0.5, the line can sometimes miss a pixel when it shouldn't. The final fragment of a line isn't drawn. By drawing the lines clockwise, we can avoid a missing pixel in the rectangle. See section 3.4.1 in the OpenGL 1.5 specification. Fixes #32279
2019-09-17GLES2 Fixes for ninepatch margins when patch size is smaller than the patch ↵Valentin Zagura
texture resolution.. Scaled ninepatch margins in screen space to be relative of the ninepatch size when the patch size is smaller than the patch texture resolution.
2019-08-17Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily
Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
2019-08-10fix gles2 canvas shader uniform error,close #31201RaphaelHunter
2019-07-12Implement CanvasItem line antialiasing in GLES2Hugo Locurcio
This is a straight copy-paste of the code from `drivers/gles3/rasterizer_canvas_gles3.cpp`. It is subject to the same restrictions as the GLES3 implementation: it only works on desktop platforms as they use OpenGL instead of OpenGL ES.
2019-06-03added MultiMeshInstance2D node for using MultiMesh in 2Dclayjohn
2019-05-13Implement ability to render viewports directly to screenclayjohn
2019-04-09Style: Apply new changes from clang-format 8.0Rémi Verschelde
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
2019-04-02Enable warnings=extra on clang and GCC testers.marxin
And remove 2 warnings from warnings=extra.
2019-03-03Properly redraw if something animated is visibleJuan Linietsky
2019-03-01Fix non initialized variable.Juan Linietsky
2019-02-27Fix -Wsign-compare warnings.marxin
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
2019-02-25Several fixes to make GLES2 on HTML5 work much better.Juan Linietsky
Changed math class error reporting to be a bit less paranoid.
2019-02-24Many separate fixes to ensure non power of 2 textures work on GLES2, closes ↵Juan Linietsky
#25897 and many others
2019-02-22-Support DEPTH_TEXTURE in GLES2, fixes #25106Juan Linietsky
-Fix use of transparent framebuffers in GLES2 -Fix use of ambient color clearing in GLES2 when no environment exists.
2019-02-21Make alpha 1.0 when using texscreen, fixes #25850Juan Linietsky
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-12Fix infinite recursion in GLES2 _copy_texscreenRémi Verschelde
Bug introduced in 9430e68cf3013aaa0673a4dfff844324a9c1274a, likely a typo.
2019-02-12Support SCREEN_TEXTURE in GLES2, fixes #25405Juan Linietsky
2019-02-12Use UVs with the nvidia rendering hack, fixes #24563Juan Linietsky
2019-02-12Missing canvas end left mask turned on, fixes #25666Juan Linietsky
2019-01-27Use transparent framebuffer only when set to transparent, closes #21827Juan Linietsky
2019-01-24Makes screen texture work in GLES2 (2D for now), fixes #23604Juan Linietsky
2019-01-18Use 16 bit indices on phones that dont support 32, fixes #19797Juan Linietsky
2019-01-17Fixes to 2D lights, closes #24750Juan Linietsky
2019-01-16Ensure texture hints are obeyed, fixes #24875Juan Linietsky
2019-01-15GLES2: Fix typo in project settingRémi Verschelde
It used a different name than the equivalent GLES3 parameter.
2019-01-14Implement black margins in GLES2, which was missing, fixes #24556Juan Linietsky
2019-01-14GLES2: Make Nvidia flicker workaround opt-inRémi Verschelde
It has a big impact on 2D and text rendering performance (cf. #24466) so the solution seems worse than the bug it aims to work around. It's now opt-in via "rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround" for those who need it and have a simple enough game for the performance drop not to be an issue. Fixes #24466.
2019-01-14Was not properly re-setting light uniforms, fixes #24976Juan Linietsky
2019-01-14Do not use the workaround for desktop nvidia on mobile and html5.Juan Linietsky
2019-01-06Change blend equation for canvasitemsDaeil Kim