Bug 1132854 - Make nsIntSize a typedef of gfx::IntSize. r=Bas, roc

This commit is contained in:
Nicolas Silva 2015-03-29 16:59:08 +02:00
Родитель 46dfeaba0b
Коммит e3eaf89e3f
43 изменённых файлов: 66 добавлений и 142 удалений

Просмотреть файл

@ -9,8 +9,8 @@ include protocol PContent;
include "mozilla/GfxMessageUtils.h";
using struct nsIntPoint from "nsRect.h";
using struct nsIntSize from "nsRect.h";
using struct nsIntRect from "nsRect.h";
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
namespace mozilla {
namespace a11y {
@ -131,7 +131,7 @@ child:
prio(high) sync PasteText(uint64_t aID, int32_t aPosition);
prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(nsIntPoint aRetVal);
prio(high) sync ImageSize(uint64_t aID) returns(nsIntSize aRetVal);
prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
prio(high) sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);

Просмотреть файл

@ -51,6 +51,7 @@
#include "mozilla/dom/WindowBinding.h"
#include "Units.h"
#include "nsComponentManagerUtils.h"
#include "nsSize.h"
#define DEFAULT_HOME_PAGE "www.mozilla.org"
#define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage"
@ -90,7 +91,6 @@ class nsGlobalWindowObserver;
class nsGlobalWindow;
class nsDOMWindowUtils;
class nsIIdleService;
struct nsIntSize;
struct nsRect;
class nsWindowSizes;

Просмотреть файл

@ -40,7 +40,7 @@ using struct mozilla::widget::IMENotification from "nsIWidget.h";
using struct nsIMEUpdatePreference from "nsIWidget.h";
using struct nsIntPoint from "nsPoint.h";
using struct nsIntRect from "nsRect.h";
using struct nsIntSize from "nsSize.h";
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
@ -605,7 +605,7 @@ child:
PDocumentRenderer(nsRect documentRect, Matrix transform,
nsString bgcolor,
uint32_t renderFlags, bool flushLayout,
nsIntSize renderSize);
IntSize renderSize);
/**
* Sent by the chrome process when it no longer wants this remote

Просмотреть файл

@ -7,7 +7,7 @@ include protocol PBrowser;
include "mozilla/GfxMessageUtils.h";
using struct nsIntSize from "nsSize.h";
using nsIntSize from "nsSize.h";
namespace mozilla {
namespace ipc {

Просмотреть файл

@ -257,7 +257,7 @@ VideoData::Create(VideoInfo& aInfo,
aDuration,
aKeyframe,
aTimecode,
aInfo.mDisplay.ToIntSize()));
aInfo.mDisplay));
return v.forget();
}
@ -299,7 +299,7 @@ VideoData::Create(VideoInfo& aInfo,
aDuration,
aKeyframe,
aTimecode,
aInfo.mDisplay.ToIntSize()));
aInfo.mDisplay));
#ifdef MOZ_WIDGET_GONK
const YCbCrBuffer::Plane &Y = aBuffer.mPlanes[0];
const YCbCrBuffer::Plane &Cb = aBuffer.mPlanes[1];
@ -401,7 +401,7 @@ VideoData::CreateFromImage(VideoInfo& aInfo,
aDuration,
aKeyframe,
aTimecode,
aInfo.mDisplay.ToIntSize()));
aInfo.mDisplay));
v->mImage = aImage;
return v.forget();
}
@ -427,7 +427,7 @@ VideoData::Create(VideoInfo& aInfo,
aDuration,
aKeyframe,
aTimecode,
aInfo.mDisplay.ToIntSize()));
aInfo.mDisplay));
return v.forget();
}
@ -454,7 +454,7 @@ VideoData::Create(VideoInfo& aInfo,
aDuration,
aKeyframe,
aTimecode,
aInfo.mDisplay.ToIntSize()));
aInfo.mDisplay));
v->mImage = aContainer->CreateImage(ImageFormat::GRALLOC_PLANAR_YCBCR);
if (!v->mImage) {

Просмотреть файл

@ -11,6 +11,7 @@
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/CheckedInt.h"
#include "nsIThread.h"
#include "nsSize.h"
#if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \
defined(MOZ_ASAN)
@ -27,7 +28,6 @@ using mozilla::CheckedUint64;
using mozilla::CheckedInt32;
using mozilla::CheckedUint32;
struct nsIntSize;
struct nsIntRect;
// This file contains stuff we'd rather put elsewhere, but which is

Просмотреть файл

@ -240,7 +240,7 @@ VideoTrackEncoder::AppendVideoSegment(const VideoSegment& aSegment)
nsRefPtr<layers::Image> image = chunk.mFrame.GetImage();
mRawSegment.AppendFrame(image.forget(),
chunk.GetDuration(),
chunk.mFrame.GetIntrinsicSize().ToIntSize(),
chunk.mFrame.GetIntrinsicSize(),
chunk.mFrame.GetForceBlack());
iter.Next();
}

Просмотреть файл

@ -1121,7 +1121,7 @@ void GStreamerReader::VideoPreroll()
if (IsValidVideoRegion(frameSize, pictureRect, displaySize)) {
GstStructure* structure = gst_caps_get_structure(caps, 0);
gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen);
mInfo.mVideo.mDisplay = ThebesIntSize(displaySize.ToIntSize());
mInfo.mVideo.mDisplay = ThebesIntSize(displaySize);
mInfo.mVideo.mHasVideo = true;
} else {
LOG(PR_LOG_DEBUG, "invalid video region");

Просмотреть файл

@ -10,7 +10,6 @@
#include "nsAutoPtr.h"
#include "mozilla/Mutex.h"
struct nsIntSize;
struct nsIntRect;
namespace mozilla {

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef nsNPAPIPluginInstance_h_
#define nsNPAPIPluginInstance_h_
#include "nsSize.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "nsPIDOMWindow.h"

Просмотреть файл

@ -641,7 +641,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
NS_ASSERTION(image->GetFormat() == ImageFormat::CAIRO_SURFACE, "Wrong format?");
CairoImage* cairoImage = static_cast<CairoImage*>(image.get());
CairoImage::Data cairoData;
cairoData.mSize = surface->GetSize().ToIntSize();
cairoData.mSize = surface->GetSize();
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
cairoImage->SetData(cairoData);

Просмотреть файл

@ -14,11 +14,11 @@
#include "nsTArray.h"
#include "nsError.h"
#include "mozilla/EventForwards.h"
#include "nsSize.h"
class gfxContext;
class nsCString;
struct nsIntRect;
struct nsIntSize;
class nsNPAPIPlugin;
namespace mozilla {

Просмотреть файл

@ -265,7 +265,7 @@ gfx::IntSize TextureImage::GetSize() const {
TextureImage::TextureImage(const gfx::IntSize& aSize,
GLenum aWrapMode, ContentType aContentType,
Flags aFlags)
Flags aFlags, ImageFormat aImageFormat)
: mSize(aSize)
, mWrapMode(aWrapMode)
, mContentType(aContentType)
@ -273,21 +273,6 @@ TextureImage::TextureImage(const gfx::IntSize& aSize,
, mFlags(aFlags)
{}
BasicTextureImage::BasicTextureImage(GLuint aTexture,
const nsIntSize& aSize,
GLenum aWrapMode,
ContentType aContentType,
GLContext* aContext,
TextureImage::Flags aFlags /* = TextureImage::NoFlags */,
TextureImage::ImageFormat aImageFormat /* = gfxImageFormat::Unknown */)
: TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat)
, mTexture(aTexture)
, mTextureState(Created)
, mGLContext(aContext)
, mUpdateOffset(0, 0)
{
}
BasicTextureImage::BasicTextureImage(GLuint aTexture,
const gfx::IntSize& aSize,
GLenum aWrapMode,
@ -295,7 +280,7 @@ BasicTextureImage::BasicTextureImage(GLuint aTexture,
GLContext* aContext,
TextureImage::Flags aFlags,
TextureImage::ImageFormat aImageFormat)
: TextureImage(ThebesIntSize(aSize), aWrapMode, aContentType, aFlags, aImageFormat)
: TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat)
, mTexture(aTexture)
, mTextureState(Created)
, mGLContext(aContext)
@ -499,7 +484,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion)
(GetContentType() == gfxContentType::COLOR) ?
gfx::SurfaceFormat::B8G8R8X8: gfx::SurfaceFormat::B8G8R8A8;
mUpdateDrawTarget = gfx::Factory::CreateDrawTarget(gfx::BackendType::CAIRO,
bounds.Size().ToIntSize(),
bounds.Size(),
format);
return mUpdateDrawTarget;;

