[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] /srv/bzr/gnash/trunk r11984: Don't use the character
From: |
strk |
Subject: |
Re: [Gnash-commit] /srv/bzr/gnash/trunk r11984: Don't use the character matrix to adjust "hair" width lines. Transform |
Date: |
Fri, 5 Mar 2010 10:02:49 +0100 |
Glad to see you on renderer!
Stimulated by new OGL backend ?
--strk;
On Fri, Mar 05, 2010 at 05:19:28AM +0100, Bastiaan Jacques wrote:
> ------------------------------------------------------------
> revno: 11984
> committer: Bastiaan Jacques <address@hidden>
> branch nick: trunk
> timestamp: Fri 2010-03-05 05:19:28 +0100
> message:
> Don't use the character matrix to adjust "hair" width lines. Transform
> the line width according to the inverted stage matrix, so these lines
> do not scale. Fixes bug #21566.
> modified:
> backend/Renderer_cairo.cpp
> backend/Renderer_cairo.h
> === modified file 'backend/Renderer_cairo.cpp'
> --- a/backend/Renderer_cairo.cpp 2010-01-14 12:03:17 +0000
> +++ b/backend/Renderer_cairo.cpp 2010-03-05 04:19:28 +0000
> @@ -788,7 +788,8 @@
> }
>
> void
> -Renderer_cairo::apply_line_style(const LineStyle& style, const cxform& cx)
> +Renderer_cairo::apply_line_style(const LineStyle& style, const cxform& cx,
> + const SWFMatrix& mat)
> {
> cairo_line_join_t join_style = CAIRO_LINE_JOIN_MITER;
> switch(style.joinStyle()) {
> @@ -831,10 +832,16 @@
> float width = style.getThickness();
>
> if ( width == 0.0 ) {
> - double hwidth = 1.0;
> -
> - cairo_device_to_user_distance(_cr, &hwidth, &hwidth);
> - cairo_set_line_width(_cr, hwidth);
> +
> + cairo_matrix_t inv_stage = _stage_mat;
> + cairo_matrix_invert(&inv_stage);
> +
> + double xconv = 1.0;
> + double yconv = 1.0;
> +
> + cairo_matrix_transform_distance(&inv_stage, &xconv, &yconv);
> +
> + cairo_set_line_width(_cr, xconv);
> } else {
> // TODO: this is correct for !style.scaleThicknessVertically()
> // and !style.scaleThicknessHorizontally().
> @@ -847,7 +854,7 @@
>
> cairo_set_line_width(_cr, width);
> }
> -
> +
> rgba color = cx.transform(style.get_color());
> set_color(color);
> }
> @@ -855,7 +862,8 @@
> void
> Renderer_cairo::draw_outlines(const PathVec& path_vec,
> const std::vector<LineStyle>& line_styles,
> - const cxform& cx)
> + const cxform& cx,
> + const SWFMatrix& mat)
> {
> for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
> it != end; ++it) {
> @@ -865,7 +873,7 @@
> continue;
> }
>
> - apply_line_style(line_styles[cur_path.m_line-1], cx);
> + apply_line_style(line_styles[cur_path.m_line-1], cx, mat);
> add_path(_cr, cur_path);
> cairo_stroke(_cr);
> }
> @@ -880,7 +888,7 @@
> CairoPathRunner runner(*this, path_vec, fill_styles, _cr);
> runner.run(cx, mat);
>
> - draw_outlines(path_vec, line_styles, cx);
> + draw_outlines(path_vec, line_styles, cx, mat);
> }
>
>
>
> === modified file 'backend/Renderer_cairo.h'
> --- a/backend/Renderer_cairo.h 2010-01-14 12:03:17 +0000
> +++ b/backend/Renderer_cairo.h 2010-03-05 04:19:28 +0000
> @@ -75,11 +75,13 @@
>
> void add_path(cairo_t* cr, const Path& cur_path);
>
> - void apply_line_style(const LineStyle& style, const cxform& cx);
> + void apply_line_style(const LineStyle& style, const cxform& cx,
> + const SWFMatrix& mat);
>
> void draw_outlines(const PathVec& path_vec,
> const std::vector<LineStyle>& line_styles,
> - const cxform& cx);
> + const cxform& cx,
> + const SWFMatrix& mat);
>
> std::vector<PathVec::const_iterator> find_subshapes(const PathVec&
> path_vec);
>
>
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit
--
() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html