Bug 929513 - Replace some instances of gfxIntSize with gfx::IntSize r=nical

This commit is contained in:
Tor Arvid Lund 2013-12-13 18:32:02 +01:00
parent c50719a5fc
commit 944f0d6f3b
29 changed files with 97 additions and 88 deletions

View File

@ -40,7 +40,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize,
mIntrinsicSizeChanged = true;
}
gfxIntSize oldFrameSize = mImageContainer->GetCurrentSize();
gfx::IntSize oldFrameSize = mImageContainer->GetCurrentSize();
TimeStamp lastPaintTime = mImageContainer->GetPaintTime();
if (!lastPaintTime.IsNull() && !mPaintTarget.IsNull()) {
mPaintDelay = lastPaintTime - mPaintTarget;
@ -57,7 +57,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize,
mImageContainer->UnlockCurrentImage();
mImageContainer->SetCurrentImage(aImage);
gfxIntSize newFrameSize = mImageContainer->GetCurrentSize();
gfx::IntSize newFrameSize = mImageContainer->GetCurrentSize();
if (oldFrameSize != newFrameSize) {
mImageSizeChanged = true;
}

View File

@ -147,7 +147,7 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
while (!iter.IsEnded()) {
VideoChunk chunk = *iter;
if (!chunk.IsNull()) {
gfxIntSize imgsize = chunk.mFrame.GetImage()->GetSize();
gfx::IntSize imgsize = chunk.mFrame.GetImage()->GetSize();
nsresult rv = Init(imgsize.width, imgsize.height, aTrackRate);
if (NS_FAILED(rv)) {
LOG("[VideoTrackEncoder]: Fail to initialize the encoder!");

View File

@ -6,6 +6,7 @@
#include "nsPresContext.h"
#include "gfxImageSurface.h"
#include "gfxContext.h"
#include "gfx2DGlue.h"
#include "ImageContainer.h"
#include "Layers.h"
#include "nsIInterfaceRequestorUtils.h"
@ -154,8 +155,8 @@ NotifyPull(MediaStreamGraph*, SourceMediaStream* aSource, mozilla::TrackID aID,
if (delta > 0) {
// nullptr images are allowed
if (image) {
gfxIntSize size = image->GetSize();
segment.AppendFrame(image.forget(), delta, size);
gfx::IntSize size = image->GetSize();
segment.AppendFrame(image.forget(), delta, gfx::ThebesIntSize(size));
} else {
segment.AppendFrame(nullptr, delta, gfxIntSize(0,0));
}

View File

@ -5,6 +5,7 @@
#include "D3D9SurfaceImage.h"
#include "gfxImageSurface.h"
#include "gfx2DGlue.h"
namespace mozilla {
namespace layers {
@ -73,7 +74,7 @@ D3D9SurfaceImage::SetData(const Data& aData)
mTexture = texture;
mShareHandle = shareHandle;
mSize = gfxIntSize(region.width, region.height);
mSize = gfx::IntSize(region.width, region.height);
mQuery = query;
return S_OK;
@ -109,7 +110,7 @@ D3D9SurfaceImage::GetDesc() const
return mDesc;
}
gfxIntSize
gfx::IntSize
D3D9SurfaceImage::GetSize()
{
return mSize;
@ -122,7 +123,7 @@ D3D9SurfaceImage::GetAsSurface()
HRESULT hr;
nsRefPtr<gfxImageSurface> surface =
new gfxImageSurface(mSize, gfxImageFormatRGB24);
new gfxImageSurface(gfx::ThebesIntSize(mSize), gfxImageFormatRGB24);
if (!surface->CairoSurface() || surface->CairoStatus()) {
NS_WARNING("Failed to created Cairo image surface for D3D9SurfaceImage.");

View File

@ -44,7 +44,7 @@ public:
// complete.
HANDLE GetShareHandle();
gfxIntSize GetSize() MOZ_OVERRIDE;
gfx::IntSize GetSize() MOZ_OVERRIDE;
already_AddRefed<gfxASurface> GetAsSurface() MOZ_OVERRIDE;
@ -54,7 +54,7 @@ private:
// is complete, whereupon the texture is safe to use.
void EnsureSynchronized();
gfxIntSize mSize;
gfx::IntSize mSize;
RefPtr<IDirect3DTexture9> mTexture;
RefPtr<IDirect3DQuery9> mQuery;
HANDLE mShareHandle;

View File

@ -230,7 +230,7 @@ GrallocImage::GetAsSurface()
}
nsRefPtr<gfxImageSurface> imageSurface =
new gfxImageSurface(GetSize(), gfxImageFormatRGB16_565);
new gfxImageSurface(gfx::ThebesIntSize(GetSize()), gfxImageFormatRGB16_565);
uint32_t width = GetSize().width;
uint32_t height = GetSize().height;
@ -295,9 +295,7 @@ GrallocImage::GetTextureClient()
flags |= TEXTURE_RB_SWAPPED;
}
GrallocBufferActor* actor = static_cast<GrallocBufferActor*>(desc.bufferChild());
mTextureClient = new GrallocTextureClientOGL(actor,
gfx::ToIntSize(mSize),
flags);
mTextureClient = new GrallocTextureClientOGL(actor, mSize, flags);
mTextureClient->SetGraphicBufferLocked(mGraphicBuffer);
}
return mTextureClient;

View File

@ -7,6 +7,7 @@
#include "ImageContainer.h"
#include <string.h> // for memcpy, memset
#include "SharedTextureImage.h" // for SharedTextureImage
#include "gfx2DGlue.h"
#include "gfxImageSurface.h" // for gfxImageSurface
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxUtils.h" // for gfxUtils
@ -16,6 +17,7 @@
#include "mozilla/layers/ImageBridgeChild.h" // for ImageBridgeChild
#include "mozilla/layers/ImageClient.h" // for ImageClient
#include "nsISupportsUtils.h" // for NS_IF_ADDREF
#include "YCbCrUtils.h" // for YCbCr conversions
#ifdef MOZ_WIDGET_GONK
#include "GrallocImages.h"
#endif
@ -50,7 +52,7 @@ Atomic<int32_t> Image::sSerialCounter(0);
already_AddRefed<Image>
ImageFactory::CreateImage(const ImageFormat *aFormats,
uint32_t aNumFormats,
const gfxIntSize &,
const gfx::IntSize &,
BufferRecycleBin *aRecycleBin)
{
if (!aNumFormats) {
@ -287,7 +289,7 @@ ImageContainer::LockCurrentImage()
}
already_AddRefed<gfxASurface>
ImageContainer::LockCurrentAsSurface(gfxIntSize *aSize, Image** aCurrentImage)
ImageContainer::LockCurrentAsSurface(gfx::IntSize *aSize, Image** aCurrentImage)
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
@ -345,7 +347,7 @@ ImageContainer::UnlockCurrentImage()
}
already_AddRefed<gfxASurface>
ImageContainer::GetCurrentAsSurface(gfxIntSize *aSize)
ImageContainer::GetCurrentAsSurface(gfx::IntSize *aSize)
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
@ -364,7 +366,7 @@ ImageContainer::GetCurrentAsSurface(gfxIntSize *aSize)
return mActiveImage->GetAsSurface();
}
gfxIntSize
gfx::IntSize
ImageContainer::GetCurrentSize()
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
@ -556,9 +558,9 @@ PlanarYCbCrImage::GetAsSurface()
return result.forget();
}
gfxImageFormat format = GetOffscreenFormat();
gfxIntSize size(mSize);
gfxUtils::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
gfx::SurfaceFormat format = gfx::ImageFormatToSurfaceFormat(GetOffscreenFormat());
gfx::IntSize size(mSize);
gfx::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
if (size.width > PlanarYCbCrImage::MAX_DIMENSION ||
size.height > PlanarYCbCrImage::MAX_DIMENSION) {
NS_ERROR("Illegal image dest width or height");
@ -566,11 +568,9 @@ PlanarYCbCrImage::GetAsSurface()
}
nsRefPtr<gfxImageSurface> imageSurface =
new gfxImageSurface(mSize, format);
new gfxImageSurface(gfx::ThebesIntSize(mSize), gfx::SurfaceFormatToImageFormat(format));
gfxUtils::ConvertYCbCrToRGB(mData, format, mSize,
imageSurface->Data(),
imageSurface->Stride());
gfx::ConvertYCbCrToRGB(mData, format, mSize, imageSurface->Data(), imageSurface->Stride());
mSurface = imageSurface;

View File

@ -15,6 +15,7 @@
#include "mozilla/Mutex.h" // for Mutex
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/gfx/Point.h" // For IntSize
#include "mozilla/layers/LayersTypes.h" // for LayersBackend, etc
#include "mozilla/mozalloc.h" // for operator delete, etc
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoArrayPtr, etc
@ -147,7 +148,7 @@ public:
void* GetImplData() { return mImplData; }
virtual already_AddRefed<gfxASurface> GetAsSurface() = 0;
virtual gfxIntSize GetSize() = 0;
virtual gfx::IntSize GetSize() = 0;
virtual nsIntRect GetPictureRect()
{
return nsIntRect(0, 0, GetSize().width, GetSize().height);
@ -262,7 +263,7 @@ protected:
virtual already_AddRefed<Image> CreateImage(const ImageFormat* aFormats,
uint32_t aNumFormats,
const gfxIntSize &aScaleHint,
const gfx::IntSize &aScaleHint,
BufferRecycleBin *aRecycleBin);
};
@ -483,7 +484,7 @@ public:
* the lock methods should be used to avoid the copy, however this should be
* avoided if the surface is required for a long period of time.
*/
already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSizeResult);
already_AddRefed<gfxASurface> GetCurrentAsSurface(gfx::IntSize* aSizeResult);
/**
* This is similar to GetCurrentAsSurface, however this does not make a copy
@ -493,7 +494,7 @@ public:
* type of image. Optionally a pointer can be passed to receive the current
* image.
*/
already_AddRefed<gfxASurface> LockCurrentAsSurface(gfxIntSize* aSizeResult,
already_AddRefed<gfxASurface> LockCurrentAsSurface(gfx::IntSize* aSizeResult,
Image** aCurrentImage = nullptr);
/**
@ -501,7 +502,7 @@ public:
* Can be called on any thread. This method takes mReentrantMonitor when accessing
* thread-shared state.
*/
gfxIntSize GetCurrentSize();
gfx::IntSize GetCurrentSize();
/**
* Sets a size that the image is expected to be rendered at.
@ -673,7 +674,7 @@ public:
~AutoLockImage() { if (mContainer) { mContainer->UnlockCurrentImage(); } }
Image* GetImage() { return mImage; }
const gfxIntSize &GetSize() { return mSize; }
const gfx::IntSize &GetSize() { return mSize; }
void Unlock() {
if (mContainer) {
@ -698,7 +699,7 @@ public:
private:
ImageContainer *mContainer;
nsRefPtr<Image> mImage;
gfxIntSize mSize;
gfx::IntSize mSize;
};
struct PlanarYCbCrData {
@ -819,7 +820,7 @@ public:
virtual bool IsValid() { return !!mBufferSize; }
virtual gfxIntSize GetSize() { return mSize; }
virtual gfx::IntSize GetSize() { return mSize; }
PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
@ -849,7 +850,7 @@ protected:
nsAutoArrayPtr<uint8_t> mBuffer;
uint32_t mBufferSize;
Data mData;
gfxIntSize mSize;
gfx::IntSize mSize;
gfxImageFormat mOffscreenFormat;
nsCountedRef<nsMainThreadSurfaceRef> mSurface;
nsRefPtr<BufferRecycleBin> mRecycleBin;
@ -885,7 +886,7 @@ public:
return surface.forget();
}
gfxIntSize GetSize() { return mSize; }
gfx::IntSize GetSize() { return mSize; }
CairoImage() : Image(nullptr, CAIRO_SURFACE) {}
@ -899,7 +900,7 @@ public:
already_AddRefed<gfxASurface> GetAsSurface();
gfxIntSize GetSize() { return mSize; }
gfx::IntSize GetSize() { return mSize; }
unsigned char *mData;
int mStride;

View File

@ -9,6 +9,7 @@
#include "gfxRect.h" // for gfxRect
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for ImageContainer::Release, etc
#include "gfx2DGlue.h"
namespace mozilla {
namespace layers {
@ -33,7 +34,7 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurfa
// Snap image edges to pixel boundaries
gfxRect sourceRect(0, 0, 0, 0);
if (mContainer) {
sourceRect.SizeTo(mContainer->GetCurrentSize());
sourceRect.SizeTo(gfx::ThebesIntSize(mContainer->GetCurrentSize()));
if (mScaleMode != SCALE_NONE &&
sourceRect.width != 0.0 && sourceRect.height != 0.0) {
NS_ASSERTION(mScaleMode == SCALE_STRETCH,

View File

@ -8,6 +8,7 @@
#include "ImageContainer.h"
#include "mozilla/gfx/MacIOSurface.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/layers/TextureClient.h"
#include "gfxImageSurface.h"
@ -21,7 +22,7 @@ public:
void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
MacIOSurface* GetSurface() { return mSurface; }
gfxIntSize GetSize() {
gfx::IntSize GetSize() {
return gfxIntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
}

View File

@ -11,7 +11,7 @@
#include "ImageTypes.h" // for ImageFormat::SHARED_TEXTURE
#include "gfxPoint.h" // for gfxIntSize
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsSize.h" // for nsIntSize
#include "mozilla/gfx/Point.h" // for IntSize
class gfxASurface;
@ -27,14 +27,14 @@ public:
struct Data {
gl::SharedTextureHandle mHandle;
gl::SharedTextureShareType mShareType;
gfxIntSize mSize;
gfx::IntSize mSize;
bool mInverted;
};
void SetData(const Data& aData) { mData = aData; }
const Data* GetData() { return &mData; }
gfxIntSize GetSize() { return mData.mSize; }
gfx::IntSize GetSize() { return mData.mSize; }
virtual already_AddRefed<gfxASurface> GetAsSurface() {
return nullptr;

View File

@ -12,7 +12,6 @@
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxContext.h" // for gfxContext
#include "gfxPattern.h" // for gfxPattern, etc
#include "gfxPoint.h" // for gfxIntSize
#include "gfxUtils.h" // for gfxUtils
#ifdef MOZ_X11
#include "gfxXlibSurface.h" // for gfxXlibSurface
@ -25,6 +24,7 @@
#include "nsRect.h" // for nsIntRect
#include "nsRegion.h" // for nsIntRegion
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
#include "mozilla/gfx/Point.h" // for IntSize
using namespace mozilla::gfx;
@ -69,7 +69,7 @@ protected:
float aOpacity,
Layer* aMaskLayer);
gfxIntSize mSize;
gfx::IntSize mSize;
};
void
@ -94,7 +94,7 @@ BasicImageLayer::GetAndPaintCurrentImage(gfxContext* aContext,
nsRefPtr<gfxASurface> surface;
AutoLockImage autoLock(mContainer, getter_AddRefs(surface));
Image *image = autoLock.GetImage();
gfxIntSize size = mSize = autoLock.GetSize();
gfx::IntSize size = mSize = autoLock.GetSize();
if (!surface || surface->CairoStatus()) {
return nullptr;
@ -166,7 +166,7 @@ BasicImageLayer::GetAsSurface(gfxASurface** aSurface,
return false;
}
gfxIntSize dontCare;
gfx::IntSize dontCare;
nsRefPtr<gfxASurface> surface = mContainer->GetCurrentAsSurface(&dontCare);
*aSurface = surface.forget().get();
return true;

View File

@ -11,7 +11,6 @@
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxImageSurface.h" // for gfxImageSurface
#include "gfxPlatform.h" // for gfxPlatform, gfxImageFormat
#include "gfxPoint.h" // for gfxIntSize
#include "gfxUtils.h" // for gfxUtils
#include "mozilla/mozalloc.h" // for operator delete[], etc
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoArrayPtr
@ -20,6 +19,9 @@
#include "nsDebug.h" // for NS_ERROR, NS_ASSERTION
#include "nsISupportsImpl.h" // for Image::Release, etc
#include "nsThreadUtils.h" // for NS_IsMainThread
#include "mozilla/gfx/Point.h" // for IntSize
#include "gfx2DGlue.h"
#include "YCbCrUtils.h" // for YCbCr conversions
#ifdef XP_MACOSX
#include "gfxQuartzImageSurface.h"
#endif
@ -30,7 +32,7 @@ namespace layers {
class BasicPlanarYCbCrImage : public PlanarYCbCrImage
{
public:
BasicPlanarYCbCrImage(const gfxIntSize& aScaleHint, gfxImageFormat aOffscreenFormat, BufferRecycleBin *aRecycleBin)
BasicPlanarYCbCrImage(const gfx::IntSize& aScaleHint, gfxImageFormat aOffscreenFormat, BufferRecycleBin *aRecycleBin)
: PlanarYCbCrImage(aRecycleBin)
, mScaleHint(aScaleHint)
, mDelayedConversion(false)
@ -54,7 +56,7 @@ public:
private:
nsAutoArrayPtr<uint8_t> mDecodedBuffer;
gfxIntSize mScaleHint;
gfx::IntSize mScaleHint;
int mStride;
bool mDelayedConversion;
};
@ -66,7 +68,7 @@ public:
virtual already_AddRefed<Image> CreateImage(const ImageFormat* aFormats,
uint32_t aNumFormats,
const gfxIntSize &aScaleHint,
const gfx::IntSize &aScaleHint,
BufferRecycleBin *aRecycleBin)
{
if (!aNumFormats) {
@ -99,25 +101,26 @@ BasicPlanarYCbCrImage::SetData(const Data& aData)
return;
}
gfxImageFormat format = GetOffscreenFormat();
gfx::SurfaceFormat format = gfx::ImageFormatToSurfaceFormat(GetOffscreenFormat());
gfxIntSize size(mScaleHint);
gfxUtils::GetYCbCrToRGBDestFormatAndSize(aData, format, size);
gfx::IntSize size(mScaleHint);
gfx::GetYCbCrToRGBDestFormatAndSize(aData, format, size);
if (size.width > PlanarYCbCrImage::MAX_DIMENSION ||
size.height > PlanarYCbCrImage::MAX_DIMENSION) {
NS_ERROR("Illegal image dest width or height");
return;
}
mStride = gfxASurface::FormatStrideForWidth(format, size.width);
gfxImageFormat iFormat = gfx::SurfaceFormatToImageFormat(format);
mStride = gfxASurface::FormatStrideForWidth(iFormat, size.width);
mDecodedBuffer = AllocateBuffer(size.height * mStride);
if (!mDecodedBuffer) {
// out of memory
return;
}
gfxUtils::ConvertYCbCrToRGB(aData, format, size, mDecodedBuffer, mStride);
SetOffscreenFormat(format);
gfx::ConvertYCbCrToRGB(aData, format, size, mDecodedBuffer, mStride);
SetOffscreenFormat(iFormat);
mSize = size;
}
@ -146,7 +149,7 @@ BasicPlanarYCbCrImage::GetAsSurface()
gfxImageFormat format = GetOffscreenFormat();
nsRefPtr<gfxImageSurface> imgSurface =
new gfxImageSurface(mDecodedBuffer, mSize, mStride, format);
new gfxImageSurface(mDecodedBuffer, gfx::ThebesIntSize(mSize), mStride, format);
if (!imgSurface || imgSurface->CairoStatus() != 0) {
return nullptr;
}

View File

@ -11,7 +11,6 @@
#include "gfx2DGlue.h" // for ImageFormatToSurfaceFormat
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef
#include "mozilla/gfx/BaseSize.h" // for BaseSize

View File

@ -812,7 +812,7 @@ bool AutoLockShmemClient::Update(Image* aImage,
return false;
}
gfxIntSize size = aImage->GetSize();
gfx::IntSize size = aImage->GetSize();
gfxContentType contentType = aSurface->GetContentType();
bool isOpaque = (aContentFlags & Layer::CONTENT_OPAQUE);
@ -820,7 +820,7 @@ bool AutoLockShmemClient::Update(Image* aImage,
isOpaque) {
contentType = GFX_CONTENT_COLOR;
}
mDeprecatedTextureClient->EnsureAllocated(gfx::IntSize(size.width, size.height), contentType);
mDeprecatedTextureClient->EnsureAllocated(size, contentType);
OpenMode mode = mDeprecatedTextureClient->GetAccessMode() == DeprecatedTextureClient::ACCESS_READ_WRITE
? OPEN_READ_WRITE

View File

@ -8,7 +8,6 @@
#include "Layers.h" // for WriteSnapshotToDumpFile, etc
#include "gfx2DGlue.h" // for ToFilter, ToMatrix4x4
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxPoint.h" // for gfxIntSize
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc

View File

@ -10,9 +10,13 @@
#include "yuv_convert.h"
#include "../d3d9/Nv3DVUtils.h"
#include "D3D9SurfaceImage.h"
#include "mozilla/gfx/Point.h"
#include "gfx2DGlue.h"
#include "gfxWindowsPlatform.h"
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -202,7 +206,7 @@ ImageLayerD3D10::RenderLayer()
return;
}
gfxIntSize size = image->GetSize();
IntSize size = image->GetSize();
SetEffectTransformAndOpacity();
@ -410,7 +414,7 @@ ImageLayerD3D10::GetAsTexture(gfxIntSize* aSize)
return nullptr;
}
*aSize = image->GetSize();
*aSize = gfx::ThebesIntSize(image->GetSize());
bool dontCare;
nsRefPtr<ID3D10ShaderResourceView> result = GetImageSRView(image, dontCare);
return result.forget();
@ -465,9 +469,10 @@ RemoteDXGITextureImage::GetAsSurface()
keyedMutex->ReleaseSync(0);
nsRefPtr<gfxImageSurface> surface =
new gfxImageSurface(mSize, mFormat == RemoteImageData::BGRX32 ?
gfxImageFormatRGB24 :
gfxImageFormatARGB32);
new gfxImageSurface(ThebesIntSize(mSize),
mFormat == RemoteImageData::BGRX32 ?
gfxImageFormatRGB24 :
gfxImageFormatARGB32);
if (!surface->CairoSurface() || surface->CairoStatus()) {
NS_WARNING("Failed to created image surface for DXGI texture.");

View File

@ -11,6 +11,8 @@
#include "ImageContainer.h"
#include "yuv_convert.h"
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -60,11 +62,11 @@ public:
already_AddRefed<gfxASurface> GetAsSurface();
gfxIntSize GetSize() { return mSize; }
IntSize GetSize() { return mSize; }
TextureD3D10BackendData *GetD3D10TextureBackendData(ID3D10Device *aDevice);
gfxIntSize mSize;
IntSize mSize;
RemoteImageData::Format mFormat;
HANDLE mHandle;
};

View File

@ -403,7 +403,7 @@ ImageLayerD3D9::RenderLayer()
SetShaderTransformAndOpacity();
gfxIntSize size = image->GetSize();
gfx::IntSize size = image->GetSize();
if (image->GetFormat() == CAIRO_SURFACE ||
image->GetFormat() == REMOTE_IMAGE_BITMAP ||
@ -564,7 +564,7 @@ ImageLayerD3D9::GetAsTexture(gfxIntSize* aSize)
}
bool dontCare;
*aSize = image->GetSize();
*aSize = gfx::ThebesIntSize(image->GetSize());
nsRefPtr<IDirect3DTexture9> result = GetTexture(image, dontCare);
return result.forget();
}

View File

@ -52,7 +52,7 @@ struct SurfaceDescriptorMacIOSurface {
struct SharedTextureDescriptor {
SharedTextureShareType shareType;
SharedTextureHandle handle;
nsIntSize size;
IntSize size;
bool inverted;
};

View File

@ -7,7 +7,6 @@
#include <stddef.h> // for size_t
#include <stdio.h> // for printf
#include "ISurfaceAllocator.h" // for ISurfaceAllocator, etc
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/Types.h" // for SurfaceFormat::FORMAT_YUV
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc

View File

@ -104,7 +104,7 @@ DeprecatedSharedRGBImage::GetBufferSize()
return mSize.width * mSize.height * gfxASurface::BytesPerPixel(mImageFormat);
}
gfxIntSize
gfx::IntSize
DeprecatedSharedRGBImage::GetSize()
{
return mSize;
@ -215,7 +215,7 @@ SharedRGBImage::GetBuffer()
return serializer.GetData();
}
gfxIntSize
gfx::IntSize
SharedRGBImage::GetSize()
{
return ThebesIntSize(mSize);

View File

@ -9,7 +9,6 @@
#include <stdint.h> // for uint8_t
#include "ImageContainer.h" // for ISharedImage, Image, etc
#include "gfxTypes.h"
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/RefPtr.h" // for RefPtr
#include "mozilla/gfx/Point.h" // for IntSize
@ -57,7 +56,7 @@ public:
virtual uint8_t *GetBuffer() MOZ_OVERRIDE;
gfxIntSize GetSize();
gfx::IntSize GetSize();
size_t GetBufferSize();
static uint8_t BytesPerPixel(gfxImageFormat aImageFormat);
@ -89,7 +88,7 @@ public:
TextureClient* GetTextureClient() MOZ_OVERRIDE { return nullptr; }
protected:
gfxIntSize mSize;
gfx::IntSize mSize;
gfxImageFormat mImageFormat;
RefPtr<ISurfaceAllocator> mSurfaceAllocator;
@ -114,7 +113,7 @@ public:
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
gfxIntSize GetSize();
gfx::IntSize GetSize();
size_t GetBufferSize();

View File

@ -5,7 +5,6 @@
#include "OGLShaderProgram.h"
#include <stdint.h> // for uint32_t
#include "gfxMatrix.h" // for gfxMatrix
#include "gfxPoint.h" // for gfxIntSize, gfxPoint, etc
#include "gfxRect.h" // for gfxRect
#include "mozilla/DebugOnly.h" // for DebugOnly
#include "nsAString.h"

View File

@ -105,7 +105,7 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc,
result = new SharedTextureHostOGL(aFlags,
desc.shareType(),
desc.handle(),
gfx::ToIntSize(desc.size()),
desc.size(),
desc.inverted());
break;
}
@ -649,8 +649,7 @@ SharedDeprecatedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImage
SharedTextureDescriptor texture = aImage.get_SharedTextureDescriptor();
SharedTextureHandle newHandle = texture.handle();
nsIntSize size = texture.size();
mSize = gfx::IntSize(size.width, size.height);
mSize = texture.size();
if (texture.inverted()) {
mFlags |= TEXTURE_NEEDS_Y_FLIP;
}

View File

@ -1883,7 +1883,7 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder,
}
if (!animated) {
gfxSize imageSize = mImageContainer->GetCurrentSize();
mozilla::gfx::IntSize imageSize = mImageContainer->GetCurrentSize();
NS_ASSERTION(imageSize.width != 0 && imageSize.height != 0, "Invalid image size!");
gfxRect destRect = mDestRect;
@ -1930,7 +1930,7 @@ nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& a
{
aLayer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(mFrame));
gfxIntSize imageSize = mImageContainer->GetCurrentSize();
mozilla::gfx::IntSize imageSize = mImageContainer->GetCurrentSize();
NS_ASSERTION(imageSize.width != 0 && imageSize.height != 0, "Invalid image size!");
gfxMatrix transform;

View File

@ -72,6 +72,7 @@
#include "nsComputedDOMStyle.h"
#include "ActiveLayerTracker.h"
#include "mozilla/gfx/2D.h"
#include "gfx2DGlue.h"
#include "mozilla/Preferences.h"
@ -4961,14 +4962,14 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,
if (!container)
return result;
gfxIntSize size;
mozilla::gfx::IntSize size;
nsRefPtr<gfxASurface> surf = container->GetCurrentAsSurface(&size);
if (!surf)
return result;
result.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(aTarget, surf);
result.mCORSUsed = aElement->GetCORSMode() != CORS_NONE;
result.mSize = size;
result.mSize = ThebesIntSize(size);
result.mPrincipal = principal.forget();
result.mIsWriteOnly = false;

View File

@ -179,7 +179,7 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
// Retrieve the size of the decoded video frame, before being scaled
// by pixel aspect ratio.
gfxIntSize frameSize = container->GetCurrentSize();
mozilla::gfx::IntSize frameSize = container->GetCurrentSize();
if (frameSize.width == 0 || frameSize.height == 0) {
// No image, or zero-sized image. No point creating a layer.
return nullptr;

View File

@ -39,6 +39,7 @@
#include "runnable_utils.h"
#include "gfxImageSurface.h"
#include "libyuv/convert.h"
#include "mozilla/gfx/Point.h"
using namespace mozilla;
@ -858,7 +859,7 @@ void MediaPipelineTransmit::PipelineListener::ProcessVideoChunk(
return;
}
gfxIntSize size = img->GetSize();
gfx::IntSize size = img->GetSize();
if ((size.width & 1) != 0 || (size.height & 1) != 0) {
MOZ_ASSERT(false, "Can't handle odd-sized images");
return;
@ -948,7 +949,7 @@ void MediaPipelineTransmit::PipelineListener::ProcessVideoChunk(
const_cast<layers::CairoImage *>(
static_cast<const layers::CairoImage *>(img));
gfxIntSize size = rgb->GetSize();
gfx::IntSize size = rgb->GetSize();
int half_width = (size.width + 1) >> 1;
int half_height = (size.height + 1) >> 1;
int c_size = half_width * half_height;