Bug 950677 - Change gfxIntSize -> gfx::IntSize some places in layers/ipc. r=nical

This commit is contained in:
Tor Arvid Lund 2013-12-20 11:46:28 -05:00
parent 082eae82f7
commit 0cb3c8eff8
14 changed files with 35 additions and 32 deletions

View File

@ -16,6 +16,7 @@
#include "gfxPlatform.h" // for gfxPlatform, gfxImageFormat
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "gfx2DGlue.h" // for thebes --> moz2d transition
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
@ -105,7 +106,7 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
return;
}
gfxIntSize readSize(sharedSurf->Size());
IntSize readSize(ToIntSize(sharedSurf->Size()));
gfxImageFormat format = (GetContentFlags() & CONTENT_OPAQUE)
? gfxImageFormatRGB24
: gfxImageFormatARGB32;
@ -128,7 +129,7 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
SharedSurface_Basic* sharedSurf_Basic = SharedSurface_Basic::Cast(surfGL);
readSurf = sharedSurf_Basic->GetData();
} else {
if (resultSurf->GetSize() != readSize ||
if (ToIntSize(resultSurf->GetSize()) != readSize ||
!(readSurf = resultSurf->GetAsImageSurface()) ||
readSurf->Format() != format)
{
@ -213,14 +214,14 @@ CopyableCanvasLayer::PaintWithOpacity(gfxContext* aContext,
}
gfxImageSurface*
CopyableCanvasLayer::GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat)
CopyableCanvasLayer::GetTempSurface(const IntSize& aSize, const gfxImageFormat aFormat)
{
if (!mCachedTempSurface ||
aSize.width != mCachedSize.width ||
aSize.height != mCachedSize.height ||
aFormat != mCachedFormat)
{
mCachedTempSurface = new gfxImageSurface(aSize, aFormat);
mCachedTempSurface = new gfxImageSurface(ThebesIntSize(aSize), aFormat);
mCachedSize = aSize;
mCachedFormat = aFormat;
}

View File

@ -13,7 +13,6 @@
#include "gfxContext.h" // for gfxContext, etc
#include "gfxTypes.h"
#include "gfxPlatform.h" // for gfxImageFormat
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/RefPtr.h" // for RefPtr
@ -61,10 +60,10 @@ protected:
bool mForceReadback;
nsRefPtr<gfxImageSurface> mCachedTempSurface;
gfxIntSize mCachedSize;
gfx::IntSize mCachedSize;
gfxImageFormat mCachedFormat;
gfxImageSurface* GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat);
gfxImageSurface* GetTempSurface(const gfx::IntSize& aSize, const gfxImageFormat aFormat);
void DiscardTempSurface();
};

View File

@ -18,6 +18,7 @@ namespace mozilla {
namespace layers {
class GrallocTextureClientOGL;
class IntSize;
/**
* The gralloc buffer maintained by android GraphicBuffer can be
@ -78,7 +79,7 @@ class GrallocImage : public PlanarYCbCrImage
public:
struct GrallocData {
nsRefPtr<GraphicBufferLocked> mGraphicBuffer;
gfxIntSize mPicSize;
IntSize mPicSize;
};
GrallocImage();

View File

@ -27,6 +27,7 @@
#include "gfxPoint.h" // for gfxIntSize, gfxPoint
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "gfx2DGlue.h" // for thebes --> moz2d transition
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/WidgetUtils.h" // for ScreenRotation
#include "mozilla/gfx/2D.h" // for DrawTarget
@ -721,7 +722,7 @@ PixmanTransform(const gfxImageSurface* aDest,
const gfx3DMatrix& aTransform,
gfxPoint aDestOffset)
{
gfxIntSize destSize = aDest->GetSize();
IntSize destSize = ToIntSize(aDest->GetSize());
pixman_image_t* dest = pixman_image_create_bits(aDest->Format() == gfxImageFormatARGB32 ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8,
destSize.width,
destSize.height,

View File

@ -6,7 +6,7 @@
#include "mozilla/layers/ContentHost.h"
#include "LayersLogging.h" // for AppendToString
#include "gfx2DGlue.h" // for ContentForFormat
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/BaseRect.h" // for BaseRect
#include "mozilla/layers/Compositor.h" // for Compositor
@ -523,7 +523,7 @@ ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
// Correct for rotation
destRegion.MoveBy(aData.rotation());
gfxIntSize size = aData.rect().Size();
IntSize size = aData.rect().Size();
nsIntRect destBounds = destRegion.GetBounds();
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
(destBounds.y >= size.height) ? -size.height : 0);
@ -620,7 +620,7 @@ DeprecatedContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
// Correct for rotation
destRegion.MoveBy(aData.rotation());
gfxIntSize size = aData.rect().Size();
IntSize size = aData.rect().Size();
nsIntRect destBounds = destRegion.GetBounds();
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
(destBounds.y >= size.height) ? -size.height : 0);

View File

@ -116,7 +116,7 @@ public:
virtual void DestroySharedSurface(SurfaceDescriptor* aSurface);
// method that does the actual allocation work
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfxIntSize& aSize,
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle)

View File

@ -22,6 +22,7 @@
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitor, etc
#include "mozilla/ipc/MessageChannel.h" // for MessageChannel, etc
#include "mozilla/ipc/Transport.h" // for Transport
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/CompositableClient.h" // for CompositableChild, etc
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator
#include "mozilla/layers/ImageClient.h" // for ImageClient
@ -42,6 +43,7 @@ struct nsIntRect;
using namespace base;
using namespace mozilla::ipc;
using namespace mozilla::gfx;
namespace mozilla {
namespace ipc {
@ -212,12 +214,12 @@ static void CreateImageClientSync(RefPtr<ImageClient>* result,
struct GrallocParam {
gfxIntSize size;
IntSize size;
uint32_t format;
uint32_t usage;
SurfaceDescriptor* buffer;
GrallocParam(const gfxIntSize& aSize,
GrallocParam(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -647,7 +649,7 @@ ImageBridgeChild::CreateImageClientNow(CompositableType aType)
}
PGrallocBufferChild*
ImageBridgeChild::AllocPGrallocBufferChild(const gfxIntSize&, const uint32_t&, const uint32_t&,
ImageBridgeChild::AllocPGrallocBufferChild(const IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*)
{
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
@ -671,7 +673,7 @@ ImageBridgeChild::DeallocPGrallocBufferChild(PGrallocBufferChild* actor)
}
bool
ImageBridgeChild::AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
ImageBridgeChild::AllocSurfaceDescriptorGralloc(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -696,7 +698,7 @@ ImageBridgeChild::AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
}
bool
ImageBridgeChild::AllocSurfaceDescriptorGrallocNow(const gfxIntSize& aSize,
ImageBridgeChild::AllocSurfaceDescriptorGrallocNow(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -878,7 +880,7 @@ ImageBridgeChild::DeallocShmem(ipc::Shmem& aShmem)
}
PGrallocBufferChild*
ImageBridgeChild::AllocGrallocBuffer(const gfxIntSize& aSize,
ImageBridgeChild::AllocGrallocBuffer(const IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle)

View File

@ -8,7 +8,6 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/RefPtr.h" // for TemporaryRef
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
@ -189,7 +188,7 @@ public:
~ImageBridgeChild();
virtual PGrallocBufferChild*
AllocPGrallocBufferChild(const gfxIntSize&, const uint32_t&, const uint32_t&,
AllocPGrallocBufferChild(const gfx::IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
virtual bool
@ -205,7 +204,7 @@ public:
* Allocate a gralloc SurfaceDescriptor remotely.
*/
bool
AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
AllocSurfaceDescriptorGralloc(const gfx::IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer);
@ -218,7 +217,7 @@ public:
* Must be called from the ImageBridgeChild thread.
*/
bool
AllocSurfaceDescriptorGrallocNow(const gfxIntSize& aSize,
AllocSurfaceDescriptorGrallocNow(const gfx::IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer);
@ -385,7 +384,7 @@ protected:
CompositableTransaction* mTxn;
// ISurfaceAllocator
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfxIntSize& aSize,
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat, uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle) MOZ_OVERRIDE;
};

View File

@ -11,7 +11,7 @@
#include "base/process_util.h" // for OpenProcessHandle
#include "base/task.h" // for CancelableTask, DeleteTask, etc
#include "base/tracked.h" // for FROM_HERE
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/ipc/MessageChannel.h" // for MessageChannel, etc
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/Transport.h" // for Transport
@ -34,6 +34,7 @@
using namespace base;
using namespace mozilla::ipc;
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -149,7 +150,7 @@ static uint64_t GenImageContainerID() {
}
PGrallocBufferParent*
ImageBridgeParent::AllocPGrallocBufferParent(const gfxIntSize& aSize,
ImageBridgeParent::AllocPGrallocBufferParent(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
MaybeMagicGrallocBufferHandle* aOutHandle)

View File

@ -9,7 +9,6 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t
#include "CompositableTransactionParent.h"
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/ipc/ProtocolUtils.h"
@ -49,7 +48,7 @@ public:
Create(Transport* aTransport, ProcessId aOtherProcess);
virtual PGrallocBufferParent*
AllocPGrallocBufferParent(const gfxIntSize&, const uint32_t&, const uint32_t&,
AllocPGrallocBufferParent(const IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
virtual bool

View File

@ -38,7 +38,7 @@ parent:
// buffer directly. The format is a enum defined in
// system/graphics.h and the usage is the GraphicBuffer usage
// flag. See GraphicBuffer.h and gralloc.h.
sync PGrallocBuffer(gfxIntSize size, uint32_t format, uint32_t usage)
sync PGrallocBuffer(IntSize size, uint32_t format, uint32_t usage)
returns (MaybeMagicGrallocBufferHandle handle);
// First step of the destruction sequence. This puts all the ImageContainerParents

View File

@ -346,7 +346,7 @@ GrallocBufferActor::InitFromHandle(const MagicGrallocBufferHandle& aHandle)
}
PGrallocBufferChild*
ShadowLayerForwarder::AllocGrallocBuffer(const gfxIntSize& aSize,
ShadowLayerForwarder::AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle)

View File

@ -415,7 +415,7 @@ protected:
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
// from ISurfaceAllocator
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfxIntSize& aSize,
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle) MOZ_OVERRIDE;

View File

@ -243,7 +243,7 @@ GrallocTextureClientOGL::AllocateGralloc(gfx::IntSize aSize,
MaybeMagicGrallocBufferHandle handle;
PGrallocBufferChild* actor =
allocator->AllocGrallocBuffer(gfx::ThebesIntSize(aSize),
allocator->AllocGrallocBuffer(aSize,
aAndroidFormat,
aUsage,
&handle);