Bug 1158120 - Replace nsIntSize by mozilla::gfx::IntSize in gfx/gl part 2. r=nical
authorAmanda Sambath <amanda.sambath@phelma.grenoble-inp.fr>
Fri, 29 May 2015 13:59:26 +0200
changeset 246556 0e9a8b700143a0129bb5d6dfe8470562e04a0389
parent 246555 77bd155ffdc66a1917730236e9de425ee6b0f83e
child 246557 49cceccb1a45abfabfd3a590ed9326f234a257de
push id28837
push usercbook@mozilla.com
push dateTue, 02 Jun 2015 11:11:35 +0000
treeherderautoland@9eae3880b132 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1158120
milestone41.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 1158120 - Replace nsIntSize by mozilla::gfx::IntSize in gfx/gl part 2. r=nical
gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
gfx/gl/DecomposeIntoNoRepeatTriangles.h
gfx/gl/GLTextureImage.cpp
gfx/gl/TextureImageCGL.h
gfx/gl/TextureImageCGL.mm
gfx/gl/TextureImageEGL.cpp
gfx/gl/TextureImageEGL.h
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
@@ -48,17 +48,17 @@ WrapTexCoord(GLfloat v)
         return 1.0f + fmodf(v, 1.0f);
     }
 
     return fmodf(v, 1.0f);
 }
 
 void
 DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
-                               const nsIntSize& aTexSize,
+                               const gfx::IntSize& aTexSize,
                                RectTriangles& aRects,
                                bool aFlipY /* = false */)
 {
     // normalize this
     gfx::IntRect tcr(aTexCoordRect);
     while (tcr.x >= aTexSize.width)
         tcr.x -= aTexSize.width;
     while (tcr.y >= aTexSize.height)
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -62,16 +62,16 @@ private:
   * The resulting triangle vertex coordinates will be in the space of
   * (0.0, 0.0) to (1.0, 1.0) -- transform the coordinates appropriately
   * if you need a different space.
   *
   * The resulting vertex coordinates should be drawn using GL_TRIANGLES,
   * and rects.numRects * 3 * 6
   */
 void DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
-                                    const nsIntSize& aTexSize,
+                                    const gfx::IntSize& aTexSize,
                                     RectTriangles& aRects,
                                     bool aFlipY = false);
 
 }
 }
 
 #endif // DecomposeIntoNoRepeatTriangles_h_
