Bug 1158122 - Remove all occurences of nsIntRect in gfx/gl/. r=nical
authorThibaud Backenstrass <thibaud.backenstrass@phelma.grenoble-inp.fr>
Thu, 07 May 2015 11:07:27 +0200
changeset 262026 2ccef0dba5302f595bdd955c3f940b31479712e2
parent 262025 f3bc38042efe458ebb5c8de622ad997914e56e12
child 262027 0124362f1d0d0883add62ef034e0301d1a4f2cd9
push idunknown
push userunknown
push dateunknown
reviewersnical
bugs1158122
milestone40.0a1
Bug 1158122 - Remove all occurences of nsIntRect in gfx/gl/. r=nical
gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
gfx/gl/DecomposeIntoNoRepeatTriangles.h
gfx/gl/GLTextureImage.h
gfx/gl/TextureImageEGL.h
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
@@ -47,23 +47,23 @@ WrapTexCoord(GLfloat v)
     if (v < 0.0f) {
         return 1.0f + fmodf(v, 1.0f);
     }
 
     return fmodf(v, 1.0f);
 }
 
 void
-DecomposeIntoNoRepeatTriangles(const nsIntRect& aTexCoordRect,
+DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
                                const nsIntSize& aTexSize,
                                RectTriangles& aRects,
                                bool aFlipY /* = false */)
 {
     // normalize this
-    nsIntRect tcr(aTexCoordRect);
+    gfx::IntRect tcr(aTexCoordRect);
     while (tcr.x >= aTexSize.width)
         tcr.x -= aTexSize.width;
     while (tcr.y >= aTexSize.height)
         tcr.y -= aTexSize.height;
 
     // Compute top left and bottom right tex coordinates
     GLfloat tl[2] =
         { GLfloat(tcr.x) / GLfloat(aTexSize.width),
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -61,17 +61,17 @@ 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 nsIntRect& aTexCoordRect,
+void DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
                                     const nsIntSize& aTexSize,
                                     RectTriangles& aRects,
                                     bool aFlipY = false);
 
 }
 }
 
 #endif // DecomposeIntoNoRepeatTriangles_h_
--- a/gfx/gl/GLTextureImage.h
+++ b/gfx/gl/GLTextureImage.h
@@ -148,17 +148,17 @@ public:
      * allocated.  Must not be called between BeginUpdate and EndUpdate.
      * After a resize, the contents are undefined.
      *
      * If this isn't implemented by a subclass, it will just perform
      * a dummy BeginUpdate/EndUpdate pair.
      */
     virtual void Resize(const gfx::IntSize& aSize) {
         mSize = aSize;
-        nsIntRegion r(nsIntRect(0, 0, aSize.width, aSize.height));
+        nsIntRegion r(gfx::IntRect(0, 0, aSize.width, aSize.height));
         BeginUpdate(r);
         EndUpdate();
     }
 
     /**
      * Mark this texture as having valid contents. Call this after modifying
      * the texture contents externally.
      */
--- a/gfx/gl/TextureImageEGL.h
+++ b/gfx/gl/TextureImageEGL.h
@@ -60,17 +60,17 @@ public:
 
     virtual void DestroyEGLSurface(void);
 
 protected:
     typedef gfxImageFormat ImageFormat;
 
     GLContext* mGLContext;
 
-    nsIntRect mUpdateRect;
+    gfx::IntRect mUpdateRect;
     gfx::SurfaceFormat mUpdateFormat;
     RefPtr<gfx::DrawTarget> mUpdateDrawTarget;
     EGLImage mEGLImage;
     GLuint mTexture;
     EGLSurface mSurface;
     EGLConfig mConfig;
     TextureState mTextureState;