Bug 950504. Remove MatrixForThebesMatrix. r=mattwoodrow
authorNicholas Cameron <ncameron@mozilla.com>
Mon, 16 Dec 2013 11:17:58 +1300
changeset 160553 9063babbb51981513aa8d3083a16f46cd95730f9
parent 160552 7635b9512d86a3d4d3ecbcfd3bd5772264f8bf68
child 160554 7aff3ce8104648e093ab9530654cf58d8592158b
push id37629
push userncameron@mozilla.com
push dateMon, 16 Dec 2013 00:07:36 +0000
treeherdermozilla-inbound@9063babbb519 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs950504
milestone29.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 950504. Remove MatrixForThebesMatrix. r=mattwoodrow
gfx/layers/opengl/CompositorOGL.cpp
gfx/thebes/gfx2DGlue.h
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -1492,17 +1492,17 @@ CompositorOGL::CopyToTarget(DrawTarget *
     // to GL_COLOR_ATTACHMENT0 attachment point.
     mGLContext->fReadBuffer(LOCAL_GL_BACK);
   }
 
   RefPtr<SourceSurface> source =
     mGLContext->ReadPixelsToSourceSurface(IntSize(width, height));
 
   // Map from GL space to Cairo space and reverse the world transform.
-  Matrix glToCairoTransform = MatrixForThebesMatrix(aTransform);
+  Matrix glToCairoTransform = ToMatrix(aTransform);
   glToCairoTransform.Invert();
   glToCairoTransform.Scale(1.0, -1.0);
   glToCairoTransform.Translate(0.0, -height);
 
   Matrix oldMatrix = aTarget->GetTransform();
   aTarget->SetTransform(glToCairoTransform);
   Rect floatRect = Rect(rect.x, rect.y, rect.width, rect.height);
   aTarget->DrawSurface(source, floatRect, floatRect, DrawSurfaceOptions(), DrawOptions(1.0f, OP_SOURCE));
--- a/gfx/thebes/gfx2DGlue.h
+++ b/gfx/thebes/gfx2DGlue.h
@@ -50,16 +50,22 @@ inline Color ToColor(const gfxRGBA &aRGB
 }
 
 inline Matrix ToMatrix(const gfxMatrix &aMatrix)
 {
   return Matrix(Float(aMatrix.xx), Float(aMatrix.yx), Float(aMatrix.xy),
                 Float(aMatrix.yy), Float(aMatrix.x0), Float(aMatrix.y0));
 }
 
+inline gfxMatrix ThebesMatrix(const Matrix &aMatrix)
+{
+  return gfxMatrix(aMatrix._11, aMatrix._12, aMatrix._21,
+                   aMatrix._22, aMatrix._31, aMatrix._32);
+}
+
 inline Point ToPoint(const gfxPoint &aPoint)
 {
   return Point(Float(aPoint.x), Float(aPoint.y));
 }
 
 inline Size ToSize(const gfxSize &aSize)
 {
   return Size(Float(aSize.width), Float(aSize.height));
@@ -194,28 +200,16 @@ inline JoinStyle ToJoinStyle(gfxContext:
   case gfxContext::LINE_JOIN_BEVEL:
     return JOIN_BEVEL;
   case gfxContext::LINE_JOIN_ROUND:
     return JOIN_ROUND;
   }
   MOZ_CRASH("Incomplete switch");
 }
 
-inline gfxMatrix ThebesMatrix(const Matrix &aMatrix)
-{
-  return gfxMatrix(aMatrix._11, aMatrix._12, aMatrix._21,
-                   aMatrix._22, aMatrix._31, aMatrix._32);
-}
-
-inline Matrix MatrixForThebesMatrix(const gfxMatrix &aMatrix)
-{
-  return Matrix(aMatrix.xx, aMatrix.yx, aMatrix.xy,
-                aMatrix.yy, aMatrix.x0, aMatrix.y0);
-}
-
 inline gfxImageFormat SurfaceFormatToImageFormat(SurfaceFormat aFormat)
 {
   switch (aFormat) {
   case FORMAT_B8G8R8A8:
     return gfxImageFormatARGB32;
   case FORMAT_B8G8R8X8:
     return gfxImageFormatRGB24;
   case FORMAT_R5G6B5: