Bug 1207741 - Remove gfxIntSize. r=nical.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 23 Sep 2015 11:49:05 -0700
changeset 264331 cdee9be7cdc15a2e1518ca56dd57c812e5cfb107
parent 264330 4a47b57f91aefd84a999130df99a09c63234a015
child 264332 2056cb9f608d9a967d3a6d19466c2f604407b820
push id29436
push usercbook@mozilla.com
push dateFri, 25 Sep 2015 12:39:56 +0000
treeherdermozilla-central@543e1b3a2588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1207741
milestone44.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 1207741 - Remove gfxIntSize. r=nical. gfxIntSize is just a typedef of gfx::IntSize, so this is very mechanical. The only tricky part is deciding for each occurrence whether to replace it with IntSize, gfx::IntSize or mozilla::gfx::IntSize; in all cases I went with the shortest one that worked given the existing "using namespace" declarations.
dom/camera/CameraPreviewMediaStream.cpp
dom/camera/CameraPreviewMediaStream.h
dom/camera/DOMCameraControlListener.cpp
dom/canvas/CanvasImageCache.cpp
dom/canvas/CanvasImageCache.h
dom/canvas/CanvasRenderingContext2D.cpp
dom/html/HTMLMediaElement.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/PContent.ipdl
dom/ipc/TabParent.cpp
dom/media/VideoFrameContainer.cpp
dom/media/VideoFrameContainer.h
dom/media/VideoSegment.cpp
dom/media/VideoSegment.h
dom/media/android/AndroidMediaReader.cpp
dom/media/encoder/TrackEncoder.cpp
dom/media/encoder/VP8TrackEncoder.cpp
dom/media/ogg/OggReader.cpp
dom/media/omx/MediaCodecReader.cpp
dom/media/omx/MediaOmxReader.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/ipc/PPluginInstance.ipdl
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceChild.h
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
dom/plugins/ipc/PluginSurfaceParent.cpp
dom/plugins/ipc/PluginSurfaceParent.h
gfx/src/nsSize.h
gfx/thebes/gfxBlur.cpp
gfx/thebes/gfxBlur.h
gfx/thebes/gfxUtils.cpp
image/DynamicImage.cpp
image/OrientedImage.cpp
image/imgFrame.cpp
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRendering.h
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/svg/nsFilterInstance.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/svg/nsSVGIntegrationUtils.h
layout/svg/nsSVGUtils.cpp
layout/svg/nsSVGUtils.h
media/webrtc/signaling/test/FakeMediaStreamsImpl.h
widget/android/nsScreenManagerAndroid.cpp
widget/android/nsWindow.cpp
widget/android/nsWindow.h
widget/cocoa/nsCocoaUtils.mm
widget/gtk/nsWindow.cpp
widget/nsShmImage.cpp
widget/nsShmImage.h
widget/qt/nsWindow.cpp
widget/uikit/nsWindow.h
widget/windows/TaskbarPreview.cpp
widget/windows/nsWindow.cpp
widget/windows/nsWindowGfx.cpp
widget/windows/nsWindowGfx.h
--- a/dom/camera/CameraPreviewMediaStream.cpp
+++ b/dom/camera/CameraPreviewMediaStream.cpp
@@ -132,17 +132,17 @@ CameraPreviewMediaStream::Invalidate()
 
 void
 CameraPreviewMediaStream::RateLimit(bool aLimit)
 {
   mRateLimit = aLimit;
 }
 
 void
