deprecate ENABLE_WEBGL_ANTIALIAS (#9626)

* deprecate ENABLE_WEBGL_ANTIALIAS

update

* remove deprecation usage
This commit is contained in:
PP
2021-11-05 10:40:51 +08:00
committed by GitHub
parent fbdc0ef287
commit 5ffc4482cd
4 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+13 -2
View File
@@ -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', [
+2
View File
@@ -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,