diff options
author | Björn-Egil Dahlberg <[email protected]> | 2009-11-26 00:51:46 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2009-12-03 14:41:11 +0100 |
commit | 8d2bc786caa82be22d0259cd4a8720a101775eb4 (patch) | |
tree | 17adc31ca010a215ccf6358143ab40f41ee3c36c /lib/percept/src/egd_font.erl | |
parent | 84adefa331c4159d432d22840663c38f155cd4c1 (diff) | |
download | otp-8d2bc786caa82be22d0259cd4a8720a101775eb4.tar.gz otp-8d2bc786caa82be22d0259cd4a8720a101775eb4.tar.bz2 otp-8d2bc786caa82be22d0259cd4a8720a101775eb4.zip |
Optimize egd render speed and reduce code size
Diffstat (limited to 'lib/percept/src/egd_font.erl')
-rw-r--r-- | lib/percept/src/egd_font.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/percept/src/egd_font.erl b/lib/percept/src/egd_font.erl index 2b2a89a0a9..5f0d56dd90 100644 --- a/lib/percept/src/egd_font.erl +++ b/lib/percept/src/egd_font.erl @@ -131,18 +131,18 @@ parse_glyph({Code,W,H,X0,Y0,Xm,Offset}, Bitmasks) -> render_glyph(W, H, X0, Y0, Xm, Bitmask) -> render_glyph(W,{0,H},X0,Y0,Xm,Bitmask, []). render_glyph(_W, {H,H}, _X0, _Y0, _Xm, _Bitmask, Out) -> Out; -render_glyph(W, {Hi,H}, X0, Y0,Xm, Bitmask, LSs) -> +render_glyph(W, {Hi,H}, X0, Y0,Xm, Bitmask , LSs) -> N = ((W+7) div 8), O = N*Hi, <<_:O/binary, Submask/binary>> = Bitmask, - LS = render_glyph_horizontal( + LS = render_glyph_horizontal( Submask, % line glyph bitmask {down, W - 1}, % loop state W - 1, % Width []), % Linespans render_glyph(W,{Hi+1,H},X0,Y0,Xm, Bitmask, [LS|LSs]). -render_glyph_horizontal(Value, {Pr, Px}, 0, Spans) -> +render_glyph_horizontal(Value, {Pr, Px}, 0, Spans) -> Cr = bit_spin(Value, 0), case {Pr,Cr} of {up , up } -> % closure of interval since its last @@ -173,4 +173,3 @@ bit_spin(Value, Cx) -> 1 -> up; 0 -> down end. - |