-CameraPreviewMediaStream::SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage)
+CameraPreviewMediaStream::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage)
 {
   {
     MutexAutoLock lock(mMutex);
 
     if (mInvalidatePending > 0) {
       if (mRateLimit || mInvalidatePending > MAX_INVALIDATE_PENDING) {
         ++mDiscardedFrames;
         DOM_CAMERA_LOGW("Discard preview frame %d, %d invalidation(s) pending",
--- a/dom/camera/CameraPreviewMediaStream.h
+++ b/dom/camera/CameraPreviewMediaStream.h
@@ -53,17 +53,17 @@ public:
   virtual void AddListener(MediaStreamListener* aListener) override;
   virtual void RemoveListener(MediaStreamListener* aListener) override;
   virtual void Destroy() override;
   void OnPreviewStateChange(bool aActive);
 
   void Invalidate();
 
   // Call these on any thread.
-  void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage);
+  void SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage);
   void ClearCurrentFrame();
   void RateLimit(bool aLimit);
 
 protected:
   // mMutex protects all the class' fields.
   // This class is not registered to MediaStreamGraph.
   // It needs to protect all the fields.
   Mutex mMutex;
--- a/dom/camera/DOMCameraControlListener.cpp
+++ b/dom/camera/DOMCameraControlListener.cpp
@@ -306,17 +306,17 @@ DOMCameraControlListener::OnRateLimitPre
   mStream->RateLimit(aLimit);
 }
 
 bool
 DOMCameraControlListener::OnNewPreviewFrame(layers::Image* aImage, uint32_t aWidth, uint32_t aHeight)
 {
   DOM_CAMERA_LOGI("OnNewPreviewFrame: got %d x %d frame\n", aWidth, aHeight);
 
-  mStream->SetCurrentFrame(gfxIntSize(aWidth, aHeight), aImage);
+  mStream->SetCurrentFrame(gfx::IntSize(aWidth, aHeight), aImage);
   return true;
 }
 
 void
 DOMCameraControlListener::OnAutoFocusComplete(bool aAutoFocusSucceeded)
 {
   class Callback : public DOMCallback
   {
--- a/dom/canvas/CanvasImageCache.cpp
+++ b/dom/canvas/CanvasImageCache.cpp
@@ -48,17 +48,17 @@ struct ImageCacheEntryData {
 
   // Key
   nsRefPtr<Element> mImage;
   nsIImageLoadingContent* mILC;
   nsRefPtr<HTMLCanvasElement> mCanvas;
   // Value
   nsCOMPtr<imgIRequest> mRequest;
   RefPtr<SourceSurface> mSourceSurface;
-  gfxIntSize mSize;
+  IntSize mSize;
   nsExpirationState mState;
 };
 
 class ImageCacheEntry : public PLDHashEntryHdr {
 public:
   typedef ImageCacheKey KeyType;
   typedef const ImageCacheKey* KeyTypePointer;
 
@@ -232,17 +232,17 @@ ImageCache::~ImageCache() {
   mImageCacheObserver->Destroy();
 }
 
 void
 CanvasImageCache::NotifyDrawImage(Element* aImage,
                                   HTMLCanvasElement* aCanvas,
                                   imgIRequest* aRequest,
                                   SourceSurface* aSource,
-                                  const gfxIntSize& aSize)
+                                  const IntSize& aSize)
 {
   if (!gImageCache) {
     gImageCache = new ImageCache();
     nsContentUtils::RegisterShutdownObserver(new CanvasImageCacheShutdownObserver());
   }
 
   ImageCacheEntry* entry = gImageCache->mCache.PutEntry(ImageCacheKey(aImage, aCanvas));
   if (entry) {
--- a/dom/canvas/CanvasImageCache.h
+++ b/dom/canvas/CanvasImageCache.h
@@ -28,17 +28,17 @@ public:
    * Notify that image element aImage was (or is about to be) drawn to aCanvas
    * using the first frame of aRequest's image. The data for the surface is
    * in aSurface, and the image size is in aSize.
    */
   static void NotifyDrawImage(dom::Element* aImage,
                               dom::HTMLCanvasElement* aCanvas,
                               imgIRequest* aRequest,
                               SourceSurface* aSource,
-                              const gfxIntSize& aSize);
+                              const gfx::IntSize& aSize);
 
   /**
    * Check whether aImage has recently been drawn into aCanvas. If we return
    * a non-null surface, then the image was recently drawn into the canvas
    * (with the same image request) and the returned surface contains the image
    * data, and the image size will be returned in aSize.
    */
   static SourceSurface* Lookup(dom::Element* aImage,
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4782,17 +4782,17 @@ CanvasRenderingContext2D::GetGlobalCompo
 void
 CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
                                      double y, double w, double h,
                                      const nsAString& bgColor,
                                      uint32_t flags, ErrorResult& error)
 {
   // protect against too-large surfaces that will cause allocation
   // or overflow issues
-  if (!gfxASurface::CheckSurfaceSize(gfxIntSize(int32_t(w), int32_t(h)),
+  if (!gfxASurface::CheckSurfaceSize(gfx::IntSize(int32_t(w), int32_t(h)),
                                      0xffff)) {
     error.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   EnsureTarget();
   // We can't allow web apps to call this until we fix at least the
   // following potential security issues:
@@ -4971,17 +4971,17 @@ CanvasRenderingContext2D::AsyncDrawXULEl
       return;
     }
 
     return DrawWindow(window, x, y, w, h, bgColor, flags);
   }
 
   // protect against too-large surfaces that will cause allocation
   // or overflow issues
-  if (!gfxASurface::CheckSurfaceSize(gfxIntSize(w, h), 0xffff)) {
+  if (!gfxASurface::CheckSurfaceSize(gfx::IntSize(w, h), 0xffff)) {
     error.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   bool flush =
     (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) == 0;
 
   uint32_t renderDocFlags = nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING;
@@ -5396,17 +5396,17 @@ CanvasRenderingContext2D::PutImageData_e
 
   uint32_t len = w * h * 4;
   if (dataLen != len) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   uint32_t copyWidth = dirtyRect.Width();
   uint32_t copyHeight = dirtyRect.Height();
-  nsRefPtr<gfxImageSurface> imgsurf = new gfxImageSurface(gfxIntSize(copyWidth, copyHeight),
+  nsRefPtr<gfxImageSurface> imgsurf = new gfxImageSurface(gfx::IntSize(copyWidth, copyHeight),
                                                           gfxImageFormat::ARGB32,
                                                           false);
   if (!imgsurf || imgsurf->CairoStatus()) {
     return NS_ERROR_FAILURE;
   }
 
   uint32_t copyX = dirtyRect.x - x;
   uint32_t copyY = dirtyRect.y - y;
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3037,52 +3037,52 @@ public:
   {}
   void Forget() { mElement = nullptr; }
 
   void ReceivedSize()
   {
     if (!mElement) {
       return;
     }
-    gfxIntSize size;
+    gfx::IntSize size;
     {
       MutexAutoLock lock(mMutex);
       size = mInitialSize;
     }
     nsRefPtr<HTMLMediaElement> deathGrip = mElement;
     mElement->UpdateInitialMediaSize(size);
   }
   virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                                         StreamTime aTrackOffset,
                                         uint32_t aTrackEvents,
                                         const MediaSegment& aQueuedMedia) override
   {
     MutexAutoLock lock(mMutex);
-    if (mInitialSize != gfxIntSize(0,0) ||
+    if (mInitialSize != gfx::IntSize(0,0) ||
         aQueuedMedia.GetType() != MediaSegment::VIDEO) {
       return;
     }
     const VideoSegment& video = static_cast<const VideoSegment&>(aQueuedMedia);
     for (VideoSegment::ConstChunkIterator c(video); !c.IsEnded(); c.Next()) {
-      if (c->mFrame.GetIntrinsicSize() != gfxIntSize(0,0)) {
+      if (c->mFrame.GetIntrinsicSize() != gfx::IntSize(0,0)) {
         mInitialSize = c->mFrame.GetIntrinsicSize();
         nsCOMPtr<nsIRunnable> event =
           NS_NewRunnableMethod(this, &StreamSizeListener::ReceivedSize);
         aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
       }
     }
   }
 
 private:
   // These fields may only be accessed on the main thread
   HTMLMediaElement* mElement;
 
   // mMutex protects the fields below; they can be accessed on any thread
   Mutex mMutex;
-  gfxIntSize mInitialSize;
+  gfx::IntSize mInitialSize;
 };
 
 class HTMLMediaElement::MediaStreamTracksAvailableCallback:
     public DOMMediaStream::OnTracksAvailableCallback
 {
 public:
   explicit MediaStreamTracksAvailableCallback(HTMLMediaElement* aElement):
       DOMMediaStream::OnTracksAvailableCallback(),
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2172,17 +2172,17 @@ ContentChild::RecvAddPermission(const IP
                                    nsPermissionManager::eNotify,
                                    nsPermissionManager::eNoDBOperation);
 #endif
 
     return true;
 }
 
 bool
-ContentChild::RecvScreenSizeChanged(const gfxIntSize& size)
+ContentChild::RecvScreenSizeChanged(const gfx::IntSize& size)
 {
 #ifdef ANDROID
     mScreenSize = size;
 #else
     NS_RUNTIMEABORT("Message currently only expected on android");
 #endif
     return true;
 }
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -327,17 +327,17 @@ public:
     virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) override;
 
     virtual bool RecvGeolocationError(const uint16_t& errorCode) override;
 
     virtual bool RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries) override;
 
     virtual bool RecvAddPermission(const IPC::Permission& permission) override;
 
-    virtual bool RecvScreenSizeChanged(const gfxIntSize &size) override;
+    virtual bool RecvScreenSizeChanged(const gfx::IntSize &size) override;
 
     virtual bool RecvFlushMemory(const nsString& reason) override;
 
     virtual bool RecvActivateA11y() override;
 
     virtual bool RecvGarbageCollect() override;
     virtual bool RecvCycleCollect() override;
 
@@ -402,17 +402,17 @@ public:
     virtual bool RecvShutdown() override;
 
     virtual bool
     RecvInvokeDragSession(nsTArray<IPCDataTransfer>&& aTransfers,
                           const uint32_t& aAction) override;
     virtual bool RecvEndDragSession(const bool& aDoneDrag,
                                     const bool& aUserCancelled) override;
 #ifdef ANDROID
-    gfxIntSize GetScreenSize() { return mScreenSize; }
+    gfx::IntSize GetScreenSize() { return mScreenSize; }
 #endif
 
     // Get the directory for IndexedDB files. We query the parent for this and
     // cache the value
     nsString &GetIndexedDBPath();
 
     ContentParentId GetID() { return mID; }
 
@@ -497,17 +497,17 @@ private:
      * We expect our content parent to set this ID immediately after opening a
      * channel to us.
      */
     ContentParentId mID;
 
     AppInfo mAppInfo;
 
 #ifdef ANDROID
-    gfxIntSize mScreenSize;
+    gfx::IntSize mScreenSize;
 #endif
 
     bool mIsForApp;
     bool mIsForBrowser;
     bool mCanOverrideProcessName;
     bool mIsAlive;
     nsString mProcessName;
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2722,17 +2722,17 @@ ContentParent::RecvSetClipboard(const IP
         NS_ENSURE_SUCCESS(rv, true);
       } else if (item.data().type() == IPCDataTransferData::TnsCString) {
         if (item.flavor().EqualsLiteral(kNativeImageMime) ||
             item.flavor().EqualsLiteral(kJPEGImageMime) ||
             item.flavor().EqualsLiteral(kJPGImageMime) ||
             item.flavor().EqualsLiteral(kPNGImageMime) ||
             item.flavor().EqualsLiteral(kGIFImageMime)) {
           const IPCDataTransferImage& imageDetails = item.imageDetails();
-          const gfxIntSize size(imageDetails.width(), imageDetails.height());
+          const gfx::IntSize size(imageDetails.width(), imageDetails.height());
           if (!size.width || !size.height) {
             return true;
           }
 
           nsCString text = item.data().get_nsCString();
           mozilla::RefPtr<gfx::DataSourceSurface> image =
             new mozilla::gfx::SourceSurfaceRawData();
           mozilla::gfx::SourceSurfaceRawData* raw =
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -79,17 +79,17 @@ using base::ChildPrivileges from "base/p
 using base::ProcessId from "base/process.h";
 using struct IPC::Permission from "mozilla/net/NeckoMessageUtils.h";
 using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
 using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
 using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
 using mozilla::dom::quota::PersistenceType from "mozilla/dom/quota/PersistenceType.h";
 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
-using gfxIntSize from "nsSize.h";
+using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
 using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
 using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
 using class mozilla::dom::ipc::StructuredCloneData from "ipc/IPCMessageUtils.h";
 
 union ChromeRegistryItem
 {
     ChromePackage;
@@ -541,17 +541,17 @@ child:
 
     GeolocationError(uint16_t errorCode);
 
     UpdateDictionaryList(nsString[] dictionaries);
 
     // nsIPermissionManager messages
     AddPermission(Permission permission);
 
-    ScreenSizeChanged(gfxIntSize size);
+    ScreenSizeChanged(IntSize size);
 
     Volumes(VolumeInfo[] volumes);
 
     FlushMemory(nsString reason);
 
     GarbageCollect();
     CycleCollect();
 
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1974,17 +1974,17 @@ TabParent::RecvSetCustomCursor(const nsC
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (widget) {
     if (aForce) {
       widget->ClearCachedCursor();
     }
 
     if (mTabSetsCursor) {
-      const gfxIntSize size(aWidth, aHeight);
+      const gfx::IntSize size(aWidth, aHeight);
 
       mozilla::RefPtr<gfx::DataSourceSurface> customCursor = new mozilla::gfx::SourceSurfaceRawData();
       mozilla::gfx::SourceSurfaceRawData* raw = static_cast<mozilla::gfx::SourceSurfaceRawData*>(customCursor.get());
       raw->InitWrappingData(
         reinterpret_cast<uint8_t*>(const_cast<nsCString&>(aCursorData).BeginWriting()),
         size, aStride, static_cast<mozilla::gfx::SurfaceFormat>(aFormat), false);
       raw->GuaranteePersistance();
 
--- a/dom/media/VideoFrameContainer.cpp
+++ b/dom/media/VideoFrameContainer.cpp
@@ -24,39 +24,39 @@ VideoFrameContainer::VideoFrameContainer
 {
   NS_ASSERTION(aElement, "aElement must not be null");
   NS_ASSERTION(mImageContainer, "aContainer must not be null");
 }
 
 VideoFrameContainer::~VideoFrameContainer()
 {}
 
-void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize,
+void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize,
                                           Image* aImage,
                                           const TimeStamp& aTargetTime)
 {
   if (aImage) {
     MutexAutoLock lock(mMutex);
     nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
     imageList.AppendElement(
         ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID));
     SetCurrentFramesLocked(aIntrinsicSize, imageList);
   } else {
     ClearCurrentFrame(aIntrinsicSize);
   }
 }
 
-void VideoFrameContainer::SetCurrentFrames(const gfxIntSize& aIntrinsicSize,
+void VideoFrameContainer::SetCurrentFrames(const gfx::IntSize& aIntrinsicSize,
                                            const nsTArray<ImageContainer::NonOwningImage>& aImages)
 {
   MutexAutoLock lock(mMutex);
   SetCurrentFramesLocked(aIntrinsicSize, aImages);
 }
 
-void VideoFrameContainer::SetCurrentFramesLocked(const gfxIntSize& aIntrinsicSize,
+void VideoFrameContainer::SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicSize,
                                                  const nsTArray<ImageContainer::NonOwningImage>& aImages)
 {
   mMutex.AssertCurrentThreadOwns();
 
   if (aIntrinsicSize != mIntrinsicSize) {
     mIntrinsicSize = aIntrinsicSize;
     mIntrinsicSizeChanged = true;
   }
--- a/dom/media/VideoFrameContainer.h
+++ b/dom/media/VideoFrameContainer.h
@@ -37,21 +37,21 @@ public:
   typedef layers::Image Image;
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameContainer)
 
   VideoFrameContainer(dom::HTMLMediaElement* aElement,
                       already_AddRefed<ImageContainer> aContainer);
 
   // Call on any thread
-  B2G_ACL_EXPORT void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage,
+  B2G_ACL_EXPORT void SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage,
                        const TimeStamp& aTargetTime);
-  void SetCurrentFrames(const gfxIntSize& aIntrinsicSize,
+  void SetCurrentFrames(const gfx::IntSize& aIntrinsicSize,
                         const nsTArray<ImageContainer::NonOwningImage>& aImages);
-  void ClearCurrentFrame(const gfxIntSize& aIntrinsicSize)
+  void ClearCurrentFrame(const gfx::IntSize& aIntrinsicSize)
   {
     SetCurrentFrames(aIntrinsicSize, nsTArray<ImageContainer::NonOwningImage>());
   }
 
   void ClearCurrentFrame();
   // Make the current frame the only frame in the container, i.e. discard
   // all future frames.
   void ClearFutureFrames();
@@ -74,32 +74,32 @@ public:
     INVALIDATE_FORCE
   };
   void Invalidate() { InvalidateWithFlags(INVALIDATE_DEFAULT); }
   B2G_ACL_EXPORT void InvalidateWithFlags(uint32_t aFlags);
   B2G_ACL_EXPORT ImageContainer* GetImageContainer();
   void ForgetElement() { mElement = nullptr; }
 
 protected:
-  void SetCurrentFramesLocked(const gfxIntSize& aIntrinsicSize,
+  void SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicSize,
                               const nsTArray<ImageContainer::NonOwningImage>& aImages);
 
   // Non-addreffed pointer to the element. The element calls ForgetElement
   // to clear this reference when the element is destroyed.
   dom::HTMLMediaElement* mElement;
   nsRefPtr<ImageContainer> mImageContainer;
 
   // mMutex protects all the fields below.
   Mutex mMutex;
   // The intrinsic size is the ideal size which we should render the
   // ImageContainer's current Image at.
   // This can differ from the Image's actual size when the media resource
   // specifies that the Image should be stretched to have the correct aspect
   // ratio.
-  gfxIntSize mIntrinsicSize;
+  gfx::IntSize mIntrinsicSize;
   // We maintain our own mFrameID which is auto-incremented at every
   // SetCurrentFrame() or NewFrameID() call.
   ImageContainer::FrameID mFrameID;
   // True when the intrinsic size has been changed by SetCurrentFrame() since
   // the last call to Invalidate().
   // The next call to Invalidate() will recalculate
   // and update the intrinsic size on the element, request a frame reflow and
   // then reset this flag.
--- a/dom/media/VideoSegment.cpp
+++ b/dom/media/VideoSegment.cpp
@@ -9,44 +9,44 @@
 #include "ImageContainer.h"
 #include "Layers.h"
 
 namespace mozilla {
 
 using namespace layers;
 
 VideoFrame::VideoFrame(already_AddRefed<Image>& aImage,
-                       const gfxIntSize& aIntrinsicSize)
+                       const gfx::IntSize& aIntrinsicSize)
   : mImage(aImage), mIntrinsicSize(aIntrinsicSize), mForceBlack(false)
 {}
 
 VideoFrame::VideoFrame()
   : mIntrinsicSize(0, 0), mForceBlack(false)
 {}
 
 VideoFrame::~VideoFrame()
 {}
 
 void
 VideoFrame::SetNull() {
   mImage = nullptr;
-  mIntrinsicSize = gfxIntSize(0, 0);
+  mIntrinsicSize = gfx::IntSize(0, 0);
 }
 
 void
 VideoFrame::TakeFrom(VideoFrame* aFrame)
 {
   mImage = aFrame->mImage.forget();
   mIntrinsicSize = aFrame->mIntrinsicSize;
   mForceBlack = aFrame->GetForceBlack();
 }
 
 #if !defined(MOZILLA_XPCOMRT_API)
 /* static */ already_AddRefed<Image>
-VideoFrame::CreateBlackImage(const gfxIntSize& aSize)
+VideoFrame::CreateBlackImage(const gfx::IntSize& aSize)
 {
   nsRefPtr<ImageContainer> container;
   nsRefPtr<Image> image;
   container = LayerManager::CreateImageContainer();
   image = container->CreateImage(ImageFormat::PLANAR_YCBCR);
   if (!image) {
     MOZ_ASSERT(false);
     return nullptr;
--- a/dom/media/VideoSegment.h
+++ b/dom/media/VideoSegment.h
@@ -25,17 +25,17 @@ class Image;
 class VideoFrame {
 public:
 #if defined(MOZILLA_XPCOMRT_API)
   typedef mozilla::SimpleImageBuffer Image;
 #else
   typedef mozilla::layers::Image Image;
 #endif
 
-  VideoFrame(already_AddRefed<Image>& aImage, const gfxIntSize& aIntrinsicSize);
+  VideoFrame(already_AddRefed<Image>& aImage, const gfx::IntSize& aIntrinsicSize);
   VideoFrame();
   ~VideoFrame();
 
   bool operator==(const VideoFrame& aFrame) const
   {
     return mIntrinsicSize == aFrame.mIntrinsicSize &&
            mForceBlack == aFrame.mForceBlack &&
            ((mForceBlack && aFrame.mForceBlack) || mImage == aFrame.mImage);
@@ -43,31 +43,31 @@ public:
   bool operator!=(const VideoFrame& aFrame) const
   {
     return !operator==(aFrame);
   }
 
   Image* GetImage() const { return mImage; }
   void SetForceBlack(bool aForceBlack) { mForceBlack = aForceBlack; }
   bool GetForceBlack() const { return mForceBlack; }
-  const gfxIntSize& GetIntrinsicSize() const { return mIntrinsicSize; }
+  const gfx::IntSize& GetIntrinsicSize() const { return mIntrinsicSize; }
   void SetNull();
   void TakeFrom(VideoFrame* aFrame);
 
 #if !defined(MOZILLA_XPCOMRT_API)
   // Create a planar YCbCr black image.
-  static already_AddRefed<Image> CreateBlackImage(const gfxIntSize& aSize);
+  static already_AddRefed<Image> CreateBlackImage(const gfx::IntSize& aSize);
 #endif // !defined(MOZILLA_XPCOMRT_API)
 
 protected:
   // mImage can be null to indicate "no video" (aka "empty frame"). It can
   // still have an intrinsic size in this case.
   nsRefPtr<Image> mImage;
   // The desired size to render the video frame at.
-  gfxIntSize mIntrinsicSize;
+  gfx::IntSize mIntrinsicSize;
   bool mForceBlack;
 };
 
 struct VideoChunk {
   VideoChunk();
   ~VideoChunk();
   void SliceTo(StreamTime aStart, StreamTime aEnd)
   {
--- a/dom/media/android/AndroidMediaReader.cpp
+++ b/dom/media/android/AndroidMediaReader.cpp
@@ -74,17 +74,17 @@ nsresult AndroidMediaReader::ReadMetadat
 
     // Video track's frame sizes will not overflow. Activate the video track.
     mHasVideo = true;
     mInfo.mVideo.mDisplay = displaySize;
     mPicture = pictureRect;
     mInitialFrame = frameSize;
     VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
     if (container) {
-      container->ClearCurrentFrame(gfxIntSize(displaySize.width, displaySize.height));
+      container->ClearCurrentFrame(IntSize(displaySize.width, displaySize.height));
     }
   }
 
   if (mPlugin->HasAudio(mPlugin)) {
     int32_t numChannels, sampleRate;
     mPlugin->GetAudioParameters(mPlugin, &numChannels, &sampleRate);
     mHasAudio = true;
     mInfo.mAudio.mChannels = numChannels;
--- a/dom/media/encoder/TrackEncoder.cpp
+++ b/dom/media/encoder/TrackEncoder.cpp
@@ -192,17 +192,17 @@ VideoTrackEncoder::NotifyQueuedTrackChan
   if (!mInitialized) {
     mVideoInitCounter++;
     TRACK_LOG(LogLevel::Debug, ("Init the video encoder %d times", mVideoInitCounter));
     VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(video));
     while (!iter.IsEnded()) {
       VideoChunk chunk = *iter;
       if (!chunk.IsNull()) {
         gfx::IntSize imgsize = chunk.mFrame.GetImage()->GetSize();
-        gfxIntSize intrinsicSize = chunk.mFrame.GetIntrinsicSize();
+        gfx::IntSize intrinsicSize = chunk.mFrame.GetIntrinsicSize();
         nsresult rv = Init(imgsize.width, imgsize.height,
                            intrinsicSize.width, intrinsicSize.height,
                            aGraph->GraphRate());
         if (NS_FAILED(rv)) {
           LOG("[VideoTrackEncoder]: Fail to initialize the encoder!");
           NotifyCancel();
         }
         break;
--- a/dom/media/encoder/VP8TrackEncoder.cpp
+++ b/dom/media/encoder/VP8TrackEncoder.cpp
@@ -246,17 +246,17 @@ static bool isYUV444(const PlanarYCbCrIm
   return false;
 }
 
 nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk)
 {
   nsRefPtr<Image> img;
   if (aChunk.mFrame.GetForceBlack() || aChunk.IsNull()) {
     if (!mMuteFrame) {
-      mMuteFrame = VideoFrame::CreateBlackImage(gfxIntSize(mFrameWidth, mFrameHeight));
+      mMuteFrame = VideoFrame::CreateBlackImage(gfx::IntSize(mFrameWidth, mFrameHeight));
       MOZ_ASSERT(mMuteFrame);
     }
     img = mMuteFrame;
   } else {
     img = aChunk.mFrame.GetImage();
   }
 
   ImageFormat format = img->GetFormat();
--- a/dom/media/ogg/OggReader.cpp
+++ b/dom/media/ogg/OggReader.cpp
@@ -235,17 +235,17 @@ void OggReader::SetupTargetTheora(Theora
   nsIntSize frameSize(aTheoraState->mInfo.frame_width,
                       aTheoraState->mInfo.frame_height);
   if (IsValidVideoRegion(frameSize, picture, displaySize)) {
     // Video track's frame sizes will not overflow. Activate the video track.
     mPicture = picture;
 
     VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
     if (container) {
-      container->ClearCurrentFrame(gfxIntSize(displaySize.width, displaySize.height));
+      container->ClearCurrentFrame(IntSize(displaySize.width, displaySize.height));
     }
 
     // Copy Theora info data for time computations on other threads.
     memcpy(&mTheoraInfo, &aTheoraState->mInfo, sizeof(mTheoraInfo));
 
     mTheoraState = aTheoraState;
     mTheoraSerial = aTheoraState->mSerial;
   }
--- a/dom/media/omx/MediaCodecReader.cpp
+++ b/dom/media/omx/MediaCodecReader.cpp
@@ -739,17 +739,17 @@ MediaCodecReader::HandleResourceAllocate
   if (duration >= INT64_C(0)) {
     mInfo.mMetadataDuration = Some(TimeUnit::FromMicroseconds(duration));
   }
 
   // Video track's frame sizes will not overflow. Activate the video track.
   VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
   if (container) {
     container->ClearCurrentFrame(
-      gfxIntSize(mInfo.mVideo.mDisplay.width, mInfo.mVideo.mDisplay.height));
+      gfx::IntSize(mInfo.mVideo.mDisplay.width, mInfo.mVideo.mDisplay.height));
   }
 
   nsRefPtr<MetadataHolder> metadata = new MetadataHolder();
   metadata->mInfo = mInfo;
   metadata->mTags = nullptr;
 
 #ifdef MOZ_AUDIO_OFFLOAD
   CheckAudioOffload();
--- a/dom/media/omx/MediaOmxReader.cpp
+++ b/dom/media/omx/MediaOmxReader.cpp
@@ -302,17 +302,17 @@ void MediaOmxReader::HandleResourceAlloc
 
     // Video track's frame sizes will not overflow. Activate the video track.
     mHasVideo = true;
     mInfo.mVideo.mDisplay = displaySize;
     mPicture = pictureRect;
     mInitialFrame = frameSize;
     VideoFrameContainer* container = mDecoder->GetVideoFrameContainer();
     if (container) {
-      container->ClearCurrentFrame(gfxIntSize(displaySize.width, displaySize.height));
+      container->ClearCurrentFrame(IntSize(displaySize.width, displaySize.height));
     }
   }
 
   if (mOmxDecoder->HasAudio()) {
     int32_t numChannels, sampleRate;
     mOmxDecoder->GetAudioParameters(&numChannels, &sampleRate);
     mHasAudio = true;
     mInfo.mAudio.mChannels = numChannels;
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2582,17 +2582,17 @@ void nsPluginInstanceOwner::Paint(gfxCon
 
 #ifdef ANP_BITMAP_DRAWING_MODEL
   static nsRefPtr<gfxImageSurface> pluginSurface;
 
   if (pluginSurface == nullptr ||
       aFrameRect.width  != pluginSurface->Width() ||
       aFrameRect.height != pluginSurface->Height()) {
 
-    pluginSurface = new gfxImageSurface(gfxIntSize(aFrameRect.width, aFrameRect.height),
+    pluginSurface = new gfxImageSurface(gfx::IntSize(aFrameRect.width, aFrameRect.height),
                                         gfxImageFormat::ARGB32);
     if (!pluginSurface)
       return;
   }
 
   // Clears buffer.  I think this is needed.
   gfxUtils::ClearThebesSurface(pluginSurface);
 
--- a/dom/plugins/ipc/PPluginInstance.ipdl
+++ b/dom/plugins/ipc/PPluginInstance.ipdl
@@ -17,17 +17,17 @@ using NPError from "npapi.h";
 using struct mozilla::plugins::NPRemoteWindow from "mozilla/plugins/PluginMessageUtils.h";
 using struct mozilla::plugins::NPRemoteEvent from "mozilla/plugins/PluginMessageUtils.h";
 using NPRect from "npapi.h";
 using NPNURLVariable from "npapi.h";
 using NPCoordinateSpace from "npapi.h";
 using NPNVariable from "npapi.h";
 using mozilla::plugins::NativeWindowHandle from "mozilla/plugins/PluginMessageUtils.h";
 using gfxSurfaceType from "gfxTypes.h";
-using gfxIntSize from "nsSize.h";
+using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
 using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
 using mozilla::plugins::WindowsSharedMemoryHandle from "mozilla/plugins/PluginMessageUtils.h";
 using mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
 using nsIntRect from "nsRect.h";
 
 namespace mozilla {
 namespace plugins {
 
@@ -184,17 +184,17 @@ parent:
   //               could be used for partial render of layer to topLevel context
   // @param newSurface - remotable surface
   // @param prevSurface - if the previous surface was shared-memory, returns
   //                      the shmem for reuse
   sync Show(NPRect updatedRect, SurfaceDescriptor newSurface)
     returns (SurfaceDescriptor prevSurface);
 
   async PPluginSurface(WindowsSharedMemoryHandle handle,
-                       gfxIntSize size,
+                       IntSize size,
                        bool transparent);
 
   intr NPN_PushPopupsEnabledState(bool aState);
 
   intr NPN_PopPopupsEnabledState();
 
   intr NPN_GetValueForURL(NPNURLVariable variable, nsCString url)
     returns (nsCString value, NPError result);
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2856,30 +2856,28 @@ PluginInstanceChild::CreateOptSurface(vo
         format = gfxImageFormat::RGB16_565;
     }
 
     if (mSurfaceType == gfxSurfaceType::Xlib) {
         if (!mIsTransparent  || mBackground) {
             Visual* defaultVisual = DefaultVisualOfScreen(screen);
             mCurrentSurface =
                 gfxXlibSurface::Create(screen, defaultVisual,
-                                       gfxIntSize(mWindow.width,
-                                                  mWindow.height));
+                                       IntSize(mWindow.width, mWindow.height));
             return mCurrentSurface != nullptr;
         }
 
         XRenderPictFormat* xfmt = XRenderFindStandardFormat(dpy, PictStandardARGB32);
         if (!xfmt) {
             NS_ERROR("Need X falback surface, but FindRenderFormat failed");
             return false;
         }
         mCurrentSurface =
             gfxXlibSurface::Create(screen, xfmt,
-                                   gfxIntSize(mWindow.width,
-                                              mWindow.height));
+                                   IntSize(mWindow.width, mWindow.height));
         return mCurrentSurface != nullptr;
     }
 #endif
 
 #ifdef XP_WIN
     if (mSurfaceType == gfxSurfaceType::Win32) {
         bool willHaveTransparentPixels = mIsTransparent && !mBackground;
 
@@ -2893,17 +2891,17 @@ PluginInstanceChild::CreateOptSurface(vo
         return true;
     }
 
     NS_RUNTIMEABORT("Shared-memory drawing not expected on Windows.");
 #endif
 
     // Make common shmem implementation working for any platform
     mCurrentSurface =
-        gfxSharedImageSurface::CreateUnsafe(this, gfxIntSize(mWindow.width, mWindow.height), format);
+        gfxSharedImageSurface::CreateUnsafe(this, IntSize(mWindow.width, mWindow.height), format);
     return !!mCurrentSurface;
 }
 
 bool
 PluginInstanceChild::MaybeCreatePlatformHelperSurface(void)
 {
     if (!mCurrentSurface) {
         NS_ERROR("Cannot create helper surface without mCurrentSurface");
@@ -2961,29 +2959,29 @@ PluginInstanceChild::MaybeCreatePlatform
     return true;
 }
 
 bool
 PluginInstanceChild::EnsureCurrentBuffer(void)
 {
 #ifndef XP_DARWIN
     nsIntRect toInvalidate(0, 0, 0, 0);
-    gfxIntSize winSize = gfxIntSize(mWindow.width, mWindow.height);
+    IntSize winSize = IntSize(mWindow.width, mWindow.height);
 
     if (mBackground && mBackground->GetSize() != winSize) {
         // It would be nice to keep the old background here, but doing
         // so can lead to cases in which we permanently keep the old
         // background size.
         mBackground = nullptr;
         toInvalidate.UnionRect(toInvalidate,
                                nsIntRect(0, 0, winSize.width, winSize.height));
     }
 
     if (mCurrentSurface) {
-        gfxIntSize surfSize = mCurrentSurface->GetSize();
+        IntSize surfSize = mCurrentSurface->GetSize();
         if (winSize != surfSize ||
             (mBackground && !CanPaintOnBackground()) ||
             (mBackground &&
              gfxContentType::COLOR != mCurrentSurface->GetContentType()) ||
             (!mBackground && mIsTransparent &&
              gfxContentType::COLOR == mCurrentSurface->GetContentType())) {
             // Don't try to use an old, invalid DC.
             mWindow.window = nullptr;
@@ -3304,17 +3302,17 @@ PluginInstanceChild::PaintRectWithAlphaE
                 gfxAlphaRecovery::AlignRectForSubimageRecovery(aRect,
                                                                surfaceAsImage);
         }
     }
 
     nsRefPtr<gfxImageSurface> whiteImage;
     nsRefPtr<gfxImageSurface> blackImage;
     gfxRect targetRect(rect.x, rect.y, rect.width, rect.height);
-    gfxIntSize targetSize(rect.width, rect.height);
+    IntSize targetSize(rect.width, rect.height);
     gfxPoint deviceOffset = -targetRect.TopLeft();
 
     // We always use a temporary "white image"
     whiteImage = new gfxImageSurface(targetSize, gfxImageFormat::RGB24);
     if (whiteImage->CairoStatus()) {
         return;
     }
 
@@ -3482,17 +3480,17 @@ PluginInstanceChild::ShowPluginFrame()
 
     // Clear accRect here to be able to pass
     // test_invalidate_during_plugin_paint  test
     nsIntRect rect = mAccumulatedInvalidRect;
     mAccumulatedInvalidRect.SetEmpty();
 
     // Fix up old invalidations that might have been made when our
     // surface was a different size
-    gfxIntSize surfaceSize = mCurrentSurface->GetSize();
+    IntSize surfaceSize = mCurrentSurface->GetSize();
     rect.IntersectRect(rect,
                        nsIntRect(0, 0, surfaceSize.width, surfaceSize.height));
 
     if (!ReadbackDifferenceRect(rect)) {
         // We couldn't read back the pixels that differ between the
         // current surface and last, so we have to invalidate the
         // entire window.
         rect.SetRect(0, 0, mWindow.width, mWindow.height);
@@ -3744,17 +3742,17 @@ PluginInstanceChild::RecvUpdateBackgroun
         default:
             NS_RUNTIMEABORT("Unexpected background surface descriptor");
         }
 
         if (!mBackground) {
             return false;
         }
 
-        gfxIntSize bgSize = mBackground->GetSize();
+        IntSize bgSize = mBackground->GetSize();
         mAccumulatedInvalidRect.UnionRect(mAccumulatedInvalidRect,
                                           nsIntRect(0, 0, bgSize.width, bgSize.height));
         AsyncShowPluginFrame();
         return true;
     }
 
     // XXX refactor me
     mAccumulatedInvalidRect.UnionRect(aRect, mAccumulatedInvalidRect);
@@ -3781,17 +3779,17 @@ PluginInstanceChild::RecvPPluginBackgrou
     // destroyed because we have a new background, then we expect to
     // be notified of that "soon", before processing the asynchronous
     // invalidation here.  If we're *not* getting a new background,
     // our current front surface is stale and we want to repaint
     // "soon" so that we can hand the browser back a surface with
     // alpha values.  (We should be notified of that invalidation soon
     // too, but we don't assume that here.)
     if (mBackground) {
-        gfxIntSize bgsize = mBackground->GetSize();
+        IntSize bgsize = mBackground->GetSize();
         mAccumulatedInvalidRect.UnionRect(
             nsIntRect(0, 0, bgsize.width, bgsize.height), mAccumulatedInvalidRect);
 
         // NB: we don't have to XSync here because only ShowPluginFrame()
         // uses mBackground, and it always XSyncs after finishing.
         mBackground = nullptr;
         AsyncShowPluginFrame();
     }
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -108,17 +108,17 @@ protected:
 
     virtual void
     DoAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
                      const NPRemoteWindow& aWindow,
                      bool aIsAsync);
 
     virtual PPluginSurfaceChild*
     AllocPPluginSurfaceChild(const WindowsSharedMemoryHandle&,
-                             const gfxIntSize&, const bool&) override {
+                             const gfx::IntSize&, const bool&) override {
         return new PPluginSurfaceChild();
     }
 
     virtual bool DeallocPPluginSurfaceChild(PPluginSurfaceChild* s) override {
         delete s;
         return true;
     }
 
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -721,17 +721,17 @@ PluginInstanceParent::GetImageContainer(
     *aContainer = container;
     return NS_OK;
 }
 
 nsresult
 PluginInstanceParent::GetImageSize(nsIntSize* aSize)
 {
     if (mFrontSurface) {
-        gfxIntSize size = mFrontSurface->GetSize();
+        mozilla::gfx::IntSize size = mFrontSurface->GetSize();
         *aSize = nsIntSize(size.width, size.height);
         return NS_OK;
     }
 
 #ifdef XP_MACOSX
     if (mFrontIOSurface) {
         *aSize = nsIntSize(mFrontIOSurface->GetWidth(), mFrontIOSurface->GetHeight());
         return NS_OK;
@@ -790,17 +790,17 @@ PluginInstanceParent::BeginUpdateBackgro
         MOZ_ASSERT(aRect.TopLeft() == nsIntPoint(0, 0),
                    "Expecting rect for whole frame");
         if (!CreateBackground(aRect.Size())) {
             *aCtx = nullptr;
             return NS_OK;
         }
     }
 
-    gfxIntSize sz = mBackground->GetSize();
+    mozilla::gfx::IntSize sz = mBackground->GetSize();
 #ifdef DEBUG
     MOZ_ASSERT(nsIntRect(0, 0, sz.width, sz.height).Contains(aRect),
                "Update outside of background area");
 #endif
 
     RefPtr<gfx::DrawTarget> dt = gfxPlatform::GetPlatform()->
       CreateDrawTargetForSurface(mBackground, gfx::IntSize(sz.width, sz.height));
     nsRefPtr<gfxContext> ctx = new gfxContext(dt);
@@ -847,26 +847,26 @@ PluginInstanceParent::CreateBackground(c
     MOZ_ASSERT(!mBackground, "Already have a background");
 
     // XXX refactor me
 
 #if defined(MOZ_X11)
     Screen* screen = DefaultScreenOfDisplay(DefaultXDisplay());
     Visual* visual = DefaultVisualOfScreen(screen);
     mBackground = gfxXlibSurface::Create(screen, visual,
-                                         gfxIntSize(aSize.width, aSize.height));
+                                         mozilla::gfx::IntSize(aSize.width, aSize.height));
     return !!mBackground;
 
 #elif defined(XP_WIN)
     // We have chosen to create an unsafe surface in which the plugin
     // can read from the region while we're writing to it.
     mBackground =
         gfxSharedImageSurface::CreateUnsafe(
             this,
-            gfxIntSize(aSize.width, aSize.height),
+            mozilla::gfx::IntSize(aSize.width, aSize.height),
             gfxImageFormat::RGB24);
     return !!mBackground;
 #else
     return false;
 #endif
 }
 
 void
@@ -1595,17 +1595,17 @@ PluginInstanceParent::GetActorForNPObjec
     }
 
     actor->InitializeLocal(aObject);
     return actor;
 }
 
 PPluginSurfaceParent*
 PluginInstanceParent::AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
-                                                const gfxIntSize& size,
+                                                const mozilla::gfx::IntSize& size,
                                                 const bool& transparent)
 {
 #ifdef XP_WIN
     return new PluginSurfaceParent(handle, size, transparent);
 #else
     NS_ERROR("This shouldn't be called!");
     return nullptr;
 #endif
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -164,17 +164,17 @@ public:
     // Async rendering
     virtual bool
     RecvShow(const NPRect& updatedRect,
              const SurfaceDescriptor& newSurface,
              SurfaceDescriptor* prevSurface) override;
 
     virtual PPluginSurfaceParent*
     AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
-                              const gfxIntSize& size,
+                              const mozilla::gfx::IntSize& size,
                               const bool& transparent) override;
 
     virtual bool
     DeallocPPluginSurfaceParent(PPluginSurfaceParent* s) override;
 
     virtual bool
     AnswerNPN_PushPopupsEnabledState(const bool& aState) override;
 
--- a/dom/plugins/ipc/PluginSurfaceParent.cpp
+++ b/dom/plugins/ipc/PluginSurfaceParent.cpp
@@ -7,17 +7,17 @@
 #include "mozilla/gfx/SharedDIBSurface.h"
 
 using mozilla::gfx::SharedDIBSurface;
 
 namespace mozilla {
 namespace plugins {
 
 PluginSurfaceParent::PluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
-                                         const gfxIntSize& size,
+                                         const gfx::IntSize& size,
                                          bool transparent)
 {
   SharedDIBSurface* dibsurf = new SharedDIBSurface();
   if (dibsurf->Attach(handle, size.width, size.height, transparent))
     mSurface = dibsurf;
 }
 
 PluginSurfaceParent::~PluginSurfaceParent()
--- a/dom/plugins/ipc/PluginSurfaceParent.h
+++ b/dom/plugins/ipc/PluginSurfaceParent.h
@@ -18,17 +18,17 @@ class gfxASurface;
 
 namespace mozilla {
 namespace plugins {
 
 class PluginSurfaceParent : public PPluginSurfaceParent
 {
 public:
   PluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
-                      const gfxIntSize& size,
+                      const gfx::IntSize& size,
                       const bool transparent);
   ~PluginSurfaceParent();
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   gfxASurface* Surface() { return mSurface; }
 
 private:
--- a/gfx/src/nsSize.h
+++ b/gfx/src/nsSize.h
@@ -9,17 +9,16 @@
 #include "nsCoord.h"
 #include "mozilla/gfx/BaseSize.h"
 #include "mozilla/gfx/Point.h"
 
 // Maximum allowable size
 #define NS_MAXSIZE nscoord_MAX
 
 typedef mozilla::gfx::IntSize nsIntSize;
-typedef nsIntSize gfxIntSize;
 
 struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
   typedef mozilla::gfx::BaseSize<nscoord, nsSize> Super;
 
   nsSize() : Super() {}
   nsSize(nscoord aWidth, nscoord aHeight) : Super(aWidth, aHeight) {}
 
   inline mozilla::gfx::IntSize ScaleToNearestPixels(float aXScale, float aYScale,
--- a/gfx/thebes/gfxBlur.cpp
+++ b/gfx/thebes/gfxBlur.cpp
@@ -169,20 +169,20 @@ struct BlurCacheKey : public PLDHashEntr
   IntSize mBlurRadius;
   gfxRGBA mShadowColor;
   BackendType mBackend;
   RectCornerRadii mCornerRadii;
   bool mIsInset;
 
   // Only used for inset blurs
   bool mHasBorderRadius;
-  gfxIntSize mSpreadRadius;
+  IntSize mSpreadRadius;
   IntSize mInnerMinSize;
 
-  BlurCacheKey(IntSize aMinSize, gfxIntSize aBlurRadius,
+  BlurCacheKey(IntSize aMinSize, IntSize aBlurRadius,
                RectCornerRadii* aCornerRadii, gfxRGBA aShadowColor,
                BackendType aBackendType)
     : BlurCacheKey(aMinSize, IntSize(0, 0),
                    aBlurRadius, IntSize(0, 0),
                    aCornerRadii, aShadowColor,
                    false, false, aBackendType)
   {}
 
@@ -194,17 +194,17 @@ struct BlurCacheKey : public PLDHashEntr
     , mCornerRadii(aOther->mCornerRadii)
     , mIsInset(aOther->mIsInset)
     , mHasBorderRadius(aOther->mHasBorderRadius)
     , mSpreadRadius(aOther->mSpreadRadius)
     , mInnerMinSize(aOther->mInnerMinSize)
   { }
 
   explicit BlurCacheKey(IntSize aOuterMinSize, IntSize aInnerMinSize,
-                        gfxIntSize aBlurRadius, gfxIntSize aSpreadRadius,
+                        IntSize aBlurRadius, IntSize aSpreadRadius,
                         const RectCornerRadii* aCornerRadii, gfxRGBA aShadowColor,
                         bool aIsInset,
                         bool aHasBorderRadius, BackendType aBackendType)
     : mMinSize(aOuterMinSize)
     , mBlurRadius(aBlurRadius)
     , mShadowColor(aShadowColor)
     , mBackend(aBackendType)
     , mCornerRadii(aCornerRadii ? *aCornerRadii : RectCornerRadii())
@@ -311,17 +311,17 @@ class BlurCache final : public nsExpirat
 
     virtual void NotifyExpired(BlurCacheData* aObject)
     {
       RemoveObject(aObject);
       mHashEntries.Remove(aObject->mKey);
     }
 
     BlurCacheData* Lookup(const IntSize aMinSize,
-                          const gfxIntSize& aBlurRadius,
+                          const IntSize& aBlurRadius,
                           RectCornerRadii* aCornerRadii,
                           const gfxRGBA& aShadowColor,
                           BackendType aBackendType)
     {
       BlurCacheData* blur =
         mHashEntries.Get(BlurCacheKey(aMinSize, aBlurRadius,
                                       aCornerRadii, aShadowColor,
                                       aBackendType));
@@ -329,18 +329,18 @@ class BlurCache final : public nsExpirat
         MarkUsed(blur);
       }
 
       return blur;
     }
 
     BlurCacheData* LookupInsetBoxShadow(const IntSize aOuterMinSize,
                                         const IntSize aInnerMinSize,
-                                        const gfxIntSize& aBlurRadius,
-                                        const gfxIntSize& aSpreadRadius,
+                                        const IntSize& aBlurRadius,
+                                        const IntSize& aSpreadRadius,
                                         const RectCornerRadii* aCornerRadii,
                                         const gfxRGBA& aShadowColor,
                                         const bool& aHasBorderRadius,
                                         BackendType aBackendType)
     {
       BlurCacheKey key(aOuterMinSize, aInnerMinSize,
                        aBlurRadius, aSpreadRadius,
                        aCornerRadii, aShadowColor,
@@ -378,17 +378,17 @@ class BlurCache final : public nsExpirat
      */
     nsClassHashtable<BlurCacheKey, BlurCacheData> mHashEntries;
 };
 
 static BlurCache* gBlurCache = nullptr;
 
 static IntSize
 ComputeMinSizeForShadowShape(RectCornerRadii* aCornerRadii,
-                             gfxIntSize aBlurRadius,
+                             IntSize aBlurRadius,
                              IntMargin& aSlice,
                              const IntSize& aRectSize)
 {
   float cornerWidth = 0;
   float cornerHeight = 0;
   if (aCornerRadii) {
     RectCornerRadii corners = *aCornerRadii;
     for (size_t i = 0; i < 4; i++) {
@@ -425,45 +425,45 @@ ComputeMinSizeForShadowShape(RectCornerR
   MOZ_ASSERT(aSlice.LeftRight() <= minSize.width);
   MOZ_ASSERT(aSlice.TopBottom() <= minSize.height);
   return minSize;
 }
 
 void
 CacheBlur(DrawTarget& aDT,
           const IntSize& aMinSize,
-          const gfxIntSize& aBlurRadius,
+          const IntSize& aBlurRadius,
           RectCornerRadii* aCornerRadii,
           const gfxRGBA& aShadowColor,
           IntMargin aExtendDest,
           SourceSurface* aBoxShadow)
 {
   BlurCacheKey key(aMinSize, aBlurRadius, aCornerRadii, aShadowColor, aDT.GetBackendType());
   BlurCacheData* data = new BlurCacheData(aBoxShadow, aExtendDest, key);
   if (!gBlurCache->RegisterEntry(data)) {
     delete data;
   }
 }
 
 // Blurs a small surface and creates the mask.
 static already_AddRefed<SourceSurface>
 CreateBlurMask(const IntSize& aRectSize,
                RectCornerRadii* aCornerRadii,
-               gfxIntSize aBlurRadius,
+               IntSize aBlurRadius,
                IntMargin& aExtendDestBy,
                IntMargin& aSliceBorder,
                DrawTarget& aDestDrawTarget)
 {
   IntMargin slice;
   gfxAlphaBoxBlur blur;
   IntSize minSize =
     ComputeMinSizeForShadowShape(aCornerRadii, aBlurRadius, slice, aRectSize);
   IntRect minRect(IntPoint(), minSize);
 
-  gfxContext* blurCtx = blur.Init(ThebesRect(Rect(minRect)), gfxIntSize(),
+  gfxContext* blurCtx = blur.Init(ThebesRect(Rect(minRect)), IntSize(),
                                   aBlurRadius, nullptr, nullptr);
 
   if (!blurCtx) {
     return nullptr;
   }
 
   DrawTarget* blurDT = blurCtx->GetDrawTarget();
   ColorPattern black(Color(0.f, 0.f, 0.f, 1.f));
@@ -507,17 +507,17 @@ CreateBoxShadow(SourceSurface* aBlurMask
   ColorPattern shadowColor(ToDeviceColor(aShadowColor));
   boxShadowDT->MaskSurface(shadowColor, aBlurMask, Point(0, 0));
   return boxShadowDT->Snapshot();
 }
 
 static SourceSurface*
 GetBlur(DrawTarget& aDT,
         const IntSize& aRectSize,
-        const gfxIntSize& aBlurRadius,
+        const IntSize& aBlurRadius,
         RectCornerRadii* aCornerRadii,
         const gfxRGBA& aShadowColor,
         IntMargin& aExtendDestBy,
         IntMargin& aSlice)
 {
   if (!gBlurCache) {
     gBlurCache = new BlurCache();
   }
@@ -780,25 +780,25 @@ GetBoxShadowInsetPath(DrawTarget* aDrawT
     AppendRoundedRectToPath(builder, aInnerRect, aInnerClipRadii, false);
   } else {
     AppendRectToPath(builder, aInnerRect, false);
   }
   return builder->Finish();
 }
 
 static void
-ComputeRectsForInsetBoxShadow(gfxIntSize aBlurRadius,
-                              gfxIntSize aSpreadRadius,
+ComputeRectsForInsetBoxShadow(IntSize aBlurRadius,
+                              IntSize aSpreadRadius,
                               Rect& aOutOuterRect,
                               Rect& aOutInnerRect,
                               Margin& aOutPathMargins,
                               const Rect& aDestRect,
                               const Rect& aShadowClipRect)
 {
-  gfxIntSize marginSize = aBlurRadius + aSpreadRadius;
+  IntSize marginSize = aBlurRadius + aSpreadRadius;
   aOutPathMargins.SizeTo(marginSize.height, marginSize.width, marginSize.height, marginSize.width);
   aOutPathMargins += aOutPathMargins;
 
   aOutOuterRect.x = 0;
   aOutInnerRect.x = marginSize.width;
 
   aOutOuterRect.y = 0;
   aOutInnerRect.y = marginSize.height;
@@ -842,18 +842,18 @@ FillDestinationPath(gfxContext* aDestina
 
   aDestinationCtx->SetPath(shadowPath);
   aDestinationCtx->Fill();
 }
 
 void
 CacheInsetBlur(const IntSize aMinOuterSize,
                const IntSize aMinInnerSize,
-               const gfxIntSize& aBlurRadius,
-               const gfxIntSize& aSpreadRadius,
+               const IntSize& aBlurRadius,
+               const IntSize& aSpreadRadius,
                const RectCornerRadii* aCornerRadii,
                const gfxRGBA& aShadowColor,
                const bool& aHasBorderRadius,
                BackendType aBackendType,
                IntMargin aExtendBy,
                SourceSurface* aBoxShadow)
 {
   BlurCacheKey key(aMinOuterSize, aMinInnerSize,
@@ -864,31 +864,31 @@ CacheInsetBlur(const IntSize aMinOuterSi
   if (!gBlurCache->RegisterEntry(data)) {
     delete data;
   }
 }
 
 already_AddRefed<mozilla::gfx::SourceSurface>
 gfxAlphaBoxBlur::GetInsetBlur(Rect& aOuterRect,
                               Rect& aInnerRect,
-                              const gfxIntSize& aBlurRadius,
-                              const gfxIntSize& aSpreadRadius,
+                              const IntSize& aBlurRadius,
+                              const IntSize& aSpreadRadius,
                               const RectCornerRadii& aInnerClipRadii,
                               const Color& aShadowColor,
                               const bool& aHasBorderRadius,
                               IntPoint& aOutTopLeft,
                               gfxContext* aDestinationCtx)
 
 {
   if (!gBlurCache) {
     gBlurCache = new BlurCache();
   }
 
-  gfxIntSize outerRectSize = RoundedToInt(aOuterRect).Size();
-  gfxIntSize innerRectSize = RoundedToInt(aInnerRect).Size();
+  IntSize outerRectSize = RoundedToInt(aOuterRect).Size();
+  IntSize innerRectSize = RoundedToInt(aInnerRect).Size();
   DrawTarget* destDrawTarget = aDestinationCtx->GetDrawTarget();
 
   BlurCacheData* cached =
       gBlurCache->LookupInsetBoxShadow(outerRectSize, innerRectSize, aBlurRadius, aSpreadRadius,
                                        &aInnerClipRadii, ThebesColor(aShadowColor),
                                        aHasBorderRadius, destDrawTarget->GetBackendType());
 
   if (cached) {
@@ -898,17 +898,17 @@ gfxAlphaBoxBlur::GetInsetBlur(Rect& aOut
     // So we don't forget the actual cached blur
     RefPtr<SourceSurface> cachedBlur = cached->mBlur;
     return cachedBlur.forget();
   }
 
   // Dirty rect and skip rect are null for the min inset shadow.
   // When rendering inset box shadows, we respect the spread radius by changing
   //  the shape of the unblurred shadow, and can pass a spread radius of zero here.
-  gfxIntSize zeroSpread(0, 0);
+  IntSize zeroSpread(0, 0);
   gfxContext* minGfxContext = Init(ThebesRect(aOuterRect), zeroSpread, aBlurRadius, nullptr, nullptr);
   if (!minGfxContext) {
     return nullptr;
   }
 
   DrawTarget* minDrawTarget = minGfxContext->GetDrawTarget();
   RefPtr<Path> maskPath = GetBoxShadowInsetPath(minDrawTarget, aOuterRect,
                                                 aInnerRect, aHasBorderRadius,
@@ -946,18 +946,18 @@ gfxAlphaBoxBlur::GetInsetBlur(Rect& aOut
  *    proper alpha mask, but let the clip deal with the clean edges.
  *
  * All parameters should already be in device pixels.
  */
 void
 gfxAlphaBoxBlur::BlurInsetBox(gfxContext* aDestinationCtx,
                               const Rect aDestinationRect,
                               const Rect aShadowClipRect,
-                              const gfxIntSize aBlurRadius,
-                              const gfxIntSize aSpreadRadius,
+                              const IntSize aBlurRadius,
+                              const IntSize aSpreadRadius,
                               const Color& aShadowColor,
                               bool aHasBorderRadius,
                               const RectCornerRadii& aInnerClipRadii,
                               const Rect aSkipRect)
 {
   // Blur inset shadows ALWAYS have a 0 spread radius.
   if ((aBlurRadius.width <= 0 && aBlurRadius.height <= 0)) {
     FillDestinationPath(aDestinationCtx, aDestinationRect, aShadowClipRect,
--- a/gfx/thebes/gfxBlur.h
+++ b/gfx/thebes/gfxBlur.h
@@ -150,29 +150,29 @@ public:
      * @param aShadowColor        The color of the blur.
      * @param aHasBorderRadius    If this element also has a border radius
      * @param aInnerClipRadii     Corner radii for the inside rect if it is a rounded rect.
      * @param aSKipRect           An area in device pixels we don't have to paint in.
      */
     void BlurInsetBox(gfxContext* aDestinationCtx,
                       const mozilla::gfx::Rect aDestinationRect,
                       const mozilla::gfx::Rect aShadowClipRect,
-                      const gfxIntSize aBlurRadius,
-                      const gfxIntSize aSpreadRadius,
+                      const mozilla::gfx::IntSize aBlurRadius,
+                      const mozilla::gfx::IntSize aSpreadRadius,
                       const mozilla::gfx::Color& aShadowColor,
                       const bool aHasBorderRadius,
                       const RectCornerRadii& aInnerClipRadii,
                       const mozilla::gfx::Rect aSkipRect);
 
 protected:
     already_AddRefed<mozilla::gfx::SourceSurface>
                    GetInsetBlur(mozilla::gfx::Rect& aOuterRect,
                                 mozilla::gfx::Rect& aInnerRect,
-                                const gfxIntSize& aBlurRadius,
-                                const gfxIntSize& aSpreadRadius,
+                                const mozilla::gfx::IntSize& aBlurRadius,
+                                const mozilla::gfx::IntSize& aSpreadRadius,
                                 const RectCornerRadii& aInnerClipRadii,
                                 const mozilla::gfx::Color& aShadowColor,
                                 const bool& aHasBorderRadius,
                                 mozilla::gfx::IntPoint& aOutTopLeft,
                                 gfxContext* aDestinationCtx);
 
     /**
      * The context of the temporary alpha surface.
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -658,18 +658,18 @@ PrescaleAndTileDrawable(gfxDrawable* aDr
     return false;
   }
 
   Rect scaledImageRect = ToMatrix(scaleMatrix).TransformBounds(aImageRect);
   if (!ShouldUseTempSurface(scaledImageRect, scaledNeededRect)) {
     return false;
   }
 
-  gfxIntSize scaledImageSize((int32_t)scaledImageRect.width,
-                             (int32_t)scaledImageRect.height);
+  IntSize scaledImageSize((int32_t)scaledImageRect.width,
+                          (int32_t)scaledImageRect.height);
   if (scaledImageSize.width != scaledImageRect.width ||
       scaledImageSize.height != scaledImageRect.height) {
     // If the scaled image isn't pixel aligned, we'll get artifacts
     // so we have to take the slow path.
     return false;
   }
 
   RefPtr<DrawTarget> scaledDT =
--- a/image/DynamicImage.cpp
+++ b/image/DynamicImage.cpp
@@ -125,25 +125,25 @@ DynamicImage::GetHeight(int32_t* aHeight
 {
   *aHeight = mDrawable->Size().height;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DynamicImage::GetIntrinsicSize(nsSize* aSize)
 {
-  gfxIntSize intSize(mDrawable->Size());
+  IntSize intSize(mDrawable->Size());
   *aSize = nsSize(intSize.width, intSize.height);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DynamicImage::GetIntrinsicRatio(nsSize* aSize)
 {
-  gfxIntSize intSize(mDrawable->Size());
+  IntSize intSize(mDrawable->Size());
   *aSize = nsSize(intSize.width, intSize.height);
   return NS_OK;
 }
 
 NS_IMETHODIMP_(Orientation)
 DynamicImage::GetOrientation()
 {
   return Orientation();
@@ -162,17 +162,17 @@ DynamicImage::GetAnimated(bool* aAnimate
   *aAnimated = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
 DynamicImage::GetFrame(uint32_t aWhichFrame,
                        uint32_t aFlags)
 {
-  gfxIntSize size(mDrawable->Size());
+  IntSize size(mDrawable->Size());
   return GetFrameAtSize(IntSize(size.width, size.height),
                         aWhichFrame,
                         aFlags);
 }
 
 NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
 DynamicImage::GetFrameAtSize(const IntSize& aSize,
                              uint32_t aWhichFrame,
@@ -220,17 +220,17 @@ DynamicImage::Draw(gfxContext* aContext,
                    const ImageRegion& aRegion,
                    uint32_t aWhichFrame,
                    GraphicsFilter aFilter,
                    const Maybe<SVGImageContext>& aSVGContext,
                    uint32_t aFlags)
 {
   MOZ_ASSERT(!aSize.IsEmpty(), "Unexpected empty size");
 
-  gfxIntSize drawableSize(mDrawable->Size());
+  IntSize drawableSize(mDrawable->Size());
 
   if (aSize == drawableSize) {
     gfxUtils::DrawPixelSnapped(aContext, mDrawable, drawableSize, aRegion,
                                SurfaceFormat::B8G8R8A8, aFilter);
     return DrawResult::SUCCESS;
   }
 
   gfxSize scale(double(aSize.width) / drawableSize.width,
@@ -322,17 +322,17 @@ NS_IMETHODIMP_(void)
 DynamicImage::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
 { }
 
 nsIntSize
 DynamicImage::OptimalImageSizeForDest(const gfxSize& aDest,
                                       uint32_t aWhichFrame,
                                       GraphicsFilter aFilter, uint32_t aFlags)
 {
-  gfxIntSize size(mDrawable->Size());
+  IntSize size(mDrawable->Size());
   return nsIntSize(size.width, size.height);
 }
 
 NS_IMETHODIMP_(nsIntRect)
 DynamicImage::GetImageSpaceInvalidationRect(const nsIntRect& aRect)
 {
   return aRect;
 }
--- a/image/OrientedImage.cpp
+++ b/image/OrientedImage.cpp
@@ -76,17 +76,17 @@ OrientedImage::GetFrame(uint32_t aWhichF
 {
   nsresult rv;
 
   if (mOrientation.IsIdentity()) {
     return InnerImage()->GetFrame(aWhichFrame, aFlags);
   }
 
   // Get the underlying dimensions.
-  gfxIntSize size;
+  IntSize size;
   rv = InnerImage()->GetWidth(&size.width);
   NS_ENSURE_SUCCESS(rv, nullptr);
   rv = InnerImage()->GetHeight(&size.height);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   // Determine an appropriate format for the surface.
   gfx::SurfaceFormat surfaceFormat;
   if (InnerImage()->IsOpaque()) {
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -534,17 +534,17 @@ imgFrame::SurfaceForDrawing(bool        
 
   // Not tiling, and we have a surface, so we can account for
   // padding and/or a partial decode just by twiddling parameters.
   gfxPoint paddingTopLeft(aPadding.left, aPadding.top);
   aRegion = aRegion.Intersect(available) - paddingTopLeft;
   aContext->Multiply(gfxMatrix::Translation(paddingTopLeft));
   aImageRect = gfxRect(0, 0, mSize.width, mSize.height);
 
-  gfxIntSize availableSize(mDecoded.width, mDecoded.height);
+  IntSize availableSize(mDecoded.width, mDecoded.height);
   return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, availableSize),
                            mFormat);
 }
 
 bool imgFrame::Draw(gfxContext* aContext, const ImageRegion& aRegion,
                     GraphicsFilter aFilter, uint32_t aImageFlags)
 {
   PROFILER_LABEL("imgFrame", "Draw",
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -4779,17 +4779,17 @@ nsImageRenderer::ComputeIntrinsicSize()
           result.SetSize(
             IntSizeToAppUnits(
               nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame).
                 ToNearestPixels(appUnitsPerDevPixel),
               appUnitsPerDevPixel));
         }
       } else {
         NS_ASSERTION(mImageElementSurface.mSourceSurface, "Surface should be ready.");
-        gfxIntSize surfaceSize = mImageElementSurface.mSize;
+        IntSize surfaceSize = mImageElementSurface.mSize;
         result.SetSize(
           nsSize(nsPresContext::CSSPixelsToAppUnits(surfaceSize.width),
                  nsPresContext::CSSPixelsToAppUnits(surfaceSize.height)));
       }
       break;
     }
     case eStyleImageType_Gradient:
       // Per <http://dev.w3.org/csswg/css3-images/#gradients>, gradients have no
@@ -5013,17 +5013,17 @@ nsImageRenderer::DrawableForElement(cons
                                     nsRenderingContext&  aRenderingContext)
 {
   NS_ASSERTION(mType == eStyleImageType_Element,
                "DrawableForElement only makes sense if backed by an element");
   if (mPaintServerFrame) {
     int32_t appUnitsPerDevPixel = mForFrame->PresContext()->AppUnitsPerDevPixel();
     nsRect destRect = aImageRect - aImageRect.TopLeft();
     nsIntSize roundedOut = destRect.ToOutsidePixels(appUnitsPerDevPixel).Size();
-    gfxIntSize imageSize(roundedOut.width, roundedOut.height);
+    IntSize imageSize(roundedOut.width, roundedOut.height);
     nsRefPtr<gfxDrawable> drawable =
       nsSVGIntegrationUtils::DrawableFromPaintServer(
         mPaintServerFrame, mForFrame, mSize, imageSize,
         aRenderingContext.GetDrawTarget(),
         aRenderingContext.ThebesContext()->CurrentMatrix(),
         mFlags & FLAG_SYNC_DECODE_IMAGES
           ? nsSVGIntegrationUtils::FLAG_SYNC_DECODE_IMAGES
           : 0);
@@ -5272,17 +5272,17 @@ static inline gfxPoint ComputeBlurStdDev
   gfxFloat blurStdDev = gfxFloat(aBlurRadius) / gfxFloat(aAppUnitsPerDevPixel);
 
   return gfxPoint(std::min((blurStdDev * aScaleX),
                            gfxFloat(MAX_BLUR_RADIUS)) / 2.0,
                   std::min((blurStdDev * aScaleY),
                            gfxFloat(MAX_BLUR_RADIUS)) / 2.0);
 }
 
-static inline gfxIntSize
+static inline IntSize
 ComputeBlurRadius(nscoord aBlurRadius,
                   int32_t aAppUnitsPerDevPixel,
                   gfxFloat aScaleX = 1.0,
                   gfxFloat aScaleY = 1.0)
 {
   gfxPoint scaledBlurStdDev = ComputeBlurStdDev(aBlurRadius, aAppUnitsPerDevPixel,
                                                 aScaleX, aScaleY);
   return
@@ -5301,18 +5301,18 @@ nsContextBoxBlur::Init(const nsRect& aRe
                        const gfxRect* aSkipRect,
                        uint32_t aFlags)
 {
   if (aRect.IsEmpty()) {
     mContext = nullptr;
     return nullptr;
   }
 
-  gfxIntSize blurRadius;
-  gfxIntSize spreadRadius;
+  IntSize blurRadius;
+  IntSize spreadRadius;
   GetBlurAndSpreadRadius(aDestinationCtx, aAppUnitsPerDevPixel,
                          aBlurRadius, aSpreadRadius,
                          blurRadius, spreadRadius);
 
   mDestinationCtx = aDestinationCtx;
 
   // If not blurring, draw directly onto the destination device
   if (blurRadius.width <= 0 && blurRadius.height <= 0 &&
@@ -5374,17 +5374,17 @@ nsContextBoxBlur::GetContext()
 {
   return mContext;
 }
 
 /* static */ nsMargin
 nsContextBoxBlur::GetBlurRadiusMargin(nscoord aBlurRadius,
                                       int32_t aAppUnitsPerDevPixel)
 {
-  gfxIntSize blurRadius = ComputeBlurRadius(aBlurRadius, aAppUnitsPerDevPixel);
+  IntSize blurRadius = ComputeBlurRadius(aBlurRadius, aAppUnitsPerDevPixel);
 
   nsMargin result;
   result.top = result.bottom = blurRadius.height * aAppUnitsPerDevPixel;
   result.left = result.right = blurRadius.width  * aAppUnitsPerDevPixel;
   return result;
 }
 
 /* static */ void
@@ -5457,18 +5457,18 @@ nsContextBoxBlur::BlurRectangle(gfxConte
                                  skipRect);
 }
 
 /* static */ void
 nsContextBoxBlur::GetBlurAndSpreadRadius(gfxContext* aDestinationCtx,
                                          int32_t aAppUnitsPerDevPixel,
                                          nscoord aBlurRadius,
                                          nscoord aSpreadRadius,
-                                         gfxIntSize& aOutBlurRadius,
-                                         gfxIntSize& aOutSpreadRadius,
+                                         IntSize& aOutBlurRadius,
+                                         IntSize& aOutSpreadRadius,
                                          bool aConstrainSpreadRadius)
 {
   gfxFloat scaleX = 1;
   gfxFloat scaleY = 1;
 
   // Do blurs in device space when possible.
   // Chrome/Skia always does the blurs in device space
   // and will sometimes get incorrect results (e.g. rotated blurs)
@@ -5479,18 +5479,18 @@ nsContextBoxBlur::GetBlurAndSpreadRadius
   } else {
     scaleX = transform._11;
     scaleY = transform._22;
   }
 
   // compute a large or smaller blur radius
   aOutBlurRadius = ComputeBlurRadius(aBlurRadius, aAppUnitsPerDevPixel, scaleX, scaleY);
   aOutSpreadRadius =
-      gfxIntSize(int32_t(aSpreadRadius * scaleX / aAppUnitsPerDevPixel),
-                 int32_t(aSpreadRadius * scaleY / aAppUnitsPerDevPixel));
+      IntSize(int32_t(aSpreadRadius * scaleX / aAppUnitsPerDevPixel),
+              int32_t(aSpreadRadius * scaleY / aAppUnitsPerDevPixel));
 
 
   if (aConstrainSpreadRadius) {
     aOutSpreadRadius.width = std::min(aOutSpreadRadius.width, int32_t(MAX_SPREAD_RADIUS));
     aOutSpreadRadius.height = std::min(aOutSpreadRadius.height, int32_t(MAX_SPREAD_RADIUS));
   }
 }
 
@@ -5506,18 +5506,18 @@ nsContextBoxBlur::InsetBoxBlur(gfxContex
                                RectCornerRadii& aInnerClipRectRadii,
                                Rect aSkipRect)
 {
   if (aDestinationRect.IsEmpty()) {
     mContext = nullptr;
     return false;
   }
 
-  gfxIntSize blurRadius;
-  gfxIntSize spreadRadius;
+  IntSize blurRadius;
+  IntSize spreadRadius;
   // Convert the blur and spread radius to device pixels
   bool constrainSpreadRadius = false;
   GetBlurAndSpreadRadius(aDestinationCtx, aAppUnitsPerDevPixel,
                          aBlurRadiusAppUnits, aSpreadDistanceAppUnits,
                          blurRadius, spreadRadius, constrainSpreadRadius);
 
   // The blur and spread radius are scaled already, so scale all
   // input data to the blur. This way, we don't have to scale the min
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -978,18 +978,18 @@ public:
                     RectCornerRadii& aInnerClipRectRadii,
                     mozilla::gfx::Rect aSkipRect);
 
 protected:
   static void GetBlurAndSpreadRadius(gfxContext* aContext,
                                      int32_t aAppUnitsPerDevPixel,
                                      nscoord aBlurRadius,
                                      nscoord aSpreadRadius,
-                                     gfxIntSize& aOutBlurRadius,
-                                     gfxIntSize& aOutSpreadRadius,
+                                     mozilla::gfx::IntSize& aOutBlurRadius,
+                                     mozilla::gfx::IntSize& aOutSpreadRadius,
                                      bool aConstrainSpreadRadius = true);
 
   gfxAlphaBoxBlur mAlphaBoxBlur;
   nsRefPtr<gfxContext> mContext;
   gfxContext* mDestinationCtx;
 
   /* This is true if the blur already has it's content transformed
    * by mDestinationCtx's transform */
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6823,17 +6823,17 @@ nsLayoutUtils::SurfaceFromElement(nsIIma
     result.mDrawInfo.mDrawingFlags = frameFlags;
   }
 
   int32_t corsmode;
   if (NS_SUCCEEDED(imgRequest->GetCORSMode(&corsmode))) {
     result.mCORSUsed = (corsmode != imgIRequest::CORS_NONE);
   }
 
-  result.mSize = gfxIntSize(imgWidth, imgHeight);
+  result.mSize = IntSize(imgWidth, imgHeight);
   result.mPrincipal = principal.forget();
   // no images, including SVG images, can load content from another domain.
   result.mIsWriteOnly = false;
   result.mImageRequest = imgRequest.forget();
 
   return result;
 }
 
@@ -6853,17 +6853,17 @@ nsLayoutUtils::SurfaceFromElement(HTMLCa
 {
   SurfaceFromElementResult result;
 
   bool* isPremultiplied = nullptr;
   if (aSurfaceFlags & SFE_PREFER_NO_PREMULTIPLY_ALPHA) {
     isPremultiplied = &result.mIsPremultiplied;
   }
 
-  gfxIntSize size = aElement->GetSize();
+  IntSize size = aElement->GetSize();
 
   result.mSourceSurface = aElement->GetSurfaceSnapshot(isPremultiplied);
   if (!result.mSourceSurface) {
      // If the element doesn't have a context then we won't get a snapshot. The canvas spec wants us to not error and just
      // draw nothing, so return an empty surface.
      DrawTarget *ref = aTarget ? aTarget : gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
      RefPtr<DrawTarget> dt = ref->CreateSimilarDrawTarget(IntSize(size.width, size.height),
                                                           SurfaceFormat::B8G8R8A8);
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2061,17 +2061,17 @@ public:
     SurfaceFromElementResult();
 
     /* mSourceSurface will contain the resulting surface, or will be nullptr on error */
     mozilla::RefPtr<SourceSurface> mSourceSurface;
     /* Contains info for drawing when there is no mSourceSurface. */
     DirectDrawInfo mDrawInfo;
 
     /* The size of the surface */
-    gfxIntSize mSize;
+    mozilla::gfx::IntSize mSize;
     /* The principal associated with the element whose surface was returned.
        If there is a surface, this will never be null. */
     nsCOMPtr<nsIPrincipal> mPrincipal;
     /* The image request, if the element is an nsIImageLoadingContent */
     nsCOMPtr<imgIRequest> mImageRequest;
     /* Whether the element was "write only", that is, the bits should not be exposed to content */
     bool mIsWriteOnly;
     /* Whether the element was still loading.  Some consumers need to handle
--- a/layout/svg/nsFilterInstance.cpp
+++ b/layout/svg/nsFilterInstance.cpp
@@ -526,17 +526,17 @@ nsFilterInstance::OutputFilterSpaceBound
 {
   uint32_t numPrimitives = mPrimitiveDescriptions.Length();
   if (numPrimitives <= 0)
     return nsIntRect();
 
   nsIntRect bounds =
     mPrimitiveDescriptions[numPrimitives - 1].PrimitiveSubregion();
   bool overflow;
-  gfxIntSize surfaceSize =
+  IntSize surfaceSize =
     nsSVGUtils::ConvertToSurfaceSize(bounds.Size(), &overflow);
   bounds.SizeTo(surfaceSize);
   return bounds;
 }
 
 nsIntRect
 nsFilterInstance::FrameSpaceToFilterSpace(const nsRect* aRect) const
 {
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -605,31 +605,31 @@ nsSVGIntegrationUtils::GetCSSPxToDevPxMa
                    0.0, devPxPerCSSPx,
                    0.0, 0.0);
 }
 
 class PaintFrameCallback : public gfxDrawingCallback {
 public:
   PaintFrameCallback(nsIFrame* aFrame,
                      const nsSize aPaintServerSize,
-                     const gfxIntSize aRenderSize,
+                     const IntSize aRenderSize,
                      uint32_t aFlags)
    : mFrame(aFrame)
    , mPaintServerSize(aPaintServerSize)
    , mRenderSize(aRenderSize)
    , mFlags (aFlags)
   {}
   virtual bool operator()(gfxContext* aContext,
                             const gfxRect& aFillRect,
                             const GraphicsFilter& aFilter,
                             const gfxMatrix& aTransform) override;
 private:
   nsIFrame* mFrame;
   nsSize mPaintServerSize;
-  gfxIntSize mRenderSize;
+  IntSize mRenderSize;
   uint32_t mFlags;
 };
 
 bool
 PaintFrameCallback::operator()(gfxContext* aContext,
                                const gfxRect& aFillRect,
                                const GraphicsFilter& aFilter,
                                const gfxMatrix& aTransform)
@@ -690,17 +690,17 @@ PaintFrameCallback::operator()(gfxContex
 
   return true;
 }
 
 /* static */ already_AddRefed<gfxDrawable>
 nsSVGIntegrationUtils::DrawableFromPaintServer(nsIFrame*         aFrame,
                                                nsIFrame*         aTarget,
                                                const nsSize&     aPaintServerSize,
-                                               const gfxIntSize& aRenderSize,
+                                               const IntSize& aRenderSize,
                                                const DrawTarget* aDrawTarget,
                                                const gfxMatrix&  aContextMatrix,
                                                uint32_t          aFlags)
 {
   // aPaintServerSize is the size that would be filled when using
   // background-repeat:no-repeat and background-size:auto. For normal background
   // images, this would be the intrinsic size of the image; for gradients and
   // patterns this would be the whole target frame fill area.
--- a/layout/svg/nsSVGIntegrationUtils.h
+++ b/layout/svg/nsSVGIntegrationUtils.h
@@ -161,18 +161,18 @@ public:
    * @param aFlags pass FLAG_SYNC_DECODE_IMAGES and any images in the paint
    * server will be decoding synchronously if they are not decoded already.
    */
   enum {
     FLAG_SYNC_DECODE_IMAGES = 0x01,
   };
 
   static already_AddRefed<gfxDrawable>
-  DrawableFromPaintServer(nsIFrame*         aFrame,
-                          nsIFrame*         aTarget,
-                          const nsSize&     aPaintServerSize,
-                          const gfxIntSize& aRenderSize,
+  DrawableFromPaintServer(nsIFrame* aFrame,
+                          nsIFrame* aTarget,
+                          const nsSize& aPaintServerSize,
+                          const mozilla::gfx::IntSize& aRenderSize,
                           const DrawTarget* aDrawTarget,
-                          const gfxMatrix&  aContextMatrix,
-                          uint32_t          aFlags);
+                          const gfxMatrix& aContextMatrix,
+                          uint32_t aFlags);
 };
 
 #endif /*NSSVGINTEGRATIONUTILS_H_*/
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -797,21 +797,21 @@ nsSVGUtils::TransformFrameRectToOuterSVG
                                          nsPresContext* aPresContext)
 {
   gfxRect r(aRect.x, aRect.y, aRect.width, aRect.height);
   r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());
   return nsLayoutUtils::RoundGfxRectToAppRect(
     aMatrix.TransformBounds(r), aPresContext->AppUnitsPerDevPixel());
 }
 
-gfxIntSize
+IntSize
 nsSVGUtils::ConvertToSurfaceSize(const gfxSize& aSize,
                                  bool *aResultOverflows)
 {
-  gfxIntSize surfaceSize(ClampToInt(ceil(aSize.width)), ClampToInt(ceil(aSize.height)));
+  IntSize surfaceSize(ClampToInt(ceil(aSize.width)), ClampToInt(ceil(aSize.height)));
 
   *aResultOverflows = surfaceSize.width != ceil(aSize.width) ||
     surfaceSize.height != ceil(aSize.height);
 
   if (!gfxASurface::CheckSurfaceSize(surfaceSize)) {
     surfaceSize.width = std::min(NS_SVG_OFFSCREEN_MAX_DIMENSION,
                                surfaceSize.width);
     surfaceSize.height = std::min(NS_SVG_OFFSCREEN_MAX_DIMENSION,
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -346,18 +346,18 @@ public:
    * Convert a surface size to an integer for use by thebes
    * possibly making it smaller in the process so the surface does not
    * use excessive memory.
    *
    * @param aSize the desired surface size
    * @param aResultOverflows true if the desired surface size is too big
    * @return the surface size to use
    */
-  static gfxIntSize ConvertToSurfaceSize(const gfxSize& aSize,
-                                         bool *aResultOverflows);
+  static mozilla::gfx::IntSize ConvertToSurfaceSize(const gfxSize& aSize,
+                                                    bool *aResultOverflows);
 
   /*
    * Hit test a given rectangle/matrix.
    */
   static bool
   HitTestRect(const mozilla::gfx::Matrix &aMatrix,
               float aRX, float aRY, float aRWidth, float aRHeight,
               float aX, float aY);
--- a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
+++ b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
@@ -153,29 +153,30 @@ Fake_VideoStreamSource::Notify(nsITimer*
   const uint8_t chromaBpp = 4;
 
   int len = ((WIDTH * HEIGHT) * 3 / 2);
   uint8_t* frame = (uint8_t*) PR_Malloc(len);
   memset(frame, 0x80, len); // Gray
 
   mozilla::layers::PlanarYCbCrData data;
   data.mYChannel = frame;
-  data.mYSize = gfxIntSize(WIDTH, HEIGHT);
+  data.mYSize = mozilla::gfx::IntSize(WIDTH, HEIGHT);
   data.mYStride = WIDTH * lumaBpp / 8.0;
   data.mCbCrStride = WIDTH * chromaBpp / 8.0;
   data.mCbChannel = frame + HEIGHT * data.mYStride;
   data.mCrChannel = data.mCbChannel + HEIGHT * data.mCbCrStride / 2;
-  data.mCbCrSize = gfxIntSize(WIDTH / 2, HEIGHT / 2);
+  data.mCbCrSize = mozilla::gfx::IntSize(WIDTH / 2, HEIGHT / 2);
   data.mPicX = 0;
   data.mPicY = 0;
-  data.mPicSize = gfxIntSize(WIDTH, HEIGHT);
+  data.mPicSize = mozilla::gfx::IntSize(WIDTH, HEIGHT);
   data.mStereoMode = mozilla::layers::StereoMode::MONO;
 
   mozilla::VideoSegment segment;
-  segment.AppendFrame(image.forget(), USECS_PER_S / FPS, gfxIntSize(WIDTH, HEIGHT));
+  segment.AppendFrame(image.forget(), USECS_PER_S / FPS,
+                      mozilla::gfx::IntSize(WIDTH, HEIGHT));
 
   // TODO(ekr@rtfm.com): are we leaking?
 #endif
 
   return NS_OK;
 }
 
 
--- a/widget/android/nsScreenManagerAndroid.cpp
+++ b/widget/android/nsScreenManagerAndroid.cpp
@@ -24,17 +24,17 @@ nsScreenAndroid::GetId(uint32_t *outId)
 {
     *outId = 1;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
 {
-    gfxIntSize sz = nsWindow::GetAndroidScreenBounds();
+    gfx::IntSize sz = nsWindow::GetAndroidScreenBounds();
 
     *outLeft = 0;
     *outTop = 0;
 
     *outWidth = sz.width;
     *outHeight = sz.height;
 
     return NS_OK;
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -78,18 +78,18 @@ using mozilla::unused;
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::widget;
 using namespace mozilla::layers;
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
 
 // The dimensions of the current android view
-static gfxIntSize gAndroidBounds = gfxIntSize(0, 0);
-static gfxIntSize gAndroidScreenBounds;
+static gfx::IntSize gAndroidBounds = gfx::IntSize(0, 0);
+static gfx::IntSize gAndroidScreenBounds;
 
 #include "mozilla/layers/CompositorChild.h"
 #include "mozilla/layers/CompositorParent.h"
 #include "mozilla/layers/LayerTransactionParent.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Services.h"
 #include "nsThreadUtils.h"
 
@@ -618,17 +618,17 @@ nsWindow::Resize(double aX,
     bool needSizeDispatch = aWidth != mBounds.width || aHeight != mBounds.height;
 
     mBounds.x = NSToIntRound(aX);
     mBounds.y = NSToIntRound(aY);
     mBounds.width = NSToIntRound(aWidth);
     mBounds.height = NSToIntRound(aHeight);
 
     if (needSizeDispatch)
-        OnSizeChanged(gfxIntSize(aWidth, aHeight));
+        OnSizeChanged(gfx::IntSize(aWidth, aHeight));
 
     // Should we skip honoring aRepaint here?
     if (aRepaint && FindTopLevel() == nsWindow::TopWindow())
         RedrawAll();
 
     nsIWidgetListener* listener = GetWidgetListener();
     if (mAwaitingFullScreen && listener) {
       listener->FullscreenChanged(mIsFullScreen);
@@ -1040,17 +1040,17 @@ nsWindow::OnGlobalAndroidEvent(AndroidGe
             if (!sCompositorPaused) {
                 win->RedrawAll();
             }
             break;
     }
 }
 
 void
-nsWindow::OnSizeChanged(const gfxIntSize& aSize)
+nsWindow::OnSizeChanged(const gfx::IntSize& aSize)
 {
     ALOG("nsWindow: %p OnSizeChanged [%d %d]", (void*)this, aSize.width, aSize.height);
 
     mBounds.width = aSize.width;
     mBounds.height = aSize.height;
 
     if (mWidgetListener) {
         mWidgetListener->WindowResized(this, aSize.width, aSize.height);
@@ -1066,17 +1066,17 @@ nsWindow::InitEvent(WidgetGUIEvent& even
     } else {
         event.refPoint.x = 0;
         event.refPoint.y = 0;
     }
 
     event.time = PR_Now() / 1000;
 }
 
-gfxIntSize
+gfx::IntSize
 nsWindow::GetAndroidScreenBounds()
 {
     if (XRE_IsContentProcess()) {
         return ContentChild::GetSingleton()->GetScreenSize();
     }
     return gAndroidScreenBounds;
 }
 
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -46,28 +46,28 @@ public:
 
     static void InitNatives();
     class Natives;
     // Object that implements native GeckoView calls;
     // nullptr for nsWindows that were not opened from GeckoView.
     mozilla::UniquePtr<Natives> mNatives;
 
     static void OnGlobalAndroidEvent(mozilla::AndroidGeckoEvent *ae);
-    static gfxIntSize GetAndroidScreenBounds();
+    static mozilla::gfx::IntSize GetAndroidScreenBounds();
     static nsWindow* TopWindow();
 
     bool OnContextmenuEvent(mozilla::AndroidGeckoEvent *ae);
     void OnLongTapEvent(mozilla::AndroidGeckoEvent *ae);
     bool OnMultitouchEvent(mozilla::AndroidGeckoEvent *ae);
     void OnNativeGestureEvent(mozilla::AndroidGeckoEvent *ae);
     void OnMouseEvent(mozilla::AndroidGeckoEvent *ae);
     void OnKeyEvent(mozilla::AndroidGeckoEvent *ae);
     void OnIMEEvent(mozilla::AndroidGeckoEvent *ae);
 
-    void OnSizeChanged(const gfxIntSize& aSize);
+    void OnSizeChanged(const mozilla::gfx::IntSize& aSize);
 
     void InitEvent(mozilla::WidgetGUIEvent& event, nsIntPoint* aPoint = 0);
 
     //
     // nsIWidget
     //
 
     NS_IMETHOD Create(nsIWidget *aParent,
--- a/widget/cocoa/nsCocoaUtils.mm
+++ b/widget/cocoa/nsCocoaUtils.mm
@@ -470,18 +470,17 @@ nsresult nsCocoaUtils::CreateNSImageFrom
 {
   RefPtr<SourceSurface> surface;
   int32_t width = 0, height = 0;
   aImage->GetWidth(&width);
   aImage->GetHeight(&height);
 
   // Render a vector image at the correct resolution on a retina display
   if (aImage->GetType() == imgIContainer::TYPE_VECTOR && scaleFactor != 1.0f) {
-    gfxIntSize scaledSize(ceil(width * scaleFactor),
-                          ceil(height * scaleFactor));
+    IntSize scaledSize(ceil(width * scaleFactor), ceil(height * scaleFactor));
 
     RefPtr<DrawTarget> drawTarget = gfxPlatform::GetPlatform()->
       CreateOffscreenContentDrawTarget(scaledSize, SurfaceFormat::B8G8R8A8);
     if (!drawTarget) {
       NS_ERROR("Failed to create DrawTarget");
       return NS_ERROR_FAILURE;
     }
 
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6281,17 +6281,17 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDr
     Drawable xDrawable = gdk_x11_drawable_get_xid(aDrawable);
 
     nsRefPtr<gfxASurface> result;
 
     if (visual) {
         Visual* xVisual = gdk_x11_visual_get_xvisual(visual);
 
         result = new gfxXlibSurface(xDisplay, xDrawable, xVisual,
-                                    gfxIntSize(aSize.width, aSize.height));
+                                    IntSize(aSize.width, aSize.height));
     } else {
         // no visual? we must be using an xrender format.  Find a format
         // for this depth.
         XRenderPictFormat *pf = nullptr;
         switch (gdk_drawable_get_depth(aDrawable)) {
             case 32:
                 pf = XRenderFindStandardFormat(xDisplay, PictStandardARGB32);
                 break;
@@ -6299,17 +6299,17 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDr
                 pf = XRenderFindStandardFormat(xDisplay, PictStandardRGB24);
                 break;
             default:
                 NS_ERROR("Don't know how to handle the given depth!");
                 break;
         }
 
         result = new gfxXlibSurface(xScreen, xDrawable, pf,
-                                    gfxIntSize(aSize.width, aSize.height));
+                                    IntSize(aSize.width, aSize.height));
     }
 
     return result.forget();
 }
 #endif
 
 already_AddRefed<DrawTarget>
 nsWindow::GetDrawTarget(const nsIntRegion& aRegion)
--- a/widget/nsShmImage.cpp
+++ b/widget/nsShmImage.cpp
@@ -41,17 +41,17 @@ TrapShmError(Display* aDisplay, XErrorEv
 {
     // store the error code and ignore the error
     gShmError = aEvent->error_code;
     return 0;
 }
 #endif
 
 already_AddRefed<nsShmImage>
-nsShmImage::Create(const gfxIntSize& aSize,
+nsShmImage::Create(const IntSize& aSize,
                    Display* aDisplay, Visual* aVisual, unsigned int aDepth)
 {
     nsRefPtr<nsShmImage> shm = new nsShmImage();
     shm->mDisplay = aDisplay;
     shm->mImage = XShmCreateImage(aDisplay, aVisual, aDepth,
                                   ZPixmap, nullptr,
                                   &(shm->mInfo),
                                   aSize.width, aSize.height);
@@ -175,17 +175,17 @@ nsShmImage::Put(QWindow* aWindow, QRect&
                  inter.x(), inter.y(),
                  inter.width(), inter.height(),
                  False);
     XFreeGC(dpy, gc);
 }
 #endif
 
 already_AddRefed<DrawTarget>
-nsShmImage::EnsureShmImage(const gfxIntSize& aSize,
+nsShmImage::EnsureShmImage(const IntSize& aSize,
                            Display* aDisplay, Visual* aVisual, unsigned int aDepth,
                            nsRefPtr<nsShmImage>& aImage)
 {
     if (!aImage || aImage->Size() != aSize) {
         // Because we XSync() after XShmAttach() to trap errors, we
         // know that the X server has the old image's memory mapped
         // into its address space, so it's OK to destroy the old image
         // here even if there are outstanding Puts.  The Detach is
--- a/widget/nsShmImage.h
+++ b/widget/nsShmImage.h
@@ -33,20 +33,20 @@ class nsShmImage {
     // bug 1168843, compositor thread may create shared memory instances that are destroyed by main thread on shutdown, so this must use thread-safe RC to avoid hitting assertion
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsShmImage)
 
     typedef mozilla::ipc::SharedMemorySysV SharedMemorySysV;
 
 public:
     static bool UseShm();
     static already_AddRefed<nsShmImage>
-        Create(const gfxIntSize& aSize,
+        Create(const mozilla::gfx::IntSize& aSize,
                Display* aDisplay, Visual* aVisual, unsigned int aDepth);
     static already_AddRefed<mozilla::gfx::DrawTarget>
-        EnsureShmImage(const gfxIntSize& aSize,
+        EnsureShmImage(const mozilla::gfx::IntSize& aSize,
                        Display* aDisplay, Visual* aVisual, unsigned int aDepth,
                        nsRefPtr<nsShmImage>& aImage);
 
 private:
     ~nsShmImage() {
         if (mImage) {
             mozilla::FinishX(mDisplay);
             if (mXAttached) {
@@ -60,30 +60,30 @@ public:
     already_AddRefed<mozilla::gfx::DrawTarget> CreateDrawTarget();
 
 #ifdef MOZ_WIDGET_GTK
     void Put(Display* aDisplay, Drawable aWindow, const nsIntRegion& aRegion);
 #elif defined(MOZ_WIDGET_QT)
     void Put(QWindow* aWindow, QRect& aRect);
 #endif
 
-    gfxIntSize Size() const { return mSize; }
+    mozilla::gfx::IntSize Size() const { return mSize; }
 
 private:
     nsShmImage()
         : mImage(nullptr)
         , mDisplay(nullptr)
         , mFormat(mozilla::gfx::SurfaceFormat::UNKNOWN)
         , mXAttached(false)
     { mInfo.shmid = SharedMemorySysV::NULLHandle(); }
 
     nsRefPtr<SharedMemorySysV>   mSegment;
     XImage*                      mImage;
     Display*                     mDisplay;
     XShmSegmentInfo              mInfo;
-    gfxIntSize                   mSize;
+    mozilla::gfx::IntSize        mSize;
     mozilla::gfx::SurfaceFormat  mFormat;
     bool                         mXAttached;
 };
 
 #endif // MOZ_HAVE_SHMIMAGE
 
 #endif
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -812,18 +812,18 @@ nsWindow::StartRemoteDrawing()
         return nullptr;
     }
 
 #ifdef MOZ_X11
     Display* dpy = gfxQtPlatform::GetXDisplay(mWidget);
     Screen* screen = DefaultScreenOfDisplay(dpy);
     Visual* defaultVisual = DefaultVisualOfScreen(screen);
     gfxASurface* surf = new gfxXlibSurface(dpy, mWidget->winId(), defaultVisual,
-                                           gfxIntSize(mWidget->width(),
-                                                      mWidget->height()));
+                                           IntSize(mWidget->width(),
+                                                   mWidget->height()));
 
     IntSize size(surf->GetSize().width, surf->GetSize().height);
     if (size.width <= 0 || size.height <= 0) {
         return nullptr;
     }
 
     return gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, size);
 #else
--- a/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -121,16 +121,16 @@ protected:
     void TearDownView();
 
     ChildView*   mNativeView;
     bool mVisible;
     nsTArray<nsWindow*> mChildren;
     nsWindow* mParent;
     InputContext         mInputContext;
 
-    void OnSizeChanged(const gfxIntSize& aSize);
+    void OnSizeChanged(const mozilla::gfx::IntSize& aSize);
 
     static void DumpWindows();
     static void DumpWindows(const nsTArray<nsWindow*>& wins, int indent = 0);
     static void LogWindow(nsWindow *win, int index, int indent);
 };
 
 #endif /* NSWINDOW_H_ */
--- a/widget/windows/TaskbarPreview.cpp
+++ b/widget/windows/TaskbarPreview.cpp
@@ -352,17 +352,17 @@ TaskbarPreview::UpdateTooltip() {
   if (FAILED(mTaskbar->SetThumbnailTooltip(PreviewWindow(), mTooltip.get())))
     return NS_ERROR_FAILURE;
   return NS_OK;
 }
 
 void
 TaskbarPreview::DrawBitmap(uint32_t width, uint32_t height, bool isPreview) {
   nsresult rv;
-  nsRefPtr<gfxWindowsSurface> surface = new gfxWindowsSurface(gfxIntSize(width, height), gfxImageFormat::ARGB32);
+  nsRefPtr<gfxWindowsSurface> surface = new gfxWindowsSurface(gfx::IntSize(width, height), gfxImageFormat::ARGB32);
 
   nsCOMPtr<nsIDocShell> shell = do_QueryReferent(mDocShell);
 
   if (!shell)
     return;
 
   rv = GetRenderingContext(shell, surface, width, height);
   if (NS_FAILED(rv))
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2624,17 +2624,17 @@ NS_IMETHODIMP nsWindow::SetCursor(imgICo
   // spoofing.
   // XXX ideally we should rescale. Also, we could modify the API to
   // allow trusted content to set larger cursors.
   if (width > 128 || height > 128)
     return NS_ERROR_NOT_AVAILABLE;
 
   HCURSOR cursor;
   // No scaling
-  gfxIntSize size(0, 0);
+  IntSize size(0, 0);
   rv = nsWindowGfx::CreateIcon(aCursor, true, aHotspotX, aHotspotY, size, &cursor);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mCursor = nsCursor(-1);
   ::SetCursor(cursor);
 
   NS_IF_RELEASE(sCursorImgContainer);
   sCursorImgContainer = aCursor;
@@ -6981,17 +6981,17 @@ nsWindow::GetAccessible()
 #ifdef MOZ_XUL
 
 void nsWindow::ResizeTranslucentWindow(int32_t aNewWidth, int32_t aNewHeight, bool force)
 {
   if (!force && aNewWidth == mBounds.width && aNewHeight == mBounds.height)
     return;
 
   nsRefPtr<gfxWindowsSurface> newSurface =
-    new gfxWindowsSurface(gfxIntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32);
+    new gfxWindowsSurface(IntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32);
   mTransparentSurface = newSurface;
   mMemoryDC = newSurface->GetDC();
 }
 
 void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode)
 {
   if (aMode == mTransparencyMode)
     return;
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -65,17 +65,17 @@ using namespace mozilla::plugins;
 
 /**************************************************************
  *
  * SECTION: nsWindow statics
  *
  **************************************************************/
 
 static nsAutoPtr<uint8_t>  sSharedSurfaceData;
-static gfxIntSize          sSharedSurfaceSize;
+static IntSize             sSharedSurfaceSize;
 
 struct IconMetrics {
   int32_t xMetric;
   int32_t yMetric;
   int32_t defaultSize;
 };
 
 // Corresponds 1:1 to the IconSizeType enum
@@ -132,19 +132,19 @@ nsIntRegion nsWindow::GetRegionToPaint(b
     ::DeleteObject(paintRgn);
     return rgn;
   }
   return nsIntRegion(WinUtils::ToIntRect(ps.rcPaint));
 }
 
 #define WORDSSIZE(x) ((x).width * (x).height)
 static bool
-EnsureSharedSurfaceSize(gfxIntSize size)
+EnsureSharedSurfaceSize(IntSize size)
 {
-  gfxIntSize screenSize;
+  IntSize screenSize;
   screenSize.height = GetSystemMetrics(SM_CYSCREEN);
   screenSize.width = GetSystemMetrics(SM_CXSCREEN);
 
   if (WORDSSIZE(screenSize) > WORDSSIZE(size))
     size = screenSize;
 
   if (WORDSSIZE(screenSize) < WORDSSIZE(size))
     NS_WARNING("Trying to create a shared surface larger than the screen");
@@ -336,18 +336,18 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t
             targetSurface = targetSurfaceWin;
           }
 
           nsRefPtr<gfxImageSurface> targetSurfaceImage;
           if (!targetSurface &&
               (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32) ||
                IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24)))
           {
-            gfxIntSize surfaceSize(ps.rcPaint.right - ps.rcPaint.left,
-                                   ps.rcPaint.bottom - ps.rcPaint.top);
+            IntSize surfaceSize(ps.rcPaint.right - ps.rcPaint.left,
+                                ps.rcPaint.bottom - ps.rcPaint.top);
 
             if (!EnsureSharedSurfaceSize(surfaceSize)) {
               NS_ERROR("Couldn't allocate a shared image surface!");
               return false;
             }
 
             // don't use the shared surface directly; instead, create a new one
             // that just reuses its buffer.
@@ -420,17 +420,17 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t
             UpdateTranslucentWindow();
           } else
 #endif
 
           if (result) {
             if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24) ||
                 IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32))
             {
-              gfxIntSize surfaceSize = targetSurfaceImage->GetSize();
+              IntSize surfaceSize = targetSurfaceImage->GetSize();
 
               // Just blit this directly
               BITMAPINFOHEADER bi;
               memset(&bi, 0, sizeof(BITMAPINFOHEADER));
               bi.biSize = sizeof(BITMAPINFOHEADER);
               bi.biWidth = surfaceSize.width;
               bi.biHeight = - surfaceSize.height;
               bi.biPlanes = 1;
@@ -555,32 +555,32 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t
 
   if (aNestingLevel == 0 && ::GetUpdateRect(mWnd, nullptr, false)) {
     OnPaint(aDC, 1);
   }
 
   return result;
 }
 
-gfxIntSize nsWindowGfx::GetIconMetrics(IconSizeType aSizeType) {
+IntSize nsWindowGfx::GetIconMetrics(IconSizeType aSizeType) {
   int32_t width = ::GetSystemMetrics(sIconMetrics[aSizeType].xMetric);
   int32_t height = ::GetSystemMetrics(sIconMetrics[aSizeType].yMetric);
 
   if (width == 0 || height == 0) {
     width = height = sIconMetrics[aSizeType].defaultSize;
   }
 
-  return gfxIntSize(width, height);
+  return IntSize(width, height);
 }
 
 nsresult nsWindowGfx::CreateIcon(imgIContainer *aContainer,
                                   bool aIsCursor,
                                   uint32_t aHotspotX,
                                   uint32_t aHotspotY,
-                                  gfxIntSize aScaledSize,
+                                  IntSize aScaledSize,
                                   HICON *aIcon) {
 
   MOZ_ASSERT((aScaledSize.width > 0 && aScaledSize.height > 0) ||
              (aScaledSize.width == 0 && aScaledSize.height == 0));
 
   // Get the image data
   RefPtr<SourceSurface> surface =
     aContainer->GetFrame(imgIContainer::FRAME_CURRENT,
--- a/widget/windows/nsWindowGfx.h
+++ b/widget/windows/nsWindowGfx.h
@@ -14,18 +14,20 @@
 #include <imgIContainer.h>
 
 class nsWindowGfx {
 public:
   enum IconSizeType {
     kSmallIcon,
     kRegularIcon
   };
-  static gfxIntSize GetIconMetrics(IconSizeType aSizeType);
-  static nsresult CreateIcon(imgIContainer *aContainer, bool aIsCursor, uint32_t aHotspotX, uint32_t aHotspotY, gfxIntSize aScaledSize, HICON *aIcon);
+  static mozilla::gfx::IntSize GetIconMetrics(IconSizeType aSizeType);
+  static nsresult CreateIcon(imgIContainer *aContainer, bool aIsCursor,
+                             uint32_t aHotspotX, uint32_t aHotspotY,
+                             mozilla::gfx::IntSize aScaledSize, HICON *aIcon);
 
 private:
   /**
    * Cursor helpers
    */
   static uint8_t*         Data32BitTo1Bit(uint8_t* aImageData, uint32_t aWidth, uint32_t aHeight);
   static HBITMAP          DataToBitmap(uint8_t* aImageData, uint32_t aWidth, uint32_t aHeight, uint32_t aDepth);
 };