Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
2009-08-15 Larry Ewing <lewing@novell.com>
Browse files Browse the repository at this point in the history
	* mediaelement.cpp (Render): use the same logic we used in image
	here to always adjust the paint rect when stretch != StretchNone.

	r: andreia

2009-08-15  Larry Ewing  <lewing@novell.com>

	* System.Windows.Shapes/PathTest.cs: put the Path tests back into
	compliance.

svn path=/branches/moon/1.99.1/moon/; revision=140037
  • Loading branch information
lewing committed Aug 17, 2009
1 parent 0e1490a commit 634b9c3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
7 changes: 7 additions & 0 deletions src/ChangeLog
@@ -1,3 +1,10 @@
2009-08-15 Larry Ewing <lewing@novell.com>

* mediaelement.cpp (Render): use the same logic we used in image
here to always adjust the paint rect when stretch != StretchNone.

r: andreia

2009-08-15 Larry Ewing <lewing@novell.com>

* shape.cpp (MeasureOverride): Stretch to the proper width when
Expand Down
34 changes: 13 additions & 21 deletions src/mediaelement.cpp
Expand Up @@ -633,16 +633,16 @@ MediaElement::Render (cairo_t *cr, Region *region, bool path_only)
return;

cairo_save (cr);

cairo_set_matrix (cr, &absolute_xform);

// if we're opaque, we can likely do this and hopefully get a
// speed up since the server won't have to blend.
//cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_new_path (cr);

Rect paint = Rect (0, 0, GetActualWidth (), GetActualHeight ());
Rect video = Rect (0, 0, mplayer->GetVideoWidth (), mplayer->GetVideoHeight ());
Size framework (GetActualWidth (), GetActualHeight ());
Rect video (0, 0, mplayer->GetVideoWidth (), mplayer->GetVideoHeight ());

if (stretch != StretchNone)
framework = ApplySizeConstraints (framework);

Rect paint (0, 0, framework.width, framework.height);

/*
if (absolute_xform.xy == 0 && absolute_xform.yx == 0) {
Expand All @@ -654,16 +654,7 @@ MediaElement::Render (cairo_t *cr, Region *region, bool path_only)
paint = paint.Transform (&inv);
}
*/

Size specified = Size (GetWidth (), GetHeight ());
if (GetVisualParent () && GetVisualParent()->Is (Type::CANVAS)) {
if (!isnan (specified.width))
paint.width = specified.width;

if (!isnan (specified.height))
paint.height = specified.height;
}


image_brush_compute_pattern_matrix (&matrix,
paint.width, paint.height,
video.width, video.height,
Expand All @@ -672,21 +663,22 @@ MediaElement::Render (cairo_t *cr, Region *region, bool path_only)

pattern = cairo_pattern_create_for_surface (surface);


cairo_pattern_set_matrix (pattern, &matrix);

cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);

if (IsPlaying ())
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_FAST);

if (!path_only)
RenderLayoutClip (cr);

paint.Draw (cr);
cairo_fill (cr);


if (!path_only)
cairo_fill (cr);

cairo_restore (cr);
}

Expand Down
5 changes: 5 additions & 0 deletions test/2.0/moon-unit/ChangeLog
@@ -1,3 +1,8 @@
2009-08-15 Larry Ewing <lewing@novell.com>

* System.Windows.Shapes/PathTest.cs: put the Path tests back into
compliance.

2009-08-14 Alan McGovern <amcgovern@novell.com>

* System.Windows.Controls/GridTest.cs:
Expand Down
6 changes: 1 addition & 5 deletions test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs
Expand Up @@ -293,7 +293,6 @@ public void ComputeReducedSizeIntrinsicBorder ()
}

[TestMethod]
[MoonlightBug]
public void ComputeLargerSize_StretchFill_IntrinsicBorder ()
{
Border b = new Border ();
Expand Down Expand Up @@ -329,7 +328,6 @@ public void ComputeLargerSize_StretchFill_IntrinsicBorder ()
}

[TestMethod]
[MoonlightBug]
public void ComputeLargerSize_StretchUniform_IntrinsicBorder ()
{
Border b = new Border ();
Expand Down Expand Up @@ -365,7 +363,6 @@ public void ComputeLargerSize_StretchUniform_IntrinsicBorder ()
}

[TestMethod]
[MoonlightBug]
public void BorderComputeLargerSize_StretchUniform_IntrinsicBorder ()
{
Border b = new Border ();
Expand Down Expand Up @@ -401,7 +398,6 @@ public void BorderComputeLargerSize_StretchUniform_IntrinsicBorder ()
}

[TestMethod]
[MoonlightBug]
public void BorderComputeLargerSize_StretchUniform_SizedIntrinsicBorder ()
{
Border b = new Border ();
Expand Down Expand Up @@ -516,7 +512,6 @@ public void BorderComputeLargerSize_StretchUniformToFill_AlignCenter_IntrinsicBo
}

[TestMethod]
[MoonlightBug]
public void ComputeReducedSize_StretchUniform_InstrinsicBorder ()
{
Border b = new Border ();
Expand Down Expand Up @@ -991,6 +986,7 @@ public void ArrangeTest4()
}

[TestMethod]
[MoonlightBug ("Regression from the RenderSize clamping")]
public void ArrangeTest5()
{
Border b = new Border ();
Expand Down

0 comments on commit 634b9c3

Please sign in to comment.