From 842dd1cf5a8752ee0dc4366cd2d1ea05a1d2c4b3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 23 Sep 2015 11:49:05 -0700 Subject: [PATCH] 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. --HG-- extra : rebase_source : 67fd15f87222b16defa70ef795c6d77dfacf1c36 --- dom/camera/CameraPreviewMediaStream.cpp | 2 +- dom/camera/CameraPreviewMediaStream.h | 2 +- dom/camera/DOMCameraControlListener.cpp | 2 +- dom/canvas/CanvasImageCache.cpp | 4 +- dom/canvas/CanvasImageCache.h | 2 +- dom/canvas/CanvasRenderingContext2D.cpp | 6 +-- dom/html/HTMLMediaElement.cpp | 8 ++-- dom/ipc/ContentChild.cpp | 2 +- dom/ipc/ContentChild.h | 6 +-- dom/ipc/ContentParent.cpp | 2 +- dom/ipc/PContent.ipdl | 4 +- dom/ipc/TabParent.cpp | 2 +- dom/media/VideoFrameContainer.cpp | 6 +-- dom/media/VideoFrameContainer.h | 10 ++-- dom/media/VideoSegment.cpp | 6 +-- dom/media/VideoSegment.h | 8 ++-- dom/media/android/AndroidMediaReader.cpp | 2 +- dom/media/encoder/TrackEncoder.cpp | 2 +- dom/media/encoder/VP8TrackEncoder.cpp | 2 +- dom/media/ogg/OggReader.cpp | 2 +- dom/media/omx/MediaCodecReader.cpp | 2 +- dom/media/omx/MediaOmxReader.cpp | 2 +- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- dom/plugins/ipc/PPluginInstance.ipdl | 4 +- dom/plugins/ipc/PluginInstanceChild.cpp | 20 ++++---- dom/plugins/ipc/PluginInstanceChild.h | 2 +- dom/plugins/ipc/PluginInstanceParent.cpp | 10 ++-- dom/plugins/ipc/PluginInstanceParent.h | 2 +- dom/plugins/ipc/PluginSurfaceParent.cpp | 2 +- dom/plugins/ipc/PluginSurfaceParent.h | 2 +- gfx/src/nsSize.h | 1 - gfx/thebes/gfxBlur.cpp | 46 +++++++++---------- gfx/thebes/gfxBlur.h | 8 ++-- gfx/thebes/gfxUtils.cpp | 4 +- image/DynamicImage.cpp | 10 ++-- image/OrientedImage.cpp | 2 +- image/imgFrame.cpp | 2 +- layout/base/nsCSSRendering.cpp | 24 +++++----- layout/base/nsCSSRendering.h | 4 +- layout/base/nsLayoutUtils.cpp | 4 +- layout/base/nsLayoutUtils.h | 2 +- layout/svg/nsFilterInstance.cpp | 2 +- layout/svg/nsSVGIntegrationUtils.cpp | 6 +-- layout/svg/nsSVGIntegrationUtils.h | 12 ++--- layout/svg/nsSVGUtils.cpp | 4 +- layout/svg/nsSVGUtils.h | 4 +- .../signaling/test/FakeMediaStreamsImpl.h | 9 ++-- widget/android/nsScreenManagerAndroid.cpp | 2 +- widget/android/nsWindow.cpp | 10 ++-- widget/android/nsWindow.h | 4 +- widget/cocoa/nsCocoaUtils.mm | 3 +- widget/gtk/nsWindow.cpp | 4 +- widget/nsShmImage.cpp | 4 +- widget/nsShmImage.h | 8 ++-- widget/qt/nsWindow.cpp | 4 +- widget/uikit/nsWindow.h | 2 +- widget/windows/TaskbarPreview.cpp | 2 +- widget/windows/nsWindow.cpp | 4 +- widget/windows/nsWindowGfx.cpp | 18 ++++---- widget/windows/nsWindowGfx.h | 6 ++- 60 files changed, 171 insertions(+), 172 deletions(-) diff --git a/dom/camera/CameraPreviewMediaStream.cpp b/dom/camera/CameraPreviewMediaStream.cpp index 56ff90f8dbdd..e9490d77f3fd 100644 --- a/dom/camera/CameraPreviewMediaStream.cpp +++ b/dom/camera/CameraPreviewMediaStream.cpp @@ -137,7 +137,7 @@ CameraPreviewMediaStream::RateLimit(bool aLimit) } void -CameraPreviewMediaStream::SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage) +CameraPreviewMediaStream::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage) { { MutexAutoLock lock(mMutex); diff --git a/dom/camera/CameraPreviewMediaStream.h b/dom/camera/CameraPreviewMediaStream.h index 50de9fef7f1a..f258c36b584e 100644 --- a/dom/camera/CameraPreviewMediaStream.h +++ b/dom/camera/CameraPreviewMediaStream.h @@ -58,7 +58,7 @@ public: 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); diff --git a/dom/camera/DOMCameraControlListener.cpp b/dom/camera/DOMCameraControlListener.cpp index 684b6b769650..757eff76cb0e 100644 --- a/dom/camera/DOMCameraControlListener.cpp +++ b/dom/camera/DOMCameraControlListener.cpp @@ -311,7 +311,7 @@ DOMCameraControlListener::OnNewPreviewFrame(layers::Image* aImage, uint32_t aWid { 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; } diff --git a/dom/canvas/CanvasImageCache.cpp b/dom/canvas/CanvasImageCache.cpp index 79a4ee6d9045..a4f66bda1061 100644 --- a/dom/canvas/CanvasImageCache.cpp +++ b/dom/canvas/CanvasImageCache.cpp @@ -53,7 +53,7 @@ struct ImageCacheEntryData { // Value nsCOMPtr mRequest; RefPtr mSourceSurface; - gfxIntSize mSize; + IntSize mSize; nsExpirationState mState; }; @@ -237,7 +237,7 @@ CanvasImageCache::NotifyDrawImage(Element* aImage, HTMLCanvasElement* aCanvas, imgIRequest* aRequest, SourceSurface* aSource, - const gfxIntSize& aSize) + const IntSize& aSize) { if (!gImageCache) { gImageCache = new ImageCache(); diff --git a/dom/canvas/CanvasImageCache.h b/dom/canvas/CanvasImageCache.h index 6b5fb3cfaa24..836368c6c3b3 100644 --- a/dom/canvas/CanvasImageCache.h +++ b/dom/canvas/CanvasImageCache.h @@ -33,7 +33,7 @@ public: 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 diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 1f0667527710..9f4156b6dfbf 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -4787,7 +4787,7 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x, { // 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; @@ -4976,7 +4976,7 @@ CanvasRenderingContext2D::AsyncDrawXULElement(nsXULElement& elem, // 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; } @@ -5401,7 +5401,7 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w uint32_t copyWidth = dirtyRect.Width(); uint32_t copyHeight = dirtyRect.Height(); - nsRefPtr imgsurf = new gfxImageSurface(gfxIntSize(copyWidth, copyHeight), + nsRefPtr imgsurf = new gfxImageSurface(gfx::IntSize(copyWidth, copyHeight), gfxImageFormat::ARGB32, false); if (!imgsurf || imgsurf->CairoStatus()) { diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 4188f2e4f00c..afa8a69badf3 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -3042,7 +3042,7 @@ public: if (!mElement) { return; } - gfxIntSize size; + gfx::IntSize size; { MutexAutoLock lock(mMutex); size = mInitialSize; @@ -3056,13 +3056,13 @@ public: 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(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 event = NS_NewRunnableMethod(this, &StreamSizeListener::ReceivedSize); @@ -3077,7 +3077,7 @@ private: // mMutex protects the fields below; they can be accessed on any thread Mutex mMutex; - gfxIntSize mInitialSize; + gfx::IntSize mInitialSize; }; class HTMLMediaElement::MediaStreamTracksAvailableCallback: diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 08d02cba68b9..bc63689244df 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -2177,7 +2177,7 @@ ContentChild::RecvAddPermission(const IPC::Permission& permission) } bool -ContentChild::RecvScreenSizeChanged(const gfxIntSize& size) +ContentChild::RecvScreenSizeChanged(const gfx::IntSize& size) { #ifdef ANDROID mScreenSize = size; diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 721fd1b037c5..678f53fe5923 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -332,7 +332,7 @@ public: 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; @@ -407,7 +407,7 @@ public: 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 @@ -502,7 +502,7 @@ private: AppInfo mAppInfo; #ifdef ANDROID - gfxIntSize mScreenSize; + gfx::IntSize mScreenSize; #endif bool mIsForApp; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 1c09ae2169b8..4d4926132e15 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -2727,7 +2727,7 @@ ContentParent::RecvSetClipboard(const IPCDataTransfer& aDataTransfer, 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; } diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 67c7a470121b..eb7ddb994e65 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -84,7 +84,7 @@ 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"; @@ -546,7 +546,7 @@ child: // nsIPermissionManager messages AddPermission(Permission permission); - ScreenSizeChanged(gfxIntSize size); + ScreenSizeChanged(IntSize size); Volumes(VolumeInfo[] volumes); diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index f43e64adcfdf..811011c6352d 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1979,7 +1979,7 @@ TabParent::RecvSetCustomCursor(const nsCString& aCursorData, } if (mTabSetsCursor) { - const gfxIntSize size(aWidth, aHeight); + const gfx::IntSize size(aWidth, aHeight); mozilla::RefPtr customCursor = new mozilla::gfx::SourceSurfaceRawData(); mozilla::gfx::SourceSurfaceRawData* raw = static_cast(customCursor.get()); diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp index 5cf3c868c519..2ece19ad2cbd 100644 --- a/dom/media/VideoFrameContainer.cpp +++ b/dom/media/VideoFrameContainer.cpp @@ -29,7 +29,7 @@ VideoFrameContainer::VideoFrameContainer(dom::HTMLMediaElement* aElement, VideoFrameContainer::~VideoFrameContainer() {} -void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize, +void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage, const TimeStamp& aTargetTime) { @@ -44,14 +44,14 @@ void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize, } } -void VideoFrameContainer::SetCurrentFrames(const gfxIntSize& aIntrinsicSize, +void VideoFrameContainer::SetCurrentFrames(const gfx::IntSize& aIntrinsicSize, const nsTArray& aImages) { MutexAutoLock lock(mMutex); SetCurrentFramesLocked(aIntrinsicSize, aImages); } -void VideoFrameContainer::SetCurrentFramesLocked(const gfxIntSize& aIntrinsicSize, +void VideoFrameContainer::SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicSize, const nsTArray& aImages) { mMutex.AssertCurrentThreadOwns(); diff --git a/dom/media/VideoFrameContainer.h b/dom/media/VideoFrameContainer.h index 795def76c11f..8d96a7946883 100644 --- a/dom/media/VideoFrameContainer.h +++ b/dom/media/VideoFrameContainer.h @@ -42,11 +42,11 @@ public: already_AddRefed 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& aImages); - void ClearCurrentFrame(const gfxIntSize& aIntrinsicSize) + void ClearCurrentFrame(const gfx::IntSize& aIntrinsicSize) { SetCurrentFrames(aIntrinsicSize, nsTArray()); } @@ -79,7 +79,7 @@ public: void ForgetElement() { mElement = nullptr; } protected: - void SetCurrentFramesLocked(const gfxIntSize& aIntrinsicSize, + void SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicSize, const nsTArray& aImages); // Non-addreffed pointer to the element. The element calls ForgetElement @@ -94,7 +94,7 @@ protected: // 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; diff --git a/dom/media/VideoSegment.cpp b/dom/media/VideoSegment.cpp index 41cf8ca9f0a0..c5420173cc44 100644 --- a/dom/media/VideoSegment.cpp +++ b/dom/media/VideoSegment.cpp @@ -14,7 +14,7 @@ namespace mozilla { using namespace layers; VideoFrame::VideoFrame(already_AddRefed& aImage, - const gfxIntSize& aIntrinsicSize) + const gfx::IntSize& aIntrinsicSize) : mImage(aImage), mIntrinsicSize(aIntrinsicSize), mForceBlack(false) {} @@ -28,7 +28,7 @@ VideoFrame::~VideoFrame() void VideoFrame::SetNull() { mImage = nullptr; - mIntrinsicSize = gfxIntSize(0, 0); + mIntrinsicSize = gfx::IntSize(0, 0); } void @@ -41,7 +41,7 @@ VideoFrame::TakeFrom(VideoFrame* aFrame) #if !defined(MOZILLA_XPCOMRT_API) /* static */ already_AddRefed -VideoFrame::CreateBlackImage(const gfxIntSize& aSize) +VideoFrame::CreateBlackImage(const gfx::IntSize& aSize) { nsRefPtr container; nsRefPtr image; diff --git a/dom/media/VideoSegment.h b/dom/media/VideoSegment.h index 36def06d9bf7..7a761d38287e 100644 --- a/dom/media/VideoSegment.h +++ b/dom/media/VideoSegment.h @@ -30,7 +30,7 @@ public: typedef mozilla::layers::Image Image; #endif - VideoFrame(already_AddRefed& aImage, const gfxIntSize& aIntrinsicSize); + VideoFrame(already_AddRefed& aImage, const gfx::IntSize& aIntrinsicSize); VideoFrame(); ~VideoFrame(); @@ -48,13 +48,13 @@ public: 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 CreateBlackImage(const gfxIntSize& aSize); + static already_AddRefed CreateBlackImage(const gfx::IntSize& aSize); #endif // !defined(MOZILLA_XPCOMRT_API) protected: @@ -62,7 +62,7 @@ protected: // still have an intrinsic size in this case. nsRefPtr mImage; // The desired size to render the video frame at. - gfxIntSize mIntrinsicSize; + gfx::IntSize mIntrinsicSize; bool mForceBlack; }; diff --git a/dom/media/android/AndroidMediaReader.cpp b/dom/media/android/AndroidMediaReader.cpp index 6fb3827b5a1f..715d35100236 100644 --- a/dom/media/android/AndroidMediaReader.cpp +++ b/dom/media/android/AndroidMediaReader.cpp @@ -79,7 +79,7 @@ nsresult AndroidMediaReader::ReadMetadata(MediaInfo* aInfo, mInitialFrame = frameSize; VideoFrameContainer* container = mDecoder->GetVideoFrameContainer(); if (container) { - container->ClearCurrentFrame(gfxIntSize(displaySize.width, displaySize.height)); + container->ClearCurrentFrame(IntSize(displaySize.width, displaySize.height)); } } diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index b0cddbfef064..97353256966a 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -197,7 +197,7 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, 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()); diff --git a/dom/media/encoder/VP8TrackEncoder.cpp b/dom/media/encoder/VP8TrackEncoder.cpp index 75120524c5ef..b52870fdcf77 100644 --- a/dom/media/encoder/VP8TrackEncoder.cpp +++ b/dom/media/encoder/VP8TrackEncoder.cpp @@ -251,7 +251,7 @@ nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk) nsRefPtr 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; diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index 61b908ed55d8..631257c97f97 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -240,7 +240,7 @@ void OggReader::SetupTargetTheora(TheoraState* aTheoraState) 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. diff --git a/dom/media/omx/MediaCodecReader.cpp b/dom/media/omx/MediaCodecReader.cpp index 526b7fec7a2b..28999f83e3f1 100644 --- a/dom/media/omx/MediaCodecReader.cpp +++ b/dom/media/omx/MediaCodecReader.cpp @@ -744,7 +744,7 @@ MediaCodecReader::HandleResourceAllocated() 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 metadata = new MetadataHolder(); diff --git a/dom/media/omx/MediaOmxReader.cpp b/dom/media/omx/MediaOmxReader.cpp index ba4232aab0ca..2580530987aa 100644 --- a/dom/media/omx/MediaOmxReader.cpp +++ b/dom/media/omx/MediaOmxReader.cpp @@ -307,7 +307,7 @@ void MediaOmxReader::HandleResourceAllocated() mInitialFrame = frameSize; VideoFrameContainer* container = mDecoder->GetVideoFrameContainer(); if (container) { - container->ClearCurrentFrame(gfxIntSize(displaySize.width, displaySize.height)); + container->ClearCurrentFrame(IntSize(displaySize.width, displaySize.height)); } } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index f95d9f5c7f38..31f3a0719be0 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -2587,7 +2587,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext, 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; diff --git a/dom/plugins/ipc/PPluginInstance.ipdl b/dom/plugins/ipc/PPluginInstance.ipdl index a162d3639e4c..3187ca5371e0 100644 --- a/dom/plugins/ipc/PPluginInstance.ipdl +++ b/dom/plugins/ipc/PPluginInstance.ipdl @@ -22,7 +22,7 @@ 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"; @@ -189,7 +189,7 @@ parent: returns (SurfaceDescriptor prevSurface); async PPluginSurface(WindowsSharedMemoryHandle handle, - gfxIntSize size, + IntSize size, bool transparent); intr NPN_PushPopupsEnabledState(bool aState); diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index a94d41a04ed5..6d970bddc644 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -2861,8 +2861,7 @@ PluginInstanceChild::CreateOptSurface(void) Visual* defaultVisual = DefaultVisualOfScreen(screen); mCurrentSurface = gfxXlibSurface::Create(screen, defaultVisual, - gfxIntSize(mWindow.width, - mWindow.height)); + IntSize(mWindow.width, mWindow.height)); return mCurrentSurface != nullptr; } @@ -2873,8 +2872,7 @@ PluginInstanceChild::CreateOptSurface(void) } mCurrentSurface = gfxXlibSurface::Create(screen, xfmt, - gfxIntSize(mWindow.width, - mWindow.height)); + IntSize(mWindow.width, mWindow.height)); return mCurrentSurface != nullptr; } #endif @@ -2898,7 +2896,7 @@ PluginInstanceChild::CreateOptSurface(void) // 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; } @@ -2966,7 +2964,7 @@ 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 @@ -2978,7 +2976,7 @@ PluginInstanceChild::EnsureCurrentBuffer(void) } if (mCurrentSurface) { - gfxIntSize surfSize = mCurrentSurface->GetSize(); + IntSize surfSize = mCurrentSurface->GetSize(); if (winSize != surfSize || (mBackground && !CanPaintOnBackground()) || (mBackground && @@ -3309,7 +3307,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect, nsRefPtr whiteImage; nsRefPtr 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" @@ -3487,7 +3485,7 @@ PluginInstanceChild::ShowPluginFrame() // 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)); @@ -3749,7 +3747,7 @@ PluginInstanceChild::RecvUpdateBackground(const SurfaceDescriptor& aBackground, return false; } - gfxIntSize bgSize = mBackground->GetSize(); + IntSize bgSize = mBackground->GetSize(); mAccumulatedInvalidRect.UnionRect(mAccumulatedInvalidRect, nsIntRect(0, 0, bgSize.width, bgSize.height)); AsyncShowPluginFrame(); @@ -3786,7 +3784,7 @@ PluginInstanceChild::RecvPPluginBackgroundDestroyerConstructor( // 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); diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h index e7bab586f172..a3b477425cf8 100644 --- a/dom/plugins/ipc/PluginInstanceChild.h +++ b/dom/plugins/ipc/PluginInstanceChild.h @@ -113,7 +113,7 @@ protected: virtual PPluginSurfaceChild* AllocPPluginSurfaceChild(const WindowsSharedMemoryHandle&, - const gfxIntSize&, const bool&) override { + const gfx::IntSize&, const bool&) override { return new PPluginSurfaceChild(); } diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index 5bb6a827e299..284f3cc5acd7 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -726,7 +726,7 @@ 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; } @@ -795,7 +795,7 @@ PluginInstanceParent::BeginUpdateBackground(const nsIntRect& aRect, } } - 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"); @@ -852,7 +852,7 @@ PluginInstanceParent::CreateBackground(const nsIntSize& aSize) 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) @@ -861,7 +861,7 @@ PluginInstanceParent::CreateBackground(const nsIntSize& aSize) mBackground = gfxSharedImageSurface::CreateUnsafe( this, - gfxIntSize(aSize.width, aSize.height), + mozilla::gfx::IntSize(aSize.width, aSize.height), gfxImageFormat::RGB24); return !!mBackground; #else @@ -1600,7 +1600,7 @@ PluginInstanceParent::GetActorForNPObject(NPObject* aObject) PPluginSurfaceParent* PluginInstanceParent::AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle, - const gfxIntSize& size, + const mozilla::gfx::IntSize& size, const bool& transparent) { #ifdef XP_WIN diff --git a/dom/plugins/ipc/PluginInstanceParent.h b/dom/plugins/ipc/PluginInstanceParent.h index 84c467da21f6..01b9c8c2f216 100644 --- a/dom/plugins/ipc/PluginInstanceParent.h +++ b/dom/plugins/ipc/PluginInstanceParent.h @@ -169,7 +169,7 @@ public: virtual PPluginSurfaceParent* AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle, - const gfxIntSize& size, + const mozilla::gfx::IntSize& size, const bool& transparent) override; virtual bool diff --git a/dom/plugins/ipc/PluginSurfaceParent.cpp b/dom/plugins/ipc/PluginSurfaceParent.cpp index a9087cb1f42d..1d5e19ad6438 100644 --- a/dom/plugins/ipc/PluginSurfaceParent.cpp +++ b/dom/plugins/ipc/PluginSurfaceParent.cpp @@ -12,7 +12,7 @@ namespace mozilla { namespace plugins { PluginSurfaceParent::PluginSurfaceParent(const WindowsSharedMemoryHandle& handle, - const gfxIntSize& size, + const gfx::IntSize& size, bool transparent) { SharedDIBSurface* dibsurf = new SharedDIBSurface(); diff --git a/dom/plugins/ipc/PluginSurfaceParent.h b/dom/plugins/ipc/PluginSurfaceParent.h index 07f1423cbba1..12dab7e728e2 100644 --- a/dom/plugins/ipc/PluginSurfaceParent.h +++ b/dom/plugins/ipc/PluginSurfaceParent.h @@ -23,7 +23,7 @@ class PluginSurfaceParent : public PPluginSurfaceParent { public: PluginSurfaceParent(const WindowsSharedMemoryHandle& handle, - const gfxIntSize& size, + const gfx::IntSize& size, const bool transparent); ~PluginSurfaceParent(); diff --git a/gfx/src/nsSize.h b/gfx/src/nsSize.h index 5535268c12a0..578cbaa195af 100644 --- a/gfx/src/nsSize.h +++ b/gfx/src/nsSize.h @@ -14,7 +14,6 @@ #define NS_MAXSIZE nscoord_MAX typedef mozilla::gfx::IntSize nsIntSize; -typedef nsIntSize gfxIntSize; struct nsSize : public mozilla::gfx::BaseSize { typedef mozilla::gfx::BaseSize Super; diff --git a/gfx/thebes/gfxBlur.cpp b/gfx/thebes/gfxBlur.cpp index 4cf82ad531e7..2ccd90367e19 100644 --- a/gfx/thebes/gfxBlur.cpp +++ b/gfx/thebes/gfxBlur.cpp @@ -174,10 +174,10 @@ struct BlurCacheKey : public PLDHashEntryHdr { // 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), @@ -199,7 +199,7 @@ struct BlurCacheKey : public PLDHashEntryHdr { { } 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) @@ -316,7 +316,7 @@ class BlurCache final : public nsExpirationTracker } BlurCacheData* Lookup(const IntSize aMinSize, - const gfxIntSize& aBlurRadius, + const IntSize& aBlurRadius, RectCornerRadii* aCornerRadii, const gfxRGBA& aShadowColor, BackendType aBackendType) @@ -334,8 +334,8 @@ class BlurCache final : public nsExpirationTracker 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, @@ -383,7 +383,7 @@ static BlurCache* gBlurCache = nullptr; static IntSize ComputeMinSizeForShadowShape(RectCornerRadii* aCornerRadii, - gfxIntSize aBlurRadius, + IntSize aBlurRadius, IntMargin& aSlice, const IntSize& aRectSize) { @@ -430,7 +430,7 @@ ComputeMinSizeForShadowShape(RectCornerRadii* aCornerRadii, void CacheBlur(DrawTarget& aDT, const IntSize& aMinSize, - const gfxIntSize& aBlurRadius, + const IntSize& aBlurRadius, RectCornerRadii* aCornerRadii, const gfxRGBA& aShadowColor, IntMargin aExtendDest, @@ -447,7 +447,7 @@ CacheBlur(DrawTarget& aDT, static already_AddRefed CreateBlurMask(const IntSize& aRectSize, RectCornerRadii* aCornerRadii, - gfxIntSize aBlurRadius, + IntSize aBlurRadius, IntMargin& aExtendDestBy, IntMargin& aSliceBorder, DrawTarget& aDestDrawTarget) @@ -458,7 +458,7 @@ CreateBlurMask(const IntSize& aRectSize, 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) { @@ -512,7 +512,7 @@ CreateBoxShadow(SourceSurface* aBlurMask, const gfxRGBA& aShadowColor) static SourceSurface* GetBlur(DrawTarget& aDT, const IntSize& aRectSize, - const gfxIntSize& aBlurRadius, + const IntSize& aBlurRadius, RectCornerRadii* aCornerRadii, const gfxRGBA& aShadowColor, IntMargin& aExtendDestBy, @@ -785,15 +785,15 @@ GetBoxShadowInsetPath(DrawTarget* aDrawTarget, } 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; @@ -847,8 +847,8 @@ FillDestinationPath(gfxContext* aDestinationCtx, 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, @@ -869,8 +869,8 @@ CacheInsetBlur(const IntSize aMinOuterSize, already_AddRefed 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, @@ -882,8 +882,8 @@ gfxAlphaBoxBlur::GetInsetBlur(Rect& aOuterRect, 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 = @@ -903,7 +903,7 @@ gfxAlphaBoxBlur::GetInsetBlur(Rect& aOuterRect, // 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; @@ -951,8 +951,8 @@ 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, diff --git a/gfx/thebes/gfxBlur.h b/gfx/thebes/gfxBlur.h index a099a2d43469..e5a7a03aec7d 100644 --- a/gfx/thebes/gfxBlur.h +++ b/gfx/thebes/gfxBlur.h @@ -155,8 +155,8 @@ public: 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, @@ -166,8 +166,8 @@ protected: already_AddRefed 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, diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index 4e23d2b2ebc0..c1afa8650916 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -663,8 +663,8 @@ PrescaleAndTileDrawable(gfxDrawable* aDrawable, 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 diff --git a/image/DynamicImage.cpp b/image/DynamicImage.cpp index 87608f41bb84..6aa1bfdffdf2 100644 --- a/image/DynamicImage.cpp +++ b/image/DynamicImage.cpp @@ -130,7 +130,7 @@ DynamicImage::GetHeight(int32_t* aHeight) NS_IMETHODIMP DynamicImage::GetIntrinsicSize(nsSize* aSize) { - gfxIntSize intSize(mDrawable->Size()); + IntSize intSize(mDrawable->Size()); *aSize = nsSize(intSize.width, intSize.height); return NS_OK; } @@ -138,7 +138,7 @@ DynamicImage::GetIntrinsicSize(nsSize* aSize) NS_IMETHODIMP DynamicImage::GetIntrinsicRatio(nsSize* aSize) { - gfxIntSize intSize(mDrawable->Size()); + IntSize intSize(mDrawable->Size()); *aSize = nsSize(intSize.width, intSize.height); return NS_OK; } @@ -167,7 +167,7 @@ NS_IMETHODIMP_(already_AddRefed) 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); @@ -225,7 +225,7 @@ DynamicImage::Draw(gfxContext* aContext, { MOZ_ASSERT(!aSize.IsEmpty(), "Unexpected empty size"); - gfxIntSize drawableSize(mDrawable->Size()); + IntSize drawableSize(mDrawable->Size()); if (aSize == drawableSize) { gfxUtils::DrawPixelSnapped(aContext, mDrawable, drawableSize, aRegion, @@ -327,7 +327,7 @@ 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); } diff --git a/image/OrientedImage.cpp b/image/OrientedImage.cpp index 5de600b8b337..0ec6dfe1d725 100644 --- a/image/OrientedImage.cpp +++ b/image/OrientedImage.cpp @@ -81,7 +81,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame, } // Get the underlying dimensions. - gfxIntSize size; + IntSize size; rv = InnerImage()->GetWidth(&size.width); NS_ENSURE_SUCCESS(rv, nullptr); rv = InnerImage()->GetHeight(&size.height); diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index 803c63f60b43..20d03c3fb13d 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -539,7 +539,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding, 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); } diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 15abbe5febaf..5bf99aafc6ed 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -4784,7 +4784,7 @@ nsImageRenderer::ComputeIntrinsicSize() } } 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))); @@ -5018,7 +5018,7 @@ nsImageRenderer::DrawableForElement(const nsRect& aImageRect, 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 drawable = nsSVGIntegrationUtils::DrawableFromPaintServer( mPaintServerFrame, mForFrame, mSize, imageSize, @@ -5277,7 +5277,7 @@ static inline gfxPoint ComputeBlurStdDev(nscoord aBlurRadius, gfxFloat(MAX_BLUR_RADIUS)) / 2.0); } -static inline gfxIntSize +static inline IntSize ComputeBlurRadius(nscoord aBlurRadius, int32_t aAppUnitsPerDevPixel, gfxFloat aScaleX = 1.0, @@ -5306,8 +5306,8 @@ nsContextBoxBlur::Init(const nsRect& aRect, nscoord aSpreadRadius, return nullptr; } - gfxIntSize blurRadius; - gfxIntSize spreadRadius; + IntSize blurRadius; + IntSize spreadRadius; GetBlurAndSpreadRadius(aDestinationCtx, aAppUnitsPerDevPixel, aBlurRadius, aSpreadRadius, blurRadius, spreadRadius); @@ -5379,7 +5379,7 @@ nsContextBoxBlur::GetContext() 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; @@ -5462,8 +5462,8 @@ nsContextBoxBlur::GetBlurAndSpreadRadius(gfxContext* aDestinationCtx, int32_t aAppUnitsPerDevPixel, nscoord aBlurRadius, nscoord aSpreadRadius, - gfxIntSize& aOutBlurRadius, - gfxIntSize& aOutSpreadRadius, + IntSize& aOutBlurRadius, + IntSize& aOutSpreadRadius, bool aConstrainSpreadRadius) { gfxFloat scaleX = 1; @@ -5484,8 +5484,8 @@ nsContextBoxBlur::GetBlurAndSpreadRadius(gfxContext* aDestinationCtx, // 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) { @@ -5511,8 +5511,8 @@ nsContextBoxBlur::InsetBoxBlur(gfxContext* aDestinationCtx, 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, diff --git a/layout/base/nsCSSRendering.h b/layout/base/nsCSSRendering.h index bdc4133a9b36..19219720eecc 100644 --- a/layout/base/nsCSSRendering.h +++ b/layout/base/nsCSSRendering.h @@ -983,8 +983,8 @@ protected: int32_t aAppUnitsPerDevPixel, nscoord aBlurRadius, nscoord aSpreadRadius, - gfxIntSize& aOutBlurRadius, - gfxIntSize& aOutSpreadRadius, + mozilla::gfx::IntSize& aOutBlurRadius, + mozilla::gfx::IntSize& aOutSpreadRadius, bool aConstrainSpreadRadius = true); gfxAlphaBoxBlur mAlphaBoxBlur; diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 8b517c8a369d..8e2ea013d7a9 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -6828,7 +6828,7 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement, 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; @@ -6858,7 +6858,7 @@ nsLayoutUtils::SurfaceFromElement(HTMLCanvasElement* aElement, isPremultiplied = &result.mIsPremultiplied; } - gfxIntSize size = aElement->GetSize(); + IntSize size = aElement->GetSize(); result.mSourceSurface = aElement->GetSurfaceSnapshot(isPremultiplied); if (!result.mSourceSurface) { diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 75fa6d36f8c8..70aca8dd21e0 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -2066,7 +2066,7 @@ public: 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 mPrincipal; diff --git a/layout/svg/nsFilterInstance.cpp b/layout/svg/nsFilterInstance.cpp index d276816b1f31..ee6ab737bec4 100644 --- a/layout/svg/nsFilterInstance.cpp +++ b/layout/svg/nsFilterInstance.cpp @@ -531,7 +531,7 @@ nsFilterInstance::OutputFilterSpaceBounds() const nsIntRect bounds = mPrimitiveDescriptions[numPrimitives - 1].PrimitiveSubregion(); bool overflow; - gfxIntSize surfaceSize = + IntSize surfaceSize = nsSVGUtils::ConvertToSurfaceSize(bounds.Size(), &overflow); bounds.SizeTo(surfaceSize); return bounds; diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp index c58832620f10..73964ce9d25c 100644 --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -610,7 +610,7 @@ class PaintFrameCallback : public gfxDrawingCallback { public: PaintFrameCallback(nsIFrame* aFrame, const nsSize aPaintServerSize, - const gfxIntSize aRenderSize, + const IntSize aRenderSize, uint32_t aFlags) : mFrame(aFrame) , mPaintServerSize(aPaintServerSize) @@ -624,7 +624,7 @@ public: private: nsIFrame* mFrame; nsSize mPaintServerSize; - gfxIntSize mRenderSize; + IntSize mRenderSize; uint32_t mFlags; }; @@ -695,7 +695,7 @@ PaintFrameCallback::operator()(gfxContext* aContext, nsSVGIntegrationUtils::DrawableFromPaintServer(nsIFrame* aFrame, nsIFrame* aTarget, const nsSize& aPaintServerSize, - const gfxIntSize& aRenderSize, + const IntSize& aRenderSize, const DrawTarget* aDrawTarget, const gfxMatrix& aContextMatrix, uint32_t aFlags) diff --git a/layout/svg/nsSVGIntegrationUtils.h b/layout/svg/nsSVGIntegrationUtils.h index 2554e6e69d42..e14a9fa01a39 100644 --- a/layout/svg/nsSVGIntegrationUtils.h +++ b/layout/svg/nsSVGIntegrationUtils.h @@ -166,13 +166,13 @@ public: }; static already_AddRefed - 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_*/ diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index e3b50b1f7cf1..5d7aeb4a80af 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -802,11 +802,11 @@ nsSVGUtils::TransformFrameRectToOuterSVG(const nsRect& aRect, 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); diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index a450c795cc52..03062111fbc6 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -351,8 +351,8 @@ public: * @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. diff --git a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h index a66968768fd8..ed288750420b 100644 --- a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h +++ b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h @@ -158,19 +158,20 @@ Fake_VideoStreamSource::Notify(nsITimer* aTimer) 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 diff --git a/widget/android/nsScreenManagerAndroid.cpp b/widget/android/nsScreenManagerAndroid.cpp index 4cc09728299b..f7d0f67fd407 100644 --- a/widget/android/nsScreenManagerAndroid.cpp +++ b/widget/android/nsScreenManagerAndroid.cpp @@ -29,7 +29,7 @@ nsScreenAndroid::GetId(uint32_t *outId) 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; diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 0467f543fdff..56a31bbd8c8c 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -83,8 +83,8 @@ 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" @@ -623,7 +623,7 @@ nsWindow::Resize(double aX, 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()) @@ -1045,7 +1045,7 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) } void -nsWindow::OnSizeChanged(const gfxIntSize& aSize) +nsWindow::OnSizeChanged(const gfx::IntSize& aSize) { ALOG("nsWindow: %p OnSizeChanged [%d %d]", (void*)this, aSize.width, aSize.height); @@ -1071,7 +1071,7 @@ nsWindow::InitEvent(WidgetGUIEvent& event, nsIntPoint* aPoint) event.time = PR_Now() / 1000; } -gfxIntSize +gfx::IntSize nsWindow::GetAndroidScreenBounds() { if (XRE_IsContentProcess()) { diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index d201949cd083..417562157eda 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -51,7 +51,7 @@ public: mozilla::UniquePtr mNatives; static void OnGlobalAndroidEvent(mozilla::AndroidGeckoEvent *ae); - static gfxIntSize GetAndroidScreenBounds(); + static mozilla::gfx::IntSize GetAndroidScreenBounds(); static nsWindow* TopWindow(); bool OnContextmenuEvent(mozilla::AndroidGeckoEvent *ae); @@ -62,7 +62,7 @@ public: 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); diff --git a/widget/cocoa/nsCocoaUtils.mm b/widget/cocoa/nsCocoaUtils.mm index afa1a20eca4e..ee95fb0b6e6f 100644 --- a/widget/cocoa/nsCocoaUtils.mm +++ b/widget/cocoa/nsCocoaUtils.mm @@ -475,8 +475,7 @@ nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer *aImage, ui // 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 = gfxPlatform::GetPlatform()-> CreateOffscreenContentDrawTarget(scaledSize, SurfaceFormat::B8G8R8A8); diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 35ab605c3a8a..0258fa8e57db 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -6286,7 +6286,7 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDrawable* aDrawable, 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. @@ -6304,7 +6304,7 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDrawable* aDrawable, } result = new gfxXlibSurface(xScreen, xDrawable, pf, - gfxIntSize(aSize.width, aSize.height)); + IntSize(aSize.width, aSize.height)); } return result.forget(); diff --git a/widget/nsShmImage.cpp b/widget/nsShmImage.cpp index bc152dabc81f..f5266d6e849d 100644 --- a/widget/nsShmImage.cpp +++ b/widget/nsShmImage.cpp @@ -46,7 +46,7 @@ TrapShmError(Display* aDisplay, XErrorEvent* aEvent) #endif already_AddRefed -nsShmImage::Create(const gfxIntSize& aSize, +nsShmImage::Create(const IntSize& aSize, Display* aDisplay, Visual* aVisual, unsigned int aDepth) { nsRefPtr shm = new nsShmImage(); @@ -180,7 +180,7 @@ nsShmImage::Put(QWindow* aWindow, QRect& aRect) #endif already_AddRefed -nsShmImage::EnsureShmImage(const gfxIntSize& aSize, +nsShmImage::EnsureShmImage(const IntSize& aSize, Display* aDisplay, Visual* aVisual, unsigned int aDepth, nsRefPtr& aImage) { diff --git a/widget/nsShmImage.h b/widget/nsShmImage.h index a125e5ef71f8..6f14c6c3fc82 100644 --- a/widget/nsShmImage.h +++ b/widget/nsShmImage.h @@ -38,10 +38,10 @@ class nsShmImage { public: static bool UseShm(); static already_AddRefed - Create(const gfxIntSize& aSize, + Create(const mozilla::gfx::IntSize& aSize, Display* aDisplay, Visual* aVisual, unsigned int aDepth); static already_AddRefed - EnsureShmImage(const gfxIntSize& aSize, + EnsureShmImage(const mozilla::gfx::IntSize& aSize, Display* aDisplay, Visual* aVisual, unsigned int aDepth, nsRefPtr& aImage); @@ -65,7 +65,7 @@ public: void Put(QWindow* aWindow, QRect& aRect); #endif - gfxIntSize Size() const { return mSize; } + mozilla::gfx::IntSize Size() const { return mSize; } private: nsShmImage() @@ -79,7 +79,7 @@ private: XImage* mImage; Display* mDisplay; XShmSegmentInfo mInfo; - gfxIntSize mSize; + mozilla::gfx::IntSize mSize; mozilla::gfx::SurfaceFormat mFormat; bool mXAttached; }; diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 74887d126907..e7a93204f5f5 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -817,8 +817,8 @@ nsWindow::StartRemoteDrawing() 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) { diff --git a/widget/uikit/nsWindow.h b/widget/uikit/nsWindow.h index 00e1c7a537fd..47cfdbb85bd2 100644 --- a/widget/uikit/nsWindow.h +++ b/widget/uikit/nsWindow.h @@ -126,7 +126,7 @@ protected: nsWindow* mParent; InputContext mInputContext; - void OnSizeChanged(const gfxIntSize& aSize); + void OnSizeChanged(const mozilla::gfx::IntSize& aSize); static void DumpWindows(); static void DumpWindows(const nsTArray& wins, int indent = 0); diff --git a/widget/windows/TaskbarPreview.cpp b/widget/windows/TaskbarPreview.cpp index 333da4e0220f..3d218eead201 100644 --- a/widget/windows/TaskbarPreview.cpp +++ b/widget/windows/TaskbarPreview.cpp @@ -357,7 +357,7 @@ TaskbarPreview::UpdateTooltip() { void TaskbarPreview::DrawBitmap(uint32_t width, uint32_t height, bool isPreview) { nsresult rv; - nsRefPtr surface = new gfxWindowsSurface(gfxIntSize(width, height), gfxImageFormat::ARGB32); + nsRefPtr surface = new gfxWindowsSurface(gfx::IntSize(width, height), gfxImageFormat::ARGB32); nsCOMPtr shell = do_QueryReferent(mDocShell); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 55c884c4cf5f..e63d19eae6c6 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -2629,7 +2629,7 @@ NS_IMETHODIMP nsWindow::SetCursor(imgIContainer* aCursor, 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); @@ -6986,7 +6986,7 @@ void nsWindow::ResizeTranslucentWindow(int32_t aNewWidth, int32_t aNewHeight, bo return; nsRefPtr newSurface = - new gfxWindowsSurface(gfxIntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32); + new gfxWindowsSurface(IntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32); mTransparentSurface = newSurface; mMemoryDC = newSurface->GetDC(); } diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index 5c48f5e6b1ab..7b7f3e5fcbab 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -70,7 +70,7 @@ using namespace mozilla::plugins; **************************************************************/ static nsAutoPtr sSharedSurfaceData; -static gfxIntSize sSharedSurfaceSize; +static IntSize sSharedSurfaceSize; struct IconMetrics { int32_t xMetric; @@ -137,9 +137,9 @@ nsIntRegion nsWindow::GetRegionToPaint(bool aForceFullRepaint, #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); @@ -341,8 +341,8 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) (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!"); @@ -425,7 +425,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) 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; @@ -560,7 +560,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) 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); @@ -568,14 +568,14 @@ gfxIntSize nsWindowGfx::GetIconMetrics(IconSizeType aSizeType) { 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) || diff --git a/widget/windows/nsWindowGfx.h b/widget/windows/nsWindowGfx.h index a73c165c5fa5..3f4d7636210e 100644 --- a/widget/windows/nsWindowGfx.h +++ b/widget/windows/nsWindowGfx.h @@ -19,8 +19,10 @@ public: 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: /**