Skip to content

Commit

Permalink
fix: 局部根节点细节处理 #251
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Nov 2, 2022
1 parent 0b9feea commit 8053aad
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34254,14 +34254,16 @@
else {
var __computedStyle = _node4.__computedStyle;

if (__computedStyle[DISPLAY$1] === 'none' || _node4.__mask) {
i += _total6 || 0;
if (i > index) {
if (__computedStyle[DISPLAY$1] === 'none' || _node4.__mask) {
i += _total6 || 0;

if (hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
}
if (hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
}

continue;
continue;
}
}

var visibility = __computedStyle[VISIBILITY$1],
Expand Down Expand Up @@ -34383,11 +34385,11 @@
_cacheFilter2 = _node4.__cacheFilter,
_cacheMask2 = _node4.__cacheMask;

var _target4 = getCache([_cacheMask2, _cacheFilter2, _cacheTotal3, _cache2]);
var _target4 = i > index ? getCache([_cacheMask2, _cacheFilter2, _cacheTotal3, _cache2]) : _cache2;

if (_target4) {
// 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成
if (mixBlendMode !== 'normal') {
if (i > index && mixBlendMode !== 'normal') {
if (list.length) {
drawTextureCache(gl, list.splice(0), cx, cy, dx, dy);
}
Expand Down Expand Up @@ -34423,7 +34425,7 @@
});
}

if (_target4 !== _cache2 && i > index) {
if (_target4 !== _cache2) {
i += _total6 || 0;

if (hasMask) {
Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions src/refresh/struct.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,12 +866,14 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota
// 再看total缓存/cache,都没有的是无内容的Xom节点
else {
let __computedStyle = node.__computedStyle;
if(__computedStyle[DISPLAY] === 'none' || node.__mask) {
i += (total || 0);
if(hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
if(i > index) {
if(__computedStyle[DISPLAY] === 'none' || node.__mask) {
i += (total || 0);
if(hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
}
continue;
}
continue;
}
let {
[VISIBILITY]: visibility,
Expand Down Expand Up @@ -977,10 +979,10 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota
__cacheFilter,
__cacheMask,
} = node;
let target = getCache([__cacheMask, __cacheFilter, __cacheTotal, __cache]);
let target = i > index ? getCache([__cacheMask, __cacheFilter, __cacheTotal, __cache]) : __cache;
if(target) {
// 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成
if(mixBlendMode !== 'normal') {
if(i > index && mixBlendMode !== 'normal') {
if(list.length) {
drawTextureCache(gl, list.splice(0), cx, cy, dx, dy);
}
Expand All @@ -1007,7 +1009,7 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota
lastPage = p;
list.push({cache: target, opacity: node.__opacity, matrix: m});
}
if(target !== __cache && i > index) {
if(target !== __cache) {
i += (total || 0);
if(hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
Expand Down
1 change: 1 addition & 0 deletions test/group4/webgl-custom/script.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ void main() {
gl.drawArrays(gl.TRIANGLES, 0, 6);
gl.deleteBuffer(pointBuffer);
gl.disableVertexAttribArray(a_position);
gl.useProgram(gl.program);
}
return res;
}
Expand Down

0 comments on commit 8053aad

Please sign in to comment.