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

Description

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 Changed 13 years ago by diver

Cc: diver added

comment:2 Changed 13 years ago by korli

Cc: superstippi@… added

comment:3 Changed 13 years ago by stippi

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 Changed 13 years ago by stippi

Status: newassigned

comment:5 Changed 13 years ago by korli

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. http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/apps/soundrecorder/ ScopeView.cpp?rev=17718&view=markup

comment:6 Changed 13 years ago by korli

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

comment:7 Changed 13 years ago by korli

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 Changed 13 years ago by korli

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

comment:9 Changed 13 years ago by korli

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

comment:10 Changed 13 years ago by korli

Resolution: fixed

comment:11 Changed 13 years ago by korli

Status: assignedclosed

comment:12 Changed 13 years ago by korli

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.