aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percept
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-02-10 09:16:21 +0000
committerErlang/OTP <[email protected]>2010-02-10 09:16:21 +0000
commit29262ef2477ac656bf19073f90a742c23a7bb789 (patch)
treebb79b9a4ea5bc4d9a95708569a67c8a938a2e8f3 /lib/percept
parent3241e0ad7b6c85372b1c7577a760c8695e648e85 (diff)
parente7842b4f46ef909cac25666be43a5a6b6ca7551b (diff)
downloadotp-29262ef2477ac656bf19073f90a742c23a7bb789.tar.gz
otp-29262ef2477ac656bf19073f90a742c23a7bb789.tar.bz2
otp-29262ef2477ac656bf19073f90a742c23a7bb789.zip
Merge branch 'egil/egd_render' into ccase/r13b04_dev
* egil/egd_render: Fix egd_render transparent to use float constants OTP-8425 Fix egd_render transparent to use float constants. The render engine has float guards to enhance beam code generation. However, the default case used integers which caused the engine to crash. This is now fixed.
Diffstat (limited to 'lib/percept')
-rw-r--r--lib/percept/src/egd_render.erl12
-rw-r--r--lib/percept/test/egd_SUITE.erl14
2 files changed, 15 insertions, 11 deletions
diff --git a/lib/percept/src/egd_render.erl b/lib/percept/src/egd_render.erl
index cea9d2d926..4a0247dd33 100644
--- a/lib/percept/src/egd_render.erl
+++ b/lib/percept/src/egd_render.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -179,7 +179,7 @@ color(Trans,Layers,Type,OldC) ->
color([],_) -> {0.0,0.0,0.0,0.0};
color([{_,C}|_],opaque) -> C;
-color(Layers,alpha) -> color1({0,0,0,0},Layers).
+color(Layers,alpha) -> color1({0.0,0.0,0.0,0.0},Layers).
color1(Color,[]) -> Color;
color1(Color,[{_,C}|Layers]) -> color1(alpha_blend(Color,C),Layers).
diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl
index a2595400dd..fde02b47d5 100644
--- a/lib/percept/test/egd_SUITE.erl
+++ b/lib/percept/test/egd_SUITE.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -143,6 +143,8 @@ image_shape(Config) when is_list(Config) ->
?line ok = bitmap_point_has_color(Bitmap, {W,H}, Pt2, Fgc),
?line ok = bitmap_point_has_color(Bitmap, {W,H}, Pt1, Fgc),
+ ?line <<_/binary>> = egd:render(Im, raw_bitmap, [{render_engine, alpha}]),
+
?line ok = egd:destroy(Im),
erase(image_size),
ok.
@@ -177,6 +179,8 @@ image_primitives(Config) when is_list(Config) ->
?line ok = bitmap_point_has_color(Bitmap, {W,H}, Pt2, Fgc),
?line ok = bitmap_point_has_color(Bitmap, {W,H}, Pt1, Fgc),
+ ?line <<_/binary>> = egd_render:binary(Im2, alpha),
+
erase(image_size),
ok.