Bug 738688: Add supports for color patterns in the Azure-Thebes wrapper. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Thu, 29 Mar 2012 20:53:43 +0200
changeset 90633 6bfae7eb218767308685b1d252768a7166a25df1
parent 90632 6b90f61fffafd96960b8267da92d3c22fa29a936
child 90634 23fb4940211498334437a9db79d202763736445d
push id7765
push userbschouten@mozilla.com
push dateThu, 29 Mar 2012 18:54:11 +0000
treeherdermozilla-inbound@1b468e61ac02 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs738688
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 738688: Add supports for color patterns in the Azure-Thebes wrapper. r=jrmuizel
gfx/thebes/gfxPattern.cpp
--- a/gfx/thebes/gfxPattern.cpp
+++ b/gfx/thebes/gfxPattern.cpp
@@ -154,16 +154,24 @@ gfxPattern::GetPattern(mozilla::gfx::Dra
     mGfxPattern = new (mSurfacePattern.addr())
       SurfacePattern(mSourceSurface, EXTEND_CLAMP, mTransform);
     return mGfxPattern;
   }
 
   GraphicsExtend extend = (GraphicsExtend)cairo_pattern_get_extend(mPattern);
 
   switch (cairo_pattern_get_type(mPattern)) {
+  case CAIRO_PATTERN_TYPE_SOLID:
+    {
+      double r, g, b, a;
+      cairo_pattern_get_rgba(mPattern, &r, &g, &b, &a);
+
+      new (mColorPattern.addr()) ColorPattern(Color(r, g, b, a));
+      return mColorPattern.addr();
+    }
   case CAIRO_PATTERN_TYPE_SURFACE:
     {
       GraphicsFilter filter = (GraphicsFilter)cairo_pattern_get_filter(mPattern);
       cairo_matrix_t mat;
       cairo_pattern_get_matrix(mPattern, &mat);
       gfxMatrix matrix(*reinterpret_cast<gfxMatrix*>(&mat));
 
       cairo_surface_t *surf = NULL;