mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
deprecate ENABLE_WEBGL_ANTIALIAS (#9626)
* deprecate ENABLE_WEBGL_ANTIALIAS update * remove deprecation usage
This commit is contained in:
@@ -204,7 +204,7 @@ export class WebGLSwapchain extends Swapchain {
|
||||
try {
|
||||
const webGLCtxAttribs: WebGLContextAttributes = {
|
||||
alpha: macro.ENABLE_TRANSPARENT_CANVAS,
|
||||
antialias: EDITOR || macro.ENABLE_WEBGL_ANTIALIAS,
|
||||
antialias: EDITOR || macro.ENABLE_ANTIALIAS_FXAA,
|
||||
depth: true,
|
||||
stencil: true,
|
||||
premultipliedAlpha: false,
|
||||
|
||||
@@ -131,7 +131,7 @@ export class WebGL2Swapchain extends Swapchain {
|
||||
try {
|
||||
const webGLCtxAttribs: WebGLContextAttributes = {
|
||||
alpha: macro.ENABLE_TRANSPARENT_CANVAS,
|
||||
antialias: EDITOR || macro.ENABLE_WEBGL_ANTIALIAS,
|
||||
antialias: EDITOR || macro.ENABLE_ANTIALIAS_FXAA,
|
||||
depth: true,
|
||||
stencil: true,
|
||||
premultipliedAlpha: false,
|
||||
|
||||
@@ -23,13 +23,24 @@
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { screenAdapter } from 'pal/screen-adapter';
|
||||
import { markAsWarning, removeProperty, replaceProperty } from '../utils';
|
||||
import { sys } from './sys';
|
||||
import { View } from './view';
|
||||
import { legacyCC } from '../global-exports';
|
||||
import { screen } from './screen';
|
||||
import { Size } from '../math';
|
||||
import { macro } from './macro';
|
||||
|
||||
replaceProperty(macro, 'macro', [{
|
||||
name: 'ENABLE_WEBGL_ANTIALIAS',
|
||||
newName: 'ENABLE_ANTIALIAS_FXAA',
|
||||
suggest: 'macro.ENABLE_WEBGL_ANTIALIAS is now a readonly macro.',
|
||||
customGetter () {
|
||||
return macro.ENABLE_ANTIALIAS_FXAA;
|
||||
},
|
||||
customSetter (v: boolean) {
|
||||
// DO NOTHING
|
||||
},
|
||||
}]);
|
||||
|
||||
// #region deprecation on view
|
||||
removeProperty(View.prototype, 'View.prototype', [
|
||||
|
||||
@@ -997,6 +997,8 @@ const macro = {
|
||||
* 你可以在 {{game.init}} 之前设置这个值,否则它不会生效。
|
||||
* 仅影响 WebGL 后端
|
||||
* @default true
|
||||
*
|
||||
* @deprecated since 3.4.0, please use macro.ENABLE_ANTIALIAS_FXAA instead.
|
||||
*/
|
||||
ENABLE_WEBGL_ANTIALIAS: true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user