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.
This commit is contained in:
Nicholas Nethercote 2015-09-23 11:49:05 -07:00
parent 4643668be4
commit 19203be089
60 changed files with 171 additions and 172 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -53,7 +53,7 @@ struct ImageCacheEntryData {
// Value
nsCOMPtr<imgIRequest> mRequest;
RefPtr<SourceSurface> 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();

View File

@ -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

View File

@ -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<gfxImageSurface> imgsurf = new gfxImageSurface(gfxIntSize(copyWidth, copyHeight),
nsRefPtr<gfxImageSurface> imgsurf = new gfxImageSurface(gfx::IntSize(copyWidth, copyHeight),
gfxImageFormat::ARGB32,
false);
if (!imgsurf || imgsurf->CairoStatus()) {

View File

@ -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<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);
@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -1979,7 +1979,7 @@ TabParent::RecvSetCustomCursor(const nsCString& aCursorData,
}
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());

View File

@ -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<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();

View File

@ -42,11 +42,11 @@ public:
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>());
}
@ -79,7 +79,7 @@ public:
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
@ -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;

View File

@ -14,7 +14,7 @@ namespace mozilla {
using namespace layers;
VideoFrame::VideoFrame(already_AddRefed<Image>& 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<Image>
VideoFrame::CreateBlackImage(const gfxIntSize& aSize)
VideoFrame::CreateBlackImage(const gfx::IntSize& aSize)
{
nsRefPtr<ImageContainer> container;
nsRefPtr<Image> image;

View File

@ -30,7 +30,7 @@ public:
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();
@ -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<Image> CreateBlackImage(const gfxIntSize& aSize);
static already_AddRefed<Image> 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<Image> mImage;
// The desired size to render the video frame at.
gfxIntSize mIntrinsicSize;
gfx::IntSize mIntrinsicSize;
bool mForceBlack;
};

View File

@ -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));
}
}

View File

@ -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());

View File

@ -251,7 +251,7 @@ 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;

View File

@ -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.

View File

@ -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<MetadataHolder> metadata = new MetadataHolder();

View File

@ -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));
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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<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"
@ -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);

View File

@ -113,7 +113,7 @@ protected:
virtual PPluginSurfaceChild*
AllocPPluginSurfaceChild(const WindowsSharedMemoryHandle&,
const gfxIntSize&, const bool&) override {
const gfx::IntSize&, const bool&) override {
return new PPluginSurfaceChild();
}

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -23,7 +23,7 @@ class PluginSurfaceParent : public PPluginSurfaceParent
{
public:
PluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
const gfxIntSize& size,
const gfx::IntSize& size,
const bool transparent);
~PluginSurfaceParent();

View File

@ -14,7 +14,6 @@
#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;

View File

@ -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,4>
}
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,4>
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<SourceSurface>
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<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,
@ -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,

View File

@ -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<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,

View File

@ -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

View File

@ -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<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);
@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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<gfxDrawable> 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,

View File

@ -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;

View File

@ -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) {

View File

@ -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<nsIPrincipal> mPrincipal;

View File

@ -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;

View File

@ -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)

View File

@ -166,13 +166,13 @@ public:
};
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_*/

View File

@ -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);

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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()) {

View File

@ -51,7 +51,7 @@ public:
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);
@ -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);

View File

@ -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> drawTarget = gfxPlatform::GetPlatform()->
CreateOffscreenContentDrawTarget(scaledSize, SurfaceFormat::B8G8R8A8);

View File

@ -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();

View File

@ -46,7 +46,7 @@ TrapShmError(Display* aDisplay, XErrorEvent* aEvent)
#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();
@ -180,7 +180,7 @@ nsShmImage::Put(QWindow* aWindow, QRect& aRect)
#endif
already_AddRefed<DrawTarget>
nsShmImage::EnsureShmImage(const gfxIntSize& aSize,
nsShmImage::EnsureShmImage(const IntSize& aSize,
Display* aDisplay, Visual* aVisual, unsigned int aDepth,
nsRefPtr<nsShmImage>& aImage)
{

View File

@ -38,10 +38,10 @@ class nsShmImage {
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);
@ -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;
};

View File

@ -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) {

View File

@ -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<nsWindow*>& wins, int indent = 0);

View File

@ -357,7 +357,7 @@ TaskbarPreview::UpdateTooltip() {
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);

View File

@ -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<gfxWindowsSurface> newSurface =
new gfxWindowsSurface(gfxIntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32);
new gfxWindowsSurface(IntSize(aNewWidth, aNewHeight), gfxImageFormat::ARGB32);
mTransparentSurface = newSurface;
mMemoryDC = newSurface->GetDC();
}

View File

@ -70,7 +70,7 @@ using namespace mozilla::plugins;
**************************************************************/
static nsAutoPtr<uint8_t> 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) ||

View File

@ -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:
/**