mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 9089fe288899
This commit is contained in:
parent
a6bf10f5a6
commit
7a55cdf819
@ -360,10 +360,10 @@ MediaPluginReader::ImageBufferCallback::operator()(size_t aWidth, size_t aHeight
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<mozilla::layers::DeprecatedSharedRGBImage> rgbImage;
|
||||
nsRefPtr<mozilla::layers::SharedRGBImage> rgbImage;
|
||||
switch(aColorFormat) {
|
||||
case MPAPI::RGB565:
|
||||
rgbImage = mozilla::layers::DeprecatedSharedRGBImage::Create(mImageContainer,
|
||||
rgbImage = mozilla::layers::SharedRGBImage::Create(mImageContainer,
|
||||
nsIntSize(aWidth, aHeight),
|
||||
gfxASurface::ImageFormatRGB16_565);
|
||||
mImage = rgbImage;
|
||||
|
@ -34,7 +34,6 @@ namespace layers {
|
||||
|
||||
class ImageClient;
|
||||
class SharedPlanarYCbCrImage;
|
||||
class DeprecatedSharedPlanarYCbCrImage;
|
||||
|
||||
struct ImageBackendData
|
||||
{
|
||||
@ -721,7 +720,6 @@ public:
|
||||
PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
|
||||
|
||||
virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; }
|
||||
virtual DeprecatedSharedPlanarYCbCrImage *AsDeprecatedSharedPlanarYCbCrImage() { return nullptr; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ enum ImageFormat {
|
||||
GRALLOC_PLANAR_YCBCR,
|
||||
|
||||
/**
|
||||
* The SHARED_RGB format creates a DeprecatedSharedRGBImage, which stores RGB data in
|
||||
* The SHARED_RGB format creates a SharedRGBImage, which stores RGB data in
|
||||
* shared memory. Some Android hardware video decoders require this format.
|
||||
* Currently only used on Android.
|
||||
*/
|
||||
|
@ -28,10 +28,10 @@ ImageClient::CreateImageClient(CompositableType aCompositableHostType,
|
||||
RefPtr<ImageClient> result = nullptr;
|
||||
switch (aCompositableHostType) {
|
||||
case BUFFER_IMAGE_SINGLE:
|
||||
result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
|
||||
result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
|
||||
break;
|
||||
case BUFFER_IMAGE_BUFFERED:
|
||||
result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
|
||||
result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
|
||||
break;
|
||||
case BUFFER_BRIDGE:
|
||||
result = new ImageClientBridge(aForwarder, aFlags);
|
||||
@ -66,9 +66,9 @@ ImageClient::UpdatePictureRect(nsIntRect aRect)
|
||||
GetForwarder()->UpdatePictureRect(this, aRect);
|
||||
}
|
||||
|
||||
DeprecatedImageClientSingle::DeprecatedImageClientSingle(CompositableForwarder* aFwd,
|
||||
TextureFlags aFlags,
|
||||
CompositableType aType)
|
||||
ImageClientSingle::ImageClientSingle(CompositableForwarder* aFwd,
|
||||
TextureFlags aFlags,
|
||||
CompositableType aType)
|
||||
: ImageClient(aFwd, aType)
|
||||
, mTextureInfo(aType)
|
||||
{
|
||||
@ -76,7 +76,7 @@ DeprecatedImageClientSingle::DeprecatedImageClientSingle(CompositableForwarder*
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClientType aType)
|
||||
ImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClientType aType)
|
||||
{
|
||||
// We should not call this method if using ImageBridge or tiled texture
|
||||
// clients since SupportsType always fails
|
||||
@ -88,7 +88,7 @@ DeprecatedImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClie
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
||||
ImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
||||
uint32_t aContentFlags)
|
||||
{
|
||||
AutoLockImage autoLock(aContainer);
|
||||
@ -106,11 +106,11 @@ DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
||||
EnsureDeprecatedTextureClient(TEXTURE_YCBCR)) {
|
||||
PlanarYCbCrImage* ycbcr = static_cast<PlanarYCbCrImage*>(image);
|
||||
|
||||
if (ycbcr->AsDeprecatedSharedPlanarYCbCrImage()) {
|
||||
if (ycbcr->AsSharedPlanarYCbCrImage()) {
|
||||
AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
|
||||
|
||||
SurfaceDescriptor sd;
|
||||
if (!ycbcr->AsDeprecatedSharedPlanarYCbCrImage()->ToSurfaceDescriptor(sd)) {
|
||||
if (!ycbcr->AsSharedPlanarYCbCrImage()->ToSurfaceDescriptor(sd)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
||||
AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
|
||||
|
||||
SurfaceDescriptor desc;
|
||||
if (!static_cast<DeprecatedSharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
|
||||
if (!static_cast<SharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
|
||||
return false;
|
||||
}
|
||||
mDeprecatedTextureClient->SetDescriptor(desc);
|
||||
@ -209,7 +209,7 @@ DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageClientSingle::Updated()
|
||||
ImageClientSingle::Updated()
|
||||
{
|
||||
mForwarder->UpdateTexture(this, 1, mDeprecatedTextureClient->GetDescriptor());
|
||||
}
|
||||
@ -247,10 +247,10 @@ ImageClient::CreateImage(const uint32_t *aFormats,
|
||||
for (uint32_t i = 0; i < aNumFormats; i++) {
|
||||
switch (aFormats[i]) {
|
||||
case PLANAR_YCBCR:
|
||||
img = new DeprecatedSharedPlanarYCbCrImage(GetForwarder());
|
||||
img = new SharedPlanarYCbCrImage(GetForwarder());
|
||||
return img.forget();
|
||||
case SHARED_RGB:
|
||||
img = new DeprecatedSharedRGBImage(GetForwarder());
|
||||
img = new SharedRGBImage(GetForwarder());
|
||||
return img.forget();
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
case GONK_IO_SURFACE:
|
||||
|
@ -72,12 +72,12 @@ protected:
|
||||
* ContentClientDoubleBuffered, or using multiple clients for YCbCr or tiled
|
||||
* images).
|
||||
*/
|
||||
class DeprecatedImageClientSingle : public ImageClient
|
||||
class ImageClientSingle : public ImageClient
|
||||
{
|
||||
public:
|
||||
DeprecatedImageClientSingle(CompositableForwarder* aFwd,
|
||||
TextureFlags aFlags,
|
||||
CompositableType aType);
|
||||
ImageClientSingle(CompositableForwarder* aFwd,
|
||||
TextureFlags aFlags,
|
||||
CompositableType aType);
|
||||
|
||||
virtual bool UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags);
|
||||
|
||||
|
@ -161,7 +161,7 @@ void
|
||||
DeprecatedTextureClientShmemYCbCr::SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor)
|
||||
{
|
||||
MOZ_ASSERT(aDescriptor.type() == SurfaceDescriptor::TYCbCrImage);
|
||||
DeprecatedSharedPlanarYCbCrImage* shYCbCr = DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
|
||||
SharedPlanarYCbCrImage* shYCbCr = SharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
|
||||
if (shYCbCr) {
|
||||
shYCbCr->Release();
|
||||
mDescriptor = SurfaceDescriptor();
|
||||
|
@ -54,10 +54,10 @@ CompositableHost::Create(const TextureInfo& aTextureInfo)
|
||||
RefPtr<CompositableHost> result;
|
||||
switch (aTextureInfo.mCompositableType) {
|
||||
case BUFFER_IMAGE_BUFFERED:
|
||||
result = new DeprecatedImageHostBuffered(aTextureInfo);
|
||||
result = new ImageHostBuffered(aTextureInfo);
|
||||
return result;
|
||||
case BUFFER_IMAGE_SINGLE:
|
||||
result = new DeprecatedImageHostSingle(aTextureInfo);
|
||||
result = new ImageHostSingle(aTextureInfo);
|
||||
return result;
|
||||
case BUFFER_TILED:
|
||||
result = new TiledContentHost(aTextureInfo);
|
||||
|
@ -17,7 +17,7 @@ using namespace gfx;
|
||||
namespace layers {
|
||||
|
||||
void
|
||||
DeprecatedImageHostSingle::SetCompositor(Compositor* aCompositor) {
|
||||
ImageHostSingle::SetCompositor(Compositor* aCompositor) {
|
||||
CompositableHost::SetCompositor(aCompositor);
|
||||
if (mDeprecatedTextureHost) {
|
||||
mDeprecatedTextureHost->SetCompositor(aCompositor);
|
||||
@ -25,10 +25,10 @@ DeprecatedImageHostSingle::SetCompositor(Compositor* aCompositor) {
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
ImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
{
|
||||
if (mDeprecatedTextureHost &&
|
||||
mDeprecatedTextureHost->GetBuffer() &&
|
||||
@ -43,10 +43,10 @@ DeprecatedImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextur
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
ImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
{
|
||||
mDeprecatedTextureHost = DeprecatedTextureHost::CreateDeprecatedTextureHost(aSurface.type(),
|
||||
mTextureInfo.mDeprecatedTextureHostFlags,
|
||||
@ -61,14 +61,14 @@ DeprecatedImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureI
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
|
||||
float aOpacity,
|
||||
const gfx::Matrix4x4& aTransform,
|
||||
const gfx::Point& aOffset,
|
||||
const gfx::Filter& aFilter,
|
||||
const gfx::Rect& aClipRect,
|
||||
const nsIntRegion* aVisibleRegion,
|
||||
TiledLayerProperties* aLayerProperties)
|
||||
ImageHostSingle::Composite(EffectChain& aEffectChain,
|
||||
float aOpacity,
|
||||
const gfx::Matrix4x4& aTransform,
|
||||
const gfx::Point& aOffset,
|
||||
const gfx::Filter& aFilter,
|
||||
const gfx::Rect& aClipRect,
|
||||
const nsIntRegion* aVisibleRegion,
|
||||
TiledLayerProperties* aLayerProperties)
|
||||
{
|
||||
if (!mDeprecatedTextureHost) {
|
||||
NS_WARNING("Can't composite an invalid or null DeprecatedTextureHost");
|
||||
@ -138,10 +138,10 @@ DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
ImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
aTo += aPrefix;
|
||||
aTo += nsPrintfCString("DeprecatedImageHostSingle (0x%p)", this);
|
||||
aTo += nsPrintfCString("ImageHostSingle (0x%p)", this);
|
||||
|
||||
AppendToString(aTo, mPictureRect, " [picture-rect=", "]");
|
||||
|
||||
@ -155,8 +155,8 @@ DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
#endif
|
||||
|
||||
bool
|
||||
DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
|
||||
SurfaceDescriptor* aResult) {
|
||||
ImageHostBuffered::Update(const SurfaceDescriptor& aImage,
|
||||
SurfaceDescriptor* aResult) {
|
||||
if (!GetDeprecatedTextureHost()) {
|
||||
*aResult = aImage;
|
||||
return false;
|
||||
@ -166,24 +166,24 @@ DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageHostBuffered::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
ImageHostBuffered::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
|
||||
const SurfaceDescriptor& aSurface,
|
||||
ISurfaceAllocator* aAllocator,
|
||||
const TextureInfo& aTextureInfo)
|
||||
{
|
||||
DeprecatedImageHostSingle::MakeDeprecatedTextureHost(aTextureId,
|
||||
aSurface,
|
||||
aAllocator,
|
||||
aTextureInfo);
|
||||
ImageHostSingle::MakeDeprecatedTextureHost(aTextureId,
|
||||
aSurface,
|
||||
aAllocator,
|
||||
aTextureInfo);
|
||||
if (mDeprecatedTextureHost) {
|
||||
mDeprecatedTextureHost->SetBuffer(new SurfaceDescriptor(null_t()), aAllocator);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DeprecatedImageHostSingle::Dump(FILE* aFile,
|
||||
const char* aPrefix,
|
||||
bool aDumpHtml)
|
||||
ImageHostSingle::Dump(FILE* aFile,
|
||||
const char* aPrefix,
|
||||
bool aDumpHtml)
|
||||
{
|
||||
if (!aFile) {
|
||||
aFile = stderr;
|
||||
|
@ -37,10 +37,10 @@ protected:
|
||||
};
|
||||
|
||||
// ImageHost with a single DeprecatedTextureHost
|
||||
class DeprecatedImageHostSingle : public ImageHost
|
||||
class ImageHostSingle : public ImageHost
|
||||
{
|
||||
public:
|
||||
DeprecatedImageHostSingle(const TextureInfo& aTextureInfo)
|
||||
ImageHostSingle(const TextureInfo& aTextureInfo)
|
||||
: ImageHost(aTextureInfo)
|
||||
, mDeprecatedTextureHost(nullptr)
|
||||
, mHasPictureRect(false)
|
||||
@ -115,11 +115,11 @@ protected:
|
||||
// Double buffered ImageHost. We have a single TextureHost and double buffering
|
||||
// is done at the TextureHost/Client level. This is in contrast with buffered
|
||||
// ContentHosts which do their own double buffering
|
||||
class DeprecatedImageHostBuffered : public DeprecatedImageHostSingle
|
||||
class ImageHostBuffered : public ImageHostSingle
|
||||
{
|
||||
public:
|
||||
DeprecatedImageHostBuffered(const TextureInfo& aTextureInfo)
|
||||
: DeprecatedImageHostSingle(aTextureInfo)
|
||||
ImageHostBuffered(const TextureInfo& aTextureInfo)
|
||||
: ImageHostSingle(aTextureInfo)
|
||||
{}
|
||||
|
||||
virtual bool Update(const SurfaceDescriptor& aImage,
|
||||
|
@ -169,13 +169,12 @@ bool IsSurfaceDescriptorOwned(const SurfaceDescriptor& aDescriptor)
|
||||
}
|
||||
bool ReleaseOwnedSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
{
|
||||
DeprecatedSharedPlanarYCbCrImage* sharedYCbCr =
|
||||
DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
|
||||
SharedPlanarYCbCrImage* sharedYCbCr = SharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
|
||||
if (sharedYCbCr) {
|
||||
sharedYCbCr->Release();
|
||||
return true;
|
||||
}
|
||||
DeprecatedSharedRGBImage* sharedRGB = DeprecatedSharedRGBImage::FromSurfaceDescriptor(aDescriptor);
|
||||
SharedRGBImage* sharedRGB = SharedRGBImage::FromSurfaceDescriptor(aDescriptor);
|
||||
if (sharedRGB) {
|
||||
sharedRGB->Release();
|
||||
return true;
|
||||
|
@ -13,8 +13,8 @@ namespace layers {
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
|
||||
MOZ_COUNT_DTOR(DeprecatedSharedPlanarYCbCrImage);
|
||||
SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
|
||||
MOZ_COUNT_DTOR(SharedPlanarYCbCrImage);
|
||||
|
||||
if (mAllocated) {
|
||||
SurfaceDescriptor desc;
|
||||
@ -25,7 +25,7 @@ DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
|
||||
|
||||
|
||||
void
|
||||
DeprecatedSharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
|
||||
SharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
|
||||
{
|
||||
// If mShmem has not been allocated (through Allocate(aData)), allocate it.
|
||||
// This code path is slower than the one used when Allocate has been called
|
||||
@ -60,7 +60,7 @@ DeprecatedSharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
|
||||
// needs to be overriden because the parent class sets mBuffer which we
|
||||
// do not want to happen.
|
||||
uint8_t*
|
||||
DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
||||
SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
||||
size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
|
||||
@ -76,7 +76,7 @@ DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
||||
|
||||
|
||||
void
|
||||
DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
||||
SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
||||
{
|
||||
mData = aData;
|
||||
mSize = aData.mPicSize;
|
||||
@ -86,7 +86,7 @@ DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
||||
}
|
||||
|
||||
uint8_t*
|
||||
DeprecatedSharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
||||
SharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
||||
SharedMemory::SharedMemoryType shmType = OptimalShmemType();
|
||||
@ -99,7 +99,7 @@ DeprecatedSharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
||||
|
||||
|
||||
bool
|
||||
DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
|
||||
SharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
||||
|
||||
@ -145,7 +145,7 @@ DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
||||
SharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
||||
if (!mAllocated) {
|
||||
return false;
|
||||
}
|
||||
@ -155,7 +155,7 @@ DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc)
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
||||
SharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
||||
if (!mAllocated) {
|
||||
return false;
|
||||
}
|
||||
@ -165,8 +165,8 @@ DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDe
|
||||
return true;
|
||||
}
|
||||
|
||||
DeprecatedSharedPlanarYCbCrImage*
|
||||
DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
SharedPlanarYCbCrImage*
|
||||
SharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
{
|
||||
if (aDescriptor.type() != SurfaceDescriptor::TYCbCrImage) {
|
||||
return nullptr;
|
||||
@ -175,7 +175,7 @@ DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor&
|
||||
if (ycbcr.owner() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<DeprecatedSharedPlanarYCbCrImage*>(ycbcr.owner());
|
||||
return reinterpret_cast<SharedPlanarYCbCrImage*>(ycbcr.owner());
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,27 +8,27 @@
|
||||
#include "mozilla/ipc/SharedMemory.h"
|
||||
#include "mozilla/layers/ISurfaceAllocator.h"
|
||||
|
||||
#ifndef MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
|
||||
#define MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
|
||||
#ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
|
||||
#define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ImageClient;
|
||||
|
||||
class DeprecatedSharedPlanarYCbCrImage : public PlanarYCbCrImage
|
||||
class SharedPlanarYCbCrImage : public PlanarYCbCrImage
|
||||
{
|
||||
public:
|
||||
DeprecatedSharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator)
|
||||
SharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator)
|
||||
: PlanarYCbCrImage(nullptr)
|
||||
, mSurfaceAllocator(aAllocator), mAllocated(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(DeprecatedSharedPlanarYCbCrImage);
|
||||
MOZ_COUNT_CTOR(SharedPlanarYCbCrImage);
|
||||
}
|
||||
|
||||
~DeprecatedSharedPlanarYCbCrImage();
|
||||
~SharedPlanarYCbCrImage();
|
||||
|
||||
virtual DeprecatedSharedPlanarYCbCrImage* AsDeprecatedSharedPlanarYCbCrImage() MOZ_OVERRIDE
|
||||
virtual SharedPlanarYCbCrImage* AsSharedPlanarYCbCrImage() MOZ_OVERRIDE
|
||||
{
|
||||
return this;
|
||||
}
|
||||
@ -58,7 +58,7 @@ public:
|
||||
/**
|
||||
* Setup the Surface descriptor to contain this image's shmem, while keeping
|
||||
* ownership of the shmem.
|
||||
* if the operation succeeds, return true and AddRef this DeprecatedSharedPlanarYCbCrImage.
|
||||
* if the operation succeeds, return true and AddRef this SharedPlanarYCbCrImage.
|
||||
*/
|
||||
bool ToSurfaceDescriptor(SurfaceDescriptor& aResult);
|
||||
|
||||
@ -66,15 +66,15 @@ public:
|
||||
* Setup the Surface descriptor to contain this image's shmem, and loose
|
||||
* ownership of the shmem.
|
||||
* if the operation succeeds, return true (and does _not_ AddRef this
|
||||
* DeprecatedSharedPlanarYCbCrImage).
|
||||
* SharedPlanarYCbCrImage).
|
||||
*/
|
||||
bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
|
||||
|
||||
/**
|
||||
* Returns a DeprecatedSharedPlanarYCbCrImage* iff the descriptor was initialized with
|
||||
* Returns a SharedPlanarYCbCrImage* iff the descriptor was initialized with
|
||||
* ToSurfaceDescriptor.
|
||||
*/
|
||||
static DeprecatedSharedPlanarYCbCrImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDesc);
|
||||
static SharedPlanarYCbCrImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDesc);
|
||||
|
||||
private:
|
||||
ipc::Shmem mShmem;
|
||||
|
@ -14,19 +14,19 @@
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
DeprecatedSharedRGBImage::DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator) :
|
||||
SharedRGBImage::SharedRGBImage(ISurfaceAllocator *aAllocator) :
|
||||
Image(nullptr, SHARED_RGB),
|
||||
mSize(0, 0),
|
||||
mSurfaceAllocator(aAllocator),
|
||||
mAllocated(false),
|
||||
mShmem(new ipc::Shmem())
|
||||
{
|
||||
MOZ_COUNT_CTOR(DeprecatedSharedRGBImage);
|
||||
MOZ_COUNT_CTOR(SharedRGBImage);
|
||||
}
|
||||
|
||||
DeprecatedSharedRGBImage::~DeprecatedSharedRGBImage()
|
||||
SharedRGBImage::~SharedRGBImage()
|
||||
{
|
||||
MOZ_COUNT_DTOR(DeprecatedSharedRGBImage);
|
||||
MOZ_COUNT_DTOR(SharedRGBImage);
|
||||
|
||||
if (mAllocated) {
|
||||
SurfaceDescriptor desc;
|
||||
@ -36,8 +36,8 @@ DeprecatedSharedRGBImage::~DeprecatedSharedRGBImage()
|
||||
delete mShmem;
|
||||
}
|
||||
|
||||
already_AddRefed<DeprecatedSharedRGBImage>
|
||||
DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
|
||||
already_AddRefed<SharedRGBImage>
|
||||
SharedRGBImage::Create(ImageContainer *aImageContainer,
|
||||
nsIntSize aSize,
|
||||
gfxImageFormat aImageFormat)
|
||||
{
|
||||
@ -47,7 +47,7 @@ DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
|
||||
"RGB formats supported only");
|
||||
|
||||
if (!aImageContainer) {
|
||||
NS_WARNING("No ImageContainer to allocate DeprecatedSharedRGBImage");
|
||||
NS_WARNING("No ImageContainer to allocate SharedRGBImage");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -55,16 +55,16 @@ DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
|
||||
nsRefPtr<Image> image = aImageContainer->CreateImage(&format, 1);
|
||||
|
||||
if (!image) {
|
||||
NS_WARNING("Failed to create DeprecatedSharedRGBImage");
|
||||
NS_WARNING("Failed to create SharedRGBImage");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<DeprecatedSharedRGBImage> rgbImage = static_cast<DeprecatedSharedRGBImage*>(image.get());
|
||||
nsRefPtr<SharedRGBImage> rgbImage = static_cast<SharedRGBImage*>(image.get());
|
||||
rgbImage->mSize = gfxIntSize(aSize.width, aSize.height);
|
||||
rgbImage->mImageFormat = aImageFormat;
|
||||
|
||||
if (!rgbImage->AllocateBuffer(aSize, aImageFormat)) {
|
||||
NS_WARNING("Failed to allocate shared memory for DeprecatedSharedRGBImage");
|
||||
NS_WARNING("Failed to allocate shared memory for SharedRGBImage");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -72,25 +72,25 @@ DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
DeprecatedSharedRGBImage::GetBuffer()
|
||||
SharedRGBImage::GetBuffer()
|
||||
{
|
||||
return mShmem->get<uint8_t>();
|
||||
}
|
||||
|
||||
size_t
|
||||
DeprecatedSharedRGBImage::GetBufferSize()
|
||||
SharedRGBImage::GetBufferSize()
|
||||
{
|
||||
return mSize.width * mSize.height * gfxASurface::BytesPerPixel(mImageFormat);
|
||||
}
|
||||
|
||||
gfxIntSize
|
||||
DeprecatedSharedRGBImage::GetSize()
|
||||
SharedRGBImage::GetSize()
|
||||
{
|
||||
return mSize;
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedSharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
|
||||
SharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
|
||||
{
|
||||
if (mAllocated) {
|
||||
NS_WARNING("Already allocated shmem");
|
||||
@ -110,13 +110,13 @@ DeprecatedSharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageF
|
||||
}
|
||||
|
||||
already_AddRefed<gfxASurface>
|
||||
DeprecatedSharedRGBImage::GetAsSurface()
|
||||
SharedRGBImage::GetAsSurface()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedSharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
SharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
{
|
||||
if (!mAllocated) {
|
||||
return false;
|
||||
@ -130,7 +130,7 @@ DeprecatedSharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
}
|
||||
|
||||
bool
|
||||
DeprecatedSharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
SharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
{
|
||||
if (!mAllocated) {
|
||||
return false;
|
||||
@ -144,8 +144,8 @@ DeprecatedSharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
|
||||
return true;
|
||||
}
|
||||
|
||||
DeprecatedSharedRGBImage*
|
||||
DeprecatedSharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
SharedRGBImage*
|
||||
SharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
{
|
||||
if (aDescriptor.type() != SurfaceDescriptor::TRGBImage) {
|
||||
return nullptr;
|
||||
@ -154,7 +154,7 @@ DeprecatedSharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescri
|
||||
if (rgb.owner() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<DeprecatedSharedRGBImage*>(rgb.owner());
|
||||
return reinterpret_cast<SharedRGBImage*>(rgb.owner());
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace layers {
|
||||
* Stores RGB data in shared memory
|
||||
* It is assumed that the image width and stride are equal
|
||||
*/
|
||||
class DeprecatedSharedRGBImage : public Image
|
||||
class SharedRGBImage : public Image
|
||||
{
|
||||
typedef gfxASurface::gfxImageFormat gfxImageFormat;
|
||||
public:
|
||||
@ -26,10 +26,10 @@ public:
|
||||
gfxImageFormat mImageFormat;
|
||||
};
|
||||
|
||||
DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator);
|
||||
~DeprecatedSharedRGBImage();
|
||||
SharedRGBImage(ISurfaceAllocator *aAllocator);
|
||||
~SharedRGBImage();
|
||||
|
||||
static already_AddRefed<DeprecatedSharedRGBImage> Create(ImageContainer* aImageContainer,
|
||||
static already_AddRefed<SharedRGBImage> Create(ImageContainer* aImageContainer,
|
||||
nsIntSize aSize,
|
||||
gfxImageFormat aImageFormat);
|
||||
uint8_t *GetBuffer();
|
||||
@ -43,7 +43,7 @@ public:
|
||||
/**
|
||||
* Setup the Surface descriptor to contain this image's shmem, while keeping
|
||||
* ownership of the shmem.
|
||||
* if the operation succeeds, return true and AddRef this DeprecatedSharedRGBImage.
|
||||
* if the operation succeeds, return true and AddRef this SharedRGBImage.
|
||||
*/
|
||||
bool ToSurfaceDescriptor(SurfaceDescriptor& aResult);
|
||||
|
||||
@ -51,15 +51,15 @@ public:
|
||||
* Setup the Surface descriptor to contain this image's shmem, and loose
|
||||
* ownership of the shmem.
|
||||
* if the operation succeeds, return true (and does _not_ AddRef this
|
||||
* DeprecatedSharedRGBImage).
|
||||
* SharedRGBImage).
|
||||
*/
|
||||
bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
|
||||
|
||||
/**
|
||||
* Returns a DeprecatedSharedRGBImage* iff the descriptor was initialized with
|
||||
* Returns a SharedRGBImage* iff the descriptor was initialized with
|
||||
* ToSurfaceDescriptor.
|
||||
*/
|
||||
static DeprecatedSharedRGBImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
|
||||
static SharedRGBImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
|
||||
|
||||
private:
|
||||
bool AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat);
|
||||
|
@ -780,7 +780,7 @@ GrallocDeprecatedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImag
|
||||
DeleteTextures();
|
||||
|
||||
// only done for hacky fix in gecko 23 for bug 862324.
|
||||
// Doing this in SetBuffer is not enough, as DeprecatedImageHostBuffered::SwapTextures can
|
||||
// Doing this in SetBuffer is not enough, as ImageHostBuffered::SwapTextures can
|
||||
// change the value of *mBuffer without calling SetBuffer again.
|
||||
RegisterDeprecatedTextureHostAtGrallocBufferActor(this, aImage);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user