Dplug icon indicating copy to clipboard operation
Dplug copied to clipboard

After a single resize, PBR plugin composite twice.

Open p0nce opened this issue 2 years ago • 1 comments

Resize of PBR plugins could be speed up by 30% if this wasn't the case. And this is probably the very same computation (EDIT: no, it is something nonsensical), and/or the former computation is thrown away completely.

image

p0nce avatar Dec 19 '22 15:12 p0nce

  • [ ] ( out of topic : black borders being a bit on the expensive size? 100 us. Or maybe it's the copy.)

Here is a log of the issue: The questions is: why is there a first onDraw, if there is another onDraw just after.

// LOG of debug = resizing;
// 1. first draw
new _userArea is rectangle(0, 0, 620, 330)
  * provoke full redraw
<doResize(620, 330)
>doDraw
  * this will redraw PBR rectangle(0, 0, 620, 330)
  * this will redraw RAW rectangle(590, 300, 30, 30)
  * redrawing black borders, and copy item    // SUSPICIOUS, is it what is taking: 100 us for a single widget redraw? (redraw of resizer canvas is just 55us)
<doDraw

// 2. some very small doDraw operations because of the resizer widget
// can be ignored
getDirtyRectangle returned rectangle(590, 300, 30, 30)
>doDraw
  * this will redraw RAW rectangle(590, 300, 30, 30)
<doDraw
getDirtyRectangle returned rectangle(590, 300, 30, 30)
>doDraw
  * this will redraw RAW rectangle(590, 300, 30, 30)
<doDraw
getDirtyRectangle returned rectangle(590, 300, 30, 30)
>doDraw
  * this will redraw RAW rectangle(590, 300, 30, 30)
<doDraw
getDirtyRectangle returned rectangle(590, 300, 30, 30)
>doDraw
  * this will redraw RAW rectangle(590, 300, 30, 30)
<doDraw
>doResize(775, 413)
new _userArea is rectangle(0, 0, 775, 413)
  * provoke full redraw
<doResize(775, 413)

// 3. Now we get to the resize thing
>doDraw       // CAN WE AVOID THAT????
  * this will redraw PBR rectangle(0, 0, 775, 413)
  * redrawing black borders, and copy item
<doDraw
getDirtyRectangle returned rectangle(0, 0, 775, 413)
>doDraw
  * this will redraw PBR rectangle(0, 0, 775, 413)
  * this will redraw RAW rectangle(590, 300, 30, 30)
  * this will redraw RAW rectangle(745, 383, 30, 30)
<doDraw

p0nce avatar Jan 10 '23 16:01 p0nce