--- a/gfx/gl/GLTextureImage.cpp
+++ b/gfx/gl/GLTextureImage.cpp
@@ -41,17 +41,17 @@ CreateTextureImage(GLContext* gl,
         default:
             return CreateBasicTextureImage(gl, aSize, aContentType, aWrapMode, aFlags, aImageFormat);
     }
 }
 
 
 static already_AddRefed<TextureImage>
 TileGenFunc(GLContext* gl,
-            const nsIntSize& aSize,
+            const IntSize& aSize,
             TextureImage::ContentType aContentType,
             TextureImage::Flags aFlags,
             TextureImage::ImageFormat aImageFormat)
 {
     switch (gl->GetContextType()) {
 #ifdef XP_MACOSX
         case GLContextType::CGL:
             return TileGenFuncCGL(gl, aSize, aContentType, aFlags, aImageFormat);
@@ -628,17 +628,17 @@ void TiledTextureImage::Resize(const gfx
         // This will cause the pruning of columns not to work, but we don't need
         // to worry about that, as no more tiles will be reused past this point
         // anyway.
         if ((row == (int)mRows - 1) && (aSize.height != mSize.height))
             mColumns = 0;
 
         int col;
         for (col = 0; col < (int)columns; col++) {
-            nsIntSize size( // use tilesize first, then the remainder
+            IntSize size( // use tilesize first, then the remainder
                     (col+1) * mTileSize > (unsigned int)aSize.width  ? aSize.width  % mTileSize : mTileSize,
                     (row+1) * mTileSize > (unsigned int)aSize.height ? aSize.height % mTileSize : mTileSize);
 
             bool replace = false;
 
             // Check if we can re-use old tiles.
             if (col < (int)mColumns) {
                 // Reuse an existing tile. If the tile is an end-tile and the
--- a/gfx/gl/TextureImageCGL.h
+++ b/gfx/gl/TextureImageCGL.h
@@ -14,17 +14,17 @@
 namespace mozilla {
 namespace gl {
 
 class TextureImageCGL : public BasicTextureImage
 {
 public:
 
     TextureImageCGL(GLuint aTexture,
-                    const nsIntSize& aSize,
+                    const gfx::IntSize& aSize,
                     GLenum aWrapMode,
                     ContentType aContentType,
                     GLContext* aContext,
                     TextureImage::Flags aFlags = TextureImage::NoFlags,
                     TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
 
     ~TextureImageCGL();
 
@@ -44,17 +44,17 @@ CreateTextureImageCGL(GLContext *gl,
                       const gfx::IntSize& aSize,
                       TextureImage::ContentType aContentType,
                       GLenum aWrapMode,
                       TextureImage::Flags aFlags,
                       TextureImage::ImageFormat aImageFormat);
 
 already_AddRefed<TextureImage>
 TileGenFuncCGL(GLContext *gl,
-               const nsIntSize& aSize,
+               const gfx::IntSize& aSize,
                TextureImage::ContentType aContentType,
                TextureImage::Flags aFlags,
                TextureImage::ImageFormat aImageFormat);
 
 }
 }
 
 #endif
--- a/gfx/gl/TextureImageCGL.mm
+++ b/gfx/gl/TextureImageCGL.mm
@@ -12,17 +12,17 @@
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace gl {
 
 TextureImageCGL::TextureImageCGL(GLuint aTexture,
-                const nsIntSize& aSize,
+                const IntSize& aSize,
                 GLenum aWrapMode,
                 ContentType aContentType,
                 GLContext* aContext,
                 TextureImage::Flags aFlags,
                 TextureImage::ImageFormat aImageFormat)
     : BasicTextureImage(aTexture, aSize, aWrapMode, aContentType,
                         aContext, aFlags, aImageFormat)
     , mPixelBuffer(0)
@@ -76,17 +76,17 @@ CreateTextureImageCGL(GLContext* gl,
     }
 
     return CreateBasicTextureImage(gl, aSize, aContentType, aWrapMode,
                                    aFlags, aImageFormat);
 }
 
 already_AddRefed<TextureImage>
 TileGenFuncCGL(GLContext *gl,
-               const nsIntSize& aSize,
+               const IntSize& aSize,
                TextureImage::ContentType aContentType,
                TextureImage::Flags aFlags,
                TextureImage::ImageFormat aImageFormat)
 {
     bool useNearestFilter = aFlags & TextureImage::UseNearestFilter;
     gl->MakeCurrent();
 
     GLuint texture;
--- a/gfx/gl/TextureImageEGL.cpp
+++ b/gfx/gl/TextureImageEGL.cpp
@@ -43,17 +43,17 @@ GLTypeForImage(gfx::SurfaceFormat aForma
         return LOCAL_GL_UNSIGNED_SHORT_5_6_5;
     default:
         NS_WARNING("Unknown GL format for Surface format");
     }
     return 0;
 }
 
 TextureImageEGL::TextureImageEGL(GLuint aTexture,
-                                 const nsIntSize& aSize,
+                                 const gfx::IntSize& aSize,
                                  GLenum aWrapMode,
                                  ContentType aContentType,
                                  GLContext* aContext,
                                  Flags aFlags,
                                  TextureState aTextureState,
                                  TextureImage::ImageFormat aImageFormat)
     : TextureImage(aSize, aWrapMode, aContentType, aFlags)
     , mGLContext(aContext)
@@ -313,17 +313,17 @@ CreateTextureImageEGL(GLContext *gl,
                       TextureImage::ImageFormat aImageFormat)
 {
     nsRefPtr<TextureImage> t = new gl::TiledTextureImage(gl, aSize, aContentType, aFlags, aImageFormat);
     return t.forget();
 }
 
 already_AddRefed<TextureImage>
 TileGenFuncEGL(GLContext *gl,
-               const nsIntSize& aSize,
+               const gfx::IntSize& aSize,
                TextureImage::ContentType aContentType,
                TextureImage::Flags aFlags,
                TextureImage::ImageFormat aImageFormat)
 {
   gl->MakeCurrent();
 
   GLuint texture;
   gl->fGenTextures(1, &texture);
--- a/gfx/gl/TextureImageEGL.h
+++ b/gfx/gl/TextureImageEGL.h
@@ -11,17 +11,17 @@
 namespace mozilla {
 namespace gl {
 
 class TextureImageEGL final
     : public TextureImage
 {
 public:
     TextureImageEGL(GLuint aTexture,
-                    const nsIntSize& aSize,
+                    const gfx::IntSize& aSize,
                     GLenum aWrapMode,
                     ContentType aContentType,
                     GLContext* aContext,
                     Flags aFlags = TextureImage::NoFlags,
                     TextureState aTextureState = Created,
                     TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
 
     virtual ~TextureImageEGL();
@@ -82,17 +82,17 @@ CreateTextureImageEGL(GLContext *gl,
                       const gfx::IntSize& aSize,
                       TextureImage::ContentType aContentType,
                       GLenum aWrapMode,
                       TextureImage::Flags aFlags,
                       TextureImage::ImageFormat aImageFormat);
 
 already_AddRefed<TextureImage>
 TileGenFuncEGL(GLContext *gl,
-               const nsIntSize& aSize,
+               const gfx::IntSize& aSize,
                TextureImage::ContentType aContentType,
                TextureImage::Flags aFlags,
                TextureImage::ImageFormat aImageFormat);
 
 }
 }
 
 #endif // TEXTUREIMAGEEGL_H_