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 48979fe commit 230fab0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
34 changes: 9 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34152,9 +34152,9 @@

var top = node;
var x1 = node.__x1,
y1 = node.__y1,
__cache = node.__cache,
__offsetWidth = node.__offsetWidth,
y1 = node.__y1;
node.__cache;
var __offsetWidth = node.__offsetWidth,
__offsetHeight = node.__offsetHeight;
var bboxTotal = genBboxTotal(node, __structs, index, total, lv, isPpt);

Expand Down Expand Up @@ -34225,23 +34225,7 @@
gl.viewport(0, 0, w, h); // fbo绘制对象纹理不用绑定单元,剩下的纹理绘制用0号

var lastPage,
list = []; // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1,注意被拆分时不绘制

if (!oitHash || !oitHash[index]) {
if (__cache && __cache.available) {
drawTextureCache(gl, [{
cache: __cache,
opacity: 1
}], cx, cy, dx, dy);
}

var render = node.render;

if (render !== DOM_RENDER && render !== IMG_RENDER && render !== GEOM_RENDER) {
node.render(renderMode, gl, dx, dy);
}
}

list = [];
var cacheTotal = __cacheTotal;

for (var i = index, len = index + (total || 0) + 1; i < len; i++) {
Expand Down Expand Up @@ -34387,16 +34371,16 @@
}
}

webgl.drawOitPlane(gl, __structs, _oit, ppt, cx, cy, dx, dy);
i += _total6 || 0;

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

webgl.drawOitPlane(gl, __structs, _oit, ppt, cx, cy, dx, dy);
var _render = _node4.render;
var render = _node4.render;

if (_render !== DOM_RENDER && _render !== IMG_RENDER && _render !== GEOM_RENDER) {
if (render !== DOM_RENDER && render !== IMG_RENDER && render !== GEOM_RENDER) {
_node4.render(renderMode, gl, dx, dy);
}
} else {
Expand Down Expand Up @@ -34456,9 +34440,9 @@


if (!_target4 || _target4 === _cache2) {
var _render2 = _node4.render;
var _render = _node4.render;

if (_render2 !== DOM_RENDER && _render2 !== IMG_RENDER && _render2 !== GEOM_RENDER) {
if (_render !== DOM_RENDER && _render !== IMG_RENDER && _render !== GEOM_RENDER) {
drawTextureCache(gl, list.splice(0), cx, cy, dx, dy);

_node4.render(renderMode, gl, dx, dy);
Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions src/refresh/struct.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,8 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota
if(__cacheTotal && __cacheTotal.available) {
return __cacheTotal;
}
let top = node;

let top = node;
let { __x1: x1, __y1: y1, __cache, __offsetWidth, __offsetHeight } = node;
let bboxTotal = genBboxTotal(node, __structs, index, total, lv, isPpt);
if(!bboxTotal) {
Expand Down Expand Up @@ -829,17 +829,6 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota

// fbo绘制对象纹理不用绑定单元,剩下的纹理绘制用0号
let lastPage, list = [];
// 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1,注意被拆分时不绘制
if(!oitHash || !oitHash[index]) {
if(__cache && __cache.available) {
drawTextureCache(gl, [{cache: __cache, opacity: 1}], cx, cy, dx, dy);
}
let render = node.render;
if(render !== DOM_RENDER && render !== IMG_RENDER && render !== GEOM_RENDER) {
node.render(renderMode, gl, dx, dy);
}
}

let cacheTotal = __cacheTotal;
for(let i = index, len = index + (total || 0) + 1; i < len; i++) {
let {
Expand Down Expand Up @@ -962,11 +951,11 @@ function genTotalWebgl(renderMode, __cacheTotal, gl, root, node, index, lv, tota
}
}
}
webgl.drawOitPlane(gl, __structs, oit, ppt, cx, cy, dx, dy);
i += (total || 0);
if(hasMask) {
i += countMaskNum(__structs, i + 1, hasMask);
}
webgl.drawOitPlane(gl, __structs, oit, ppt, cx, cy, dx, dy);
let render = node.render;
if(render !== DOM_RENDER && render !== IMG_RENDER && render !== GEOM_RENDER) {
node.render(renderMode, gl, dx, dy);
Expand Down

0 comments on commit 230fab0

Please sign in to comment.