Files
ChiaNing af2b9e9ed9 fix(2d): apply cascaded opacity to retained Graphics draws (#421)
* fix(2d): apply cascaded opacity to retained Graphics draws

Use the per-instance Graphics effect on Web and Native so a parent fade scales the original fill and stroke alpha at draw time. Rebind retained geometry when its material changes and synchronize Graphics color on enable or assignment. Covers the Graphics behavior reported in #14868 and #17917.

* fix(2d): apply Graphics cascade opacity to CPU vertex colors

* fix(2d): preserve wide strokes and reuse Graphics opacity buffers

Reserve stroke vertices using the emitted caps and joins and split at independent subpath boundaries. Reuse Web upload storage across immediate redraws and use the shared draw-info dirty bit to synchronize only changed Native geometry blocks. Release empty caches on the subsequent renderer update or disable.

* fix(2d): handle passless Graphics materials and release empty paint buffers

* fix(2d): scope Graphics opacity updates and trim unused buffers

* fix(2d): limit the Graphics change to cascaded opacity

* fix(2d): preserve Graphics.color behavior during parent opacity fades

* fix(2d): use emitted Graphics counts for native opacity uploads
2026-11-18 18:30:48 +08:00
..
2026-11-12 09:48:55 +08:00
2022-05-04 13:09:24 +08:00
2022-12-07 14:40:39 +08:00
2022-04-18 10:24:54 +08:00
2021-01-14 14:36:37 +08:00

cocos-engine native part

It is the native backend of Cocos Creator. It works on iOS, Android, macOS and Windows.

Coding format and coding style

The coding format file is .clang-format, and the coding style format file is .clang-tidy. Please use clang-format to format the codes and use clang-tidy to fix the coding style before committing codes. See the linter auto-fix guide for more information.

Build Requirements

  • Xcode 11.5+ to build mac games
  • or Visual Studio 2017 15.7+ / Visual Studio 2019 to build win64 games
  • NDK 21-22 is required to build Android games (23+ is not supported)
  • Cmake 3.8+ is required

System Requirements

  • macOS 10.14+
  • iOS 11.0+
  • iOS Simulator 13.0+
  • 64-bit Windows 7+
    • with vulkan 1.0 to 1.2 if want to run with vulkan
  • Android 4.4+
    • Android 7+ if want to run with vulkan

Use C++17.

These C++17 features are tested and supported by all platforms

The following features are not supported

  • std::optional is not supported by iOS 11.

Other C++17 features are not tested.