Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#709 closed bug (fixed)

B_OP_ADD drawing mode not working in SoundRecorder

Reported by: korli Owned by: axeld
Priority: normal Milestone: R1
Component: - General Version:
Keywords: Cc: diver
Blocked By: Blocking:
Has a Patch: no Platform: All


I noticed that B_OP_ADD isn't implemented when using SoundRecorder.

But it seems B_OP_ERASE, B_OP_INVERT, B_OP_SELECT, B_OP_MIN, B_OP_MAX, B_OP_SUBSTRACT, B_OP_BLEND aren't implemented too.

Change History (12)

comment:1 by diver, 13 years ago

Cc: diver added

comment:2 by korli, 13 years ago

Cc: superstippi@… added

comment:3 by stippi, 13 years ago

Could you please point to the code in SoundRecorder that does not work? As you can see in Playground, all drawing modes work fine there.

comment:4 by stippi, 13 years ago

Status: newassigned

comment:5 by korli, 13 years ago

OK, I didn't have a look at Playground to test. So forget my remark about other modes than B_OP_ADD.

In SoundRecorder, there is a B_OP_ADD set and StrokeLine done in ScopeView::RenderBitmap(). I can see something drawn when I replace with B_OP_OVER. ScopeView.cpp?rev=17718&view=markup

comment:6 by korli, 13 years ago

Summary: drawing modes not implementedB_OP_ADD drawing mode not working in SoundRecorder

comment:7 by korli, 13 years ago

Stephan, I could be wrong but I think the way the add is done will result in an overflow of the uint8 data type

uint8 rt = min_c(255, _p.data8[2] + (r));

=> if _p.data8[2] and r are uint8, and values are 130, 130, the value of rt will be : 5 instead of 255. Thus it should IMO be (optimizations could be done): uint8 rt = min_c(255, (uint16)_p.data8[2] + (uint16)(r));

comment:8 by korli, 13 years ago

In fact, I was wrong, forget my last comment.

comment:9 by korli, 13 years ago

I committed a fix in revision 18050. Not very good IMO. Stephan, it would be cool if you could review this. Thanks.

comment:10 by korli, 13 years ago

Resolution: fixed

comment:11 by korli, 13 years ago

Status: assignedclosed

comment:12 by korli, 13 years ago

Fixed by stippi. Thanks. Though there is a big performance hit compared with Dano (at least x5). Maybe we should make an optimized StrokeLine for 1 pixel. Also, is it valid to draw a square (0,0,1,1) to actually draw a single point ?

Note: See TracTickets for help on using tickets.