@@ -371,7 +371,7 @@ function renderWebglTile(
371
371
}
372
372
// 这里只做计算画板的rect,和noTile不太一样,其它计算在后面步骤
373
373
if ( isInScreen ) {
374
- if ( node . isArtBoard && node instanceof ArtBoard ) {
374
+ if ( node instanceof ArtBoard ) {
375
375
if ( total + next ) {
376
376
const bbox = node . _bbox || node . bbox ;
377
377
const ab = calRectPoints ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] , matrix ) ;
@@ -395,7 +395,7 @@ function renderWebglTile(
395
395
}
396
396
}
397
397
}
398
- else if ( node . isArtBoard && node instanceof ArtBoard ) {
398
+ else if ( node instanceof ArtBoard ) {
399
399
resetTileClip ( tileList ) ;
400
400
abRect [ 0 ] = 0 ;
401
401
abRect [ 1 ] = 0 ;
@@ -404,8 +404,8 @@ function renderWebglTile(
404
404
continue ;
405
405
}
406
406
// 和普通渲染比没有画布索引部分,仅图片检查内容加载计数器
407
- if ( isInScreen && node . isBitmap && ( node as Bitmap ) . checkLoader ( ) ) {
408
- imgLoadList . push ( node as Bitmap ) ;
407
+ if ( isInScreen && node instanceof Bitmap && node . checkLoader ( ) ) {
408
+ imgLoadList . push ( node ) ;
409
409
}
410
410
// 真正的渲染部分,比普通渲染多出的逻辑是遍历tile并且检查是否在tile中,排除非页面元素
411
411
if ( isInScreen ) {
@@ -449,7 +449,7 @@ function renderWebglTile(
449
449
t4 : { x : number , y : number } ,
450
450
} [ ] = [ ] ;
451
451
let ab : { x1 : number , y1 : number , x2 : number , y2 : number , x3 : number , y3 : number , x4 : number , y4 : number } ;
452
- const isArtBoard = node . isArtBoard && node instanceof ArtBoard ;
452
+ const isArtBoard = node instanceof ArtBoard ;
453
453
if ( isArtBoard ) {
454
454
const bbox = node . _bbox || node . bbox ;
455
455
ab = calRectPoints ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] , m ) ;
@@ -833,7 +833,7 @@ function renderWebglNoTile(
833
833
const programs = root . programs ;
834
834
// 初始化工作
835
835
let pageTexture = root . pageTexture || createTexture ( gl , 0 , undefined , W , H ) ;
836
- let artBoardTexture : WebGLTexture | undefined ; // 画布的背景色单独渲染,会干扰mbm的透明判断
836
+ // let artBoardTexture: WebGLTexture | undefined; // 画布的背景色单独渲染,会干扰mbm的透明判断
837
837
let resTexture = pageTexture ;
838
838
let resFrameBuffer = genFrameBufferWithTexture ( gl , resTexture , W , H ) ;
839
839
gl . clearColor ( 0 , 0 , 0 , 0 ) ;
@@ -985,13 +985,13 @@ function renderWebglNoTile(
985
985
h : H ,
986
986
t : resTexture ,
987
987
} ) ;
988
- const isPageTex = resTexture === pageTexture ;
988
+ // const isPageTex = resTexture === pageTexture;
989
989
genBgBlur ( gl , root , wrap , matrix , outline , blur , programs , scale , W , H ) ;
990
990
// blur过程会销毁掉原本的bg纹理,赋值要特别注意原本的page纹理
991
991
resTexture = wrap . list [ 0 ] . t ! ;
992
- if ( isPageTex ) {
993
- pageTexture = resTexture ;
994
- }
992
+ // if (isPageTex) {
993
+ // pageTexture = resTexture;
994
+ // }
995
995
gl . bindFramebuffer ( gl . FRAMEBUFFER , resFrameBuffer ) ;
996
996
gl . viewport ( 0 , 0 , W , H ) ;
997
997
gl . framebufferTexture2D (
@@ -1145,40 +1145,40 @@ export function calWorldMatrixAndOpacity(node: Node, i: number, parent?: Contain
1145
1145
}
1146
1146
}
1147
1147
1148
- function drawArtBoard2Page (
1149
- gl : WebGLRenderingContext | WebGL2RenderingContext ,
1150
- program : WebGLProgram ,
1151
- cx : number , cy : number , W : number , H : number ,
1152
- pageTexture : WebGLTexture ,
1153
- artBoardTexture : WebGLTexture ,
1154
- ) {
1155
- gl . framebufferTexture2D (
1156
- gl . FRAMEBUFFER ,
1157
- gl . COLOR_ATTACHMENT0 ,
1158
- gl . TEXTURE_2D ,
1159
- pageTexture ,
1160
- 0 ,
1161
- ) ;
1162
- drawTextureCache (
1163
- gl ,
1164
- cx ,
1165
- cy ,
1166
- program ,
1167
- [
1168
- {
1169
- opacity : 1 ,
1170
- bbox : new Float64Array ( [ 0 , 0 , W , H ] ) ,
1171
- texture : artBoardTexture ,
1172
- } ,
1173
- ] ,
1174
- 0 ,
1175
- 0 ,
1176
- false ,
1177
- - 1 , - 1 , 1 , 1 ,
1178
- ) ;
1179
- gl . deleteTexture ( artBoardTexture ) ;
1180
- return pageTexture ;
1181
- }
1148
+ // function drawArtBoard2Page(
1149
+ // gl: WebGLRenderingContext | WebGL2RenderingContext,
1150
+ // program: WebGLProgram,
1151
+ // cx: number, cy: number, W: number, H: number,
1152
+ // pageTexture: WebGLTexture,
1153
+ // artBoardTexture: WebGLTexture,
1154
+ // ) {
1155
+ // gl.framebufferTexture2D(
1156
+ // gl.FRAMEBUFFER,
1157
+ // gl.COLOR_ATTACHMENT0,
1158
+ // gl.TEXTURE_2D,
1159
+ // pageTexture,
1160
+ // 0,
1161
+ // );
1162
+ // drawTextureCache(
1163
+ // gl,
1164
+ // cx,
1165
+ // cy,
1166
+ // program,
1167
+ // [
1168
+ // {
1169
+ // opacity: 1,
1170
+ // bbox: new Float64Array([0, 0, W, H]),
1171
+ // texture: artBoardTexture,
1172
+ // },
1173
+ // ],
1174
+ // 0,
1175
+ // 0,
1176
+ // false,
1177
+ // -1, -1, 1, 1,
1178
+ // );
1179
+ // gl.deleteTexture(artBoardTexture);
1180
+ // return pageTexture;
1181
+ // }
1182
1182
1183
1183
function renderOverlay (
1184
1184
gl : WebGLRenderingContext | WebGL2RenderingContext ,
0 commit comments