Просмотреть файл

@ -211,22 +211,10 @@ protected:
* TextureImage from GLContext::CreateTextureImage(). That is,
* clients must not be given partially-constructed TextureImages.
*/
TextureImage(const nsIntSize& aSize,
GLenum aWrapMode, ContentType aContentType,
Flags aFlags = NoFlags,
ImageFormat aImageFormat = gfxImageFormat::Unknown)
: mSize(aSize.ToIntSize())
, mWrapMode(aWrapMode)
, mContentType(aContentType)
, mImageFormat(aImageFormat)
, mFilter(GraphicsFilter::FILTER_GOOD)
, mFlags(aFlags)
{}
// Moz2D equivalent...
TextureImage(const gfx::IntSize& aSize,
GLenum aWrapMode, ContentType aContentType,
Flags aFlags = NoFlags);
Flags aFlags = NoFlags,
ImageFormat aImageFormat = gfxImageFormat::Unknown);
// Protected destructor, to discourage deletion outside of Release():
virtual ~TextureImage() {}
@ -257,13 +245,6 @@ class BasicTextureImage
public:
virtual ~BasicTextureImage();
BasicTextureImage(GLuint aTexture,
const nsIntSize& aSize,
GLenum aWrapMode,
ContentType aContentType,
GLContext* aContext,
TextureImage::Flags aFlags = TextureImage::NoFlags,
TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
BasicTextureImage(GLuint aTexture,
const gfx::IntSize& aSize,
GLenum aWrapMode,

Просмотреть файл

@ -106,7 +106,6 @@
*/
class nsIWidget;
struct nsIntSize;
class nsIntRegion;
namespace mozilla {

Просмотреть файл

@ -10,8 +10,6 @@
#include <stdint.h>
#include <mozilla/UniquePtr.h>
struct nsIntSize;
namespace mozilla {
namespace gl { class GLContext; }

Просмотреть файл

@ -164,15 +164,6 @@ AppendToString(std::stringstream& aStream, const EventRegions& e,
aStream << "}" << sfx;
}
void
AppendToString(std::stringstream& aStream, const nsIntSize& sz,
const char* pfx, const char* sfx)
{
aStream << pfx;
aStream << nsPrintfCString("(w=%d, h=%d)", sz.width, sz.height).get();
aStream << sfx;
}
void
AppendToString(std::stringstream& aStream, const FrameMetrics& m,
const char* pfx, const char* sfx, bool detailed)

Просмотреть файл

@ -19,7 +19,6 @@
struct gfxRGBA;
struct nsIntPoint;
struct nsIntRect;
struct nsIntSize;
namespace mozilla {
namespace gfx {
@ -133,10 +132,6 @@ void
AppendToString(std::stringstream& aStream, const EventRegions& e,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const nsIntSize& sz,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const FrameMetrics& m,
const char* pfx="", const char* sfx="", bool detailed = false);

Просмотреть файл

@ -21,8 +21,6 @@
#include "nsRegion.h" // for nsIntRegion
#include "LayersTypes.h"
struct nsIntSize;
namespace mozilla {
namespace gfx {
class Matrix;
@ -389,7 +387,7 @@ protected:
* buffer provider.
*/
gfxContentType BufferContentType();
bool BufferSizeOkFor(const nsIntSize& aSize);
bool BufferSizeOkFor(const gfx::IntSize& aSize);
/**
* If the buffer hasn't been mapped, map it.
*/

Просмотреть файл

@ -476,7 +476,7 @@ ClientLayerManager::MakeSnapshotIfRequired()
SurfaceDescriptor inSnapshot;
if (!bounds.IsEmpty() &&
mForwarder->AllocSurfaceDescriptor(bounds.Size().ToIntSize(),
mForwarder->AllocSurfaceDescriptor(bounds.Size(),
gfxContentType::COLOR_ALPHA,
&inSnapshot) &&
remoteRenderer->SendMakeSnapshot(inSnapshot, bounds)) {

Просмотреть файл

@ -59,8 +59,6 @@
#include "TextRenderer.h" // for TextRenderer
class gfxContext;
struct nsIntSize;
namespace mozilla {
namespace layers {

Просмотреть файл

@ -31,8 +31,6 @@
#include "LayerTreeInvalidation.h"
class gfxContext;
struct nsIntPoint;
struct nsIntSize;
#ifdef XP_WIN
#include <windows.h>

Просмотреть файл

@ -30,8 +30,6 @@
#include "mozilla/layers/AtomicRefCountedWithFinalize.h"
class gfxReusableSurfaceWrapper;
struct nsIntPoint;
struct nsIntSize;
struct nsIntRect;
namespace mozilla {

Просмотреть файл

@ -34,7 +34,6 @@
class gfxReusableSurfaceWrapper;
struct nsIntPoint;
struct nsIntRect;
struct nsIntSize;
namespace mozilla {
namespace gfx {
@ -309,7 +308,7 @@ private:
const gfx::Rect& aClipRect,
const nsIntRegion& aScreenRegion,
const nsIntPoint& aTextureOffset,
const nsIntSize& aTextureBounds);
const gfx::IntSize& aTextureBounds);
void EnsureTileStore() {}

Просмотреть файл

@ -1265,7 +1265,7 @@ CompositorD3D11::UpdateRenderTarget()
}
mDefaultRT = new CompositingRenderTargetD3D11(backBuf, IntPoint(0, 0));
mDefaultRT->SetSize(mSize.ToIntSize());
mDefaultRT->SetSize(mSize);
}
bool

Просмотреть файл

@ -5,7 +5,6 @@
using struct gfxPoint from "gfxPoint.h";
using struct nsIntRect from "nsRect.h";
using nsIntRegion from "nsRegion.h";
using struct nsIntSize from "nsSize.h";
using struct mozilla::layers::MagicGrallocBufferHandle from "gfxipc/ShadowLayerUtils.h";
using struct mozilla::layers::GrallocBufferRef from "gfxipc/ShadowLayerUtils.h";
using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";

Просмотреть файл

@ -64,7 +64,7 @@ GetXRenderPictFormatFromId(Display* aDisplay, PictFormat aFormatId)
SurfaceDescriptorX11::SurfaceDescriptorX11(gfxXlibSurface* aSurf)
: mId(aSurf->XDrawable())
, mSize(aSurf->GetSize().ToIntSize())
, mSize(aSurf->GetSize())
{
const XRenderPictFormat *pictFormat = aSurf->XRenderFormat();
if (pictFormat) {

Просмотреть файл

@ -280,15 +280,15 @@ TextureImageTextureSourceOGL::EnsureBuffer(const nsIntSize& aSize,
gfxContentType aContentType)
{
if (!mTexImage ||
mTexImage->GetSize() != aSize.ToIntSize() ||
mTexImage->GetSize() != aSize ||
mTexImage->GetContentType() != aContentType) {
mTexImage = CreateTextureImage(mCompositor->gl(),
aSize.ToIntSize(),
aSize,
aContentType,
LOCAL_GL_CLAMP_TO_EDGE,
FlagsToGLFlags(mFlags));
}
mTexImage->Resize(aSize.ToIntSize());
mTexImage->Resize(aSize);
}
void

Просмотреть файл

@ -41,7 +41,6 @@ class gfxReusableSurfaceWrapper;
class nsIntRegion;
struct nsIntPoint;
struct nsIntRect;
struct nsIntSize;
namespace mozilla {
namespace gfx {
@ -202,8 +201,8 @@ public:
nsIntRegion* aDestRegion = nullptr,
gfx::IntPoint* aSrcOffset = nullptr) override;
void EnsureBuffer(const nsIntSize& aSize,
gfxContentType aContentType);
void EnsureBuffer(const gfx::IntSize& aSize,
gfxContentType aContentType);
void CopyTo(const nsIntRect& aSourceRect,
DataTextureSource* aDest,

Просмотреть файл

@ -12,10 +12,10 @@
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsColor.h"
#include "nsSize.h"
struct nsRect;
struct nsIntRect;
struct nsIntSize;
class nsIntRegion;
struct nsFont;
struct nsIntMargin;

Просмотреть файл

@ -13,7 +13,7 @@
// Maximum allowable size
#define NS_MAXSIZE nscoord_MAX
struct nsIntSize;
typedef mozilla::gfx::IntSize nsIntSize;
typedef nsIntSize gfxIntSize;
struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
@ -35,19 +35,6 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
};
struct nsIntSize : public mozilla::gfx::BaseSize<int32_t, nsIntSize> {
typedef mozilla::gfx::BaseSize<int32_t, nsIntSize> Super;
nsIntSize() : Super() {}
nsIntSize(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}
inline nsSize ToAppUnits(nscoord aAppUnitsPerPixel) const;
mozilla::gfx::IntSize ToIntSize() const
{
return mozilla::gfx::IntSize(width, height);
};
};
inline nsIntSize
nsSize::ScaleToNearestPixels(float aXScale, float aYScale,
nscoord aAppUnitsPerPixel) const
@ -75,10 +62,10 @@ nsSize::ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const {
}
inline nsSize
nsIntSize::ToAppUnits(nscoord aAppUnitsPerPixel) const
IntSizeToAppUnits(mozilla::gfx::IntSize aSize, nscoord aAppUnitsPerPixel)
{
return nsSize(NSIntPixelsToAppUnits(width, aAppUnitsPerPixel),
NSIntPixelsToAppUnits(height, aAppUnitsPerPixel));
return nsSize(NSIntPixelsToAppUnits(aSize.width, aAppUnitsPerPixel),
NSIntPixelsToAppUnits(aSize.height, aAppUnitsPerPixel));
}
#endif /* NSSIZE_H */

Просмотреть файл

@ -297,9 +297,9 @@ TEST(Layers, TextureYCbCrSerialization) {
clientData.mYChannel = ySurface->Data();
clientData.mCbChannel = cbSurface->Data();
clientData.mCrChannel = crSurface->Data();
clientData.mYSize = ySurface->GetSize().ToIntSize();
clientData.mPicSize = ySurface->GetSize().ToIntSize();
clientData.mCbCrSize = cbSurface->GetSize().ToIntSize();
clientData.mYSize = ySurface->GetSize();
clientData.mPicSize = ySurface->GetSize();
clientData.mCbCrSize = cbSurface->GetSize();
clientData.mYStride = ySurface->Stride();
clientData.mCbCrStride = cbSurface->Stride();
clientData.mStereoMode = StereoMode::MONO;

Просмотреть файл

@ -115,7 +115,7 @@ gfxCallbackDrawable::MakeSurfaceDrawable(const GraphicsFilter aFilter)
SurfaceFormat format =
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(gfxContentType::COLOR_ALPHA);
RefPtr<DrawTarget> dt =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize.ToIntSize(),
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize,
format);
if (!dt)
return nullptr;

Просмотреть файл

@ -20,7 +20,6 @@ class gfxASurface;
class gfxContext;
struct nsIntRect;
struct nsIntPoint;
struct nsIntSize;
typedef struct _cairo cairo_t;
typedef struct _cairo_surface cairo_surface_t;
@ -82,18 +81,18 @@ public:
* successful, a pointer to the new gfxASurface is stored in *resultSurface,
* otherwise *resultSurface is set to nullptr.
*/
void Draw(gfxContext* ctx, nsIntSize size,
void Draw(gfxContext* ctx, mozilla::gfx::IntSize size,
uint32_t flags, Screen *screen, Visual *visual);
private:
bool DrawDirect(gfxContext *ctx, nsIntSize bounds,
bool DrawDirect(gfxContext *ctx, mozilla::gfx::IntSize bounds,
uint32_t flags, Screen *screen, Visual *visual);
bool DrawCairo(cairo_t* cr, nsIntSize size,
bool DrawCairo(cairo_t* cr, mozilla::gfx::IntSize size,
uint32_t flags, Screen *screen, Visual *visual);
void DrawFallback(mozilla::gfx::DrawTarget* dt, gfxContext* ctx,
gfxASurface* aSurface, nsIntSize& size,
gfxASurface* aSurface, mozilla::gfx::IntSize& size,
nsIntRect& drawingRect, bool canDrawOverBackground,
uint32_t flags, Screen* screen, Visual* visual);

Просмотреть файл

@ -470,7 +470,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum,
return RawAccessFrameRef();
}
if (!SurfaceCache::CanHold(aTargetSize.ToIntSize())) {
if (!SurfaceCache::CanHold(aTargetSize)) {
NS_WARNING("Trying to add frame that's too large for the SurfaceCache");
return RawAccessFrameRef();
}
@ -492,7 +492,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum,
InsertOutcome outcome =
SurfaceCache::Insert(frame, ImageKey(mImage.get()),
RasterSurfaceKey(aTargetSize.ToIntSize(),
RasterSurfaceKey(aTargetSize,
aDecodeFlags,
aFrameNum),
Lifetime::Persistent);

Просмотреть файл

@ -161,7 +161,7 @@ public:
// Insert the new surface into the cache immediately. We need to do this so
// that we won't start multiple scaling jobs for the same size.
SurfaceCache::Insert(mDstRef.get(), ImageKey(mImage.get()),
RasterSurfaceKey(mDstSize.ToIntSize(), mImageFlags, 0),
RasterSurfaceKey(mDstSize, mImageFlags, 0),
Lifetime::Transient);
return true;
@ -210,7 +210,7 @@ public:
// Remove the frame from the cache since we know we don't need it.
SurfaceCache::RemoveSurface(ImageKey(mImage.get()),
RasterSurfaceKey(mDstSize.ToIntSize(),
RasterSurfaceKey(mDstSize,
mImageFlags, 0));
// Release everything we're holding, too.
@ -504,8 +504,7 @@ RasterImage::LookupFrame(uint32_t aFrameNum,
MOZ_ASSERT(NS_IsMainThread());
IntSize requestedSize = CanDownscaleDuringDecode(aSize, aFlags)
? aSize.ToIntSize()
: mSize.ToIntSize();
? aSize : mSize;
DrawableFrameRef ref = LookupFrameInternal(aFrameNum, requestedSize, aFlags);
@ -935,7 +934,7 @@ RasterImage::OnAddedFrame(uint32_t aNewFrameCount,
if (aNewFrameCount == 2) {
// We're becoming animated, so initialize animation stuff.
MOZ_ASSERT(!mAnim, "Already have animation state?");
mAnim = MakeUnique<FrameAnimator>(this, mSize.ToIntSize(), mAnimationMode);
mAnim = MakeUnique<FrameAnimator>(this, mSize, mAnimationMode);
// We don't support discarding animated images (See bug 414259).
// Lock the image and throw away the key.
@ -1612,7 +1611,7 @@ RasterImage::CanScale(GraphicsFilter aFilter,
}
// There's no point in scaling if we can't store the result.
if (!SurfaceCache::CanHold(aSize.ToIntSize())) {
if (!SurfaceCache::CanHold(aSize)) {
return false;
}
@ -1654,7 +1653,7 @@ RasterImage::CanDownscaleDuringDecode(const nsIntSize& aSize, uint32_t aFlags)
}
// There's no point in scaling if we can't store the result.
if (!SurfaceCache::CanHold(aSize.ToIntSize())) {
if (!SurfaceCache::CanHold(aSize)) {
return false;
}
@ -1715,7 +1714,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef,
if (CanScale(aFilter, aSize, aFlags)) {
frameRef =
SurfaceCache::Lookup(ImageKey(this),
RasterSurfaceKey(aSize.ToIntSize(),
RasterSurfaceKey(aSize,
DecodeFlags(aFlags),
0));
if (!frameRef) {
@ -2096,7 +2095,7 @@ RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
} else if (CanScale(aFilter, destSize, aFlags)) {
DrawableFrameRef frameRef =
SurfaceCache::Lookup(ImageKey(this),
RasterSurfaceKey(destSize.ToIntSize(),
RasterSurfaceKey(destSize,
DecodeFlags(aFlags),
0));

Просмотреть файл

@ -15,13 +15,13 @@
#include "nsIObserver.h"
#include "nsIContentViewer.h"
#include "nsWeakReference.h"
#include "nsSize.h"
class nsIAtom;
class nsIPresShell;
class nsIRequest;
class nsILoadGroup;
class nsIFrame;
struct nsIntSize;
#define OBSERVER_SVC_CID "@mozilla.org/observer-service;1"

Просмотреть файл

@ -254,7 +254,7 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize,
return NS_ERROR_FAILURE;
}
mImageSize = aImageSize.ToIntSize();
mImageSize = aImageSize;
mOffset.MoveTo(aRect.x, aRect.y);
mSize.SizeTo(aRect.width, aRect.height);
@ -319,7 +319,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
return NS_ERROR_FAILURE;
}
mImageSize = aSize.ToIntSize();
mImageSize = aSize;
mOffset.MoveTo(0, 0);
mSize.SizeTo(aSize.width, aSize.height);

Просмотреть файл

@ -2797,7 +2797,7 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder,
RefPtr<DrawTarget> tempDT;
if (gfxUtils::sDumpPainting) {
tempDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
itemVisibleRect.Size().ToIntSize(),
itemVisibleRect.Size(),
SurfaceFormat::B8G8R8A8);
if (tempDT) {
context = new gfxContext(tempDT);

Просмотреть файл

@ -4737,9 +4737,10 @@ nsImageRenderer::ComputeIntrinsicSize()
int32_t appUnitsPerDevPixel =
mForFrame->PresContext()->AppUnitsPerDevPixel();
result.SetSize(
nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame).
ToNearestPixels(appUnitsPerDevPixel).
ToAppUnits(appUnitsPerDevPixel));
IntSizeToAppUnits(
nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame).
ToNearestPixels(appUnitsPerDevPixel),
appUnitsPerDevPixel));
}
} else {
NS_ASSERTION(mImageElementSurface.mSourceSurface, "Surface should be ready.");

Просмотреть файл

@ -346,7 +346,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget,
bool resultOverflows;
IntSize surfaceSize =
nsSVGUtils::ConvertToSurfaceSize(
transformedBBox.Size(), &resultOverflows).ToIntSize();
transformedBBox.Size(), &resultOverflows);
// 0 disables rendering, < 0 is an error
if (surfaceSize.width <= 0 || surfaceSize.height <= 0) {

Просмотреть файл

@ -623,7 +623,7 @@ nsBaseDragService::DrawDragForImage(nsPresContext* aPresContext,
if (aImageLoader) {
RefPtr<DrawTarget> dt =
gfxPlatform::GetPlatform()->
CreateOffscreenContentDrawTarget(destSize.ToIntSize(),
CreateOffscreenContentDrawTarget(destSize,
SurfaceFormat::B8G8R8A8);
if (!dt)
return NS_ERROR_FAILURE;

Просмотреть файл

@ -14,9 +14,9 @@
#include "gfxTypes.h"
#include <windows.h>
#include "mozilla/TimeStamp.h"
#include "nsSize.h"
struct nsIntRect;
struct nsIntSize;
class nsNativeThemeWin : private nsNativeTheme,
public nsITheme {