Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "SharedPlanarYCbCrImage.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#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
|
|
|
|
#include "mozilla/layers/ImageClient.h" // for ImageClient
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
|
|
|
|
#include "mozilla/layers/TextureClient.h" // for BufferTextureClient, etc
|
2013-05-23 00:17:10 -07:00
|
|
|
#include "mozilla/layers/YCbCrImageDataSerializer.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsISupportsImpl.h" // for Image::AddRef
|
|
|
|
|
|
|
|
class gfxASurface;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
using namespace mozilla::ipc;
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
SharedPlanarYCbCrImage::SharedPlanarYCbCrImage(ImageClient* aCompositable)
|
|
|
|
: PlanarYCbCrImage(nullptr)
|
|
|
|
{
|
|
|
|
mTextureClient = aCompositable->CreateBufferTextureClient(gfx::FORMAT_YUV);
|
|
|
|
MOZ_COUNT_CTOR(SharedPlanarYCbCrImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
|
|
|
|
MOZ_COUNT_DTOR(SharedPlanarYCbCrImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
|
|
|
|
MOZ_COUNT_DTOR(DeprecatedSharedPlanarYCbCrImage);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
if (mAllocated) {
|
|
|
|
SurfaceDescriptor desc;
|
|
|
|
DropToSurfaceDescriptor(desc);
|
|
|
|
mSurfaceAllocator->DestroySharedSurface(&desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
TextureClient*
|
|
|
|
SharedPlanarYCbCrImage::GetTextureClient()
|
|
|
|
{
|
|
|
|
return mTextureClient.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t*
|
|
|
|
SharedPlanarYCbCrImage::GetBuffer()
|
|
|
|
{
|
|
|
|
return mTextureClient->GetBuffer();
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<gfxASurface>
|
|
|
|
SharedPlanarYCbCrImage::GetAsSurface()
|
|
|
|
{
|
|
|
|
if (!mTextureClient->IsAllocated()) {
|
|
|
|
NS_WARNING("Can't get as surface");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return PlanarYCbCrImage::GetAsSurface();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
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
|
|
|
|
// since it will trigger a full copy.
|
|
|
|
if (!mTextureClient->IsAllocated()) {
|
|
|
|
Data data = aData;
|
|
|
|
if (!Allocate(data)) {
|
2013-08-08 05:53:12 -07:00
|
|
|
NS_WARNING("SharedPlanarYCbCrImage::SetData failed to allocate");
|
2013-07-30 02:59:51 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(mTextureClient->AsTextureClientYCbCr());
|
|
|
|
|
|
|
|
if (!mTextureClient->AsTextureClientYCbCr()->UpdateYCbCr(aData)) {
|
|
|
|
MOZ_ASSERT(false, "Failed to copy YCbCr data into the TextureClient");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// do not set mBuffer like in PlanarYCbCrImage because the later
|
|
|
|
// will try to manage this memory without knowing it belongs to a
|
|
|
|
// shmem.
|
|
|
|
mBufferSize = YCbCrImageDataSerializer::ComputeMinBufferSize(mData.mYSize,
|
|
|
|
mData.mCbCrSize);
|
|
|
|
mSize = mData.mPicSize;
|
|
|
|
|
|
|
|
YCbCrImageDataSerializer serializer(mTextureClient->GetBuffer());
|
|
|
|
mData.mYChannel = serializer.GetYData();
|
|
|
|
mData.mCbChannel = serializer.GetCbData();
|
|
|
|
mData.mCrChannel = serializer.GetCrData();
|
|
|
|
mTextureClient->MarkImmutable();
|
|
|
|
}
|
|
|
|
|
|
|
|
// needs to be overriden because the parent class sets mBuffer which we
|
|
|
|
// do not want to happen.
|
|
|
|
uint8_t*
|
|
|
|
SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mTextureClient->IsAllocated(), "This image already has allocated data");
|
|
|
|
size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
|
|
|
|
// update buffer size
|
|
|
|
mBufferSize = size;
|
|
|
|
|
|
|
|
// get new buffer _without_ setting mBuffer.
|
|
|
|
bool status = mTextureClient->Allocate(mBufferSize);
|
|
|
|
MOZ_ASSERT(status);
|
|
|
|
YCbCrImageDataSerializer serializer(mTextureClient->GetBuffer());
|
|
|
|
|
|
|
|
return serializer.GetData();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
|
|
|
{
|
|
|
|
mData = aData;
|
|
|
|
mSize = aData.mPicSize;
|
|
|
|
YCbCrImageDataSerializer serializer(mTextureClient->GetBuffer());
|
|
|
|
serializer.InitializeBufferInfo(aData.mYSize,
|
2013-08-04 00:46:17 -07:00
|
|
|
aData.mCbCrSize,
|
|
|
|
aData.mStereoMode);
|
2013-07-30 02:59:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t*
|
|
|
|
SharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mTextureClient->IsAllocated(),
|
|
|
|
"This image already has allocated data");
|
|
|
|
if (!mTextureClient->Allocate(aSize)) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return mTextureClient->GetBuffer();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SharedPlanarYCbCrImage::IsValid() {
|
|
|
|
return mTextureClient->IsAllocated();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mTextureClient->IsAllocated(),
|
|
|
|
"This image already has allocated data");
|
|
|
|
|
|
|
|
size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aData.mYSize,
|
|
|
|
aData.mCbCrSize);
|
|
|
|
|
|
|
|
if (AllocateBuffer(static_cast<uint32_t>(size)) == nullptr) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
YCbCrImageDataSerializer serializer(mTextureClient->GetBuffer());
|
|
|
|
serializer.InitializeBufferInfo(aData.mYSize,
|
2013-08-04 00:46:17 -07:00
|
|
|
aData.mCbCrSize,
|
|
|
|
aData.mStereoMode);
|
2013-07-30 02:59:51 -07:00
|
|
|
MOZ_ASSERT(serializer.IsValid());
|
|
|
|
|
|
|
|
aData.mYChannel = serializer.GetYData();
|
|
|
|
aData.mCbChannel = serializer.GetCbData();
|
|
|
|
aData.mCrChannel = serializer.GetCrData();
|
|
|
|
|
|
|
|
// copy some of aData's values in mData (most of them)
|
|
|
|
mData.mYChannel = aData.mYChannel;
|
|
|
|
mData.mCbChannel = aData.mCbChannel;
|
|
|
|
mData.mCrChannel = aData.mCrChannel;
|
|
|
|
mData.mYSize = aData.mYSize;
|
|
|
|
mData.mCbCrSize = aData.mCbCrSize;
|
|
|
|
mData.mPicX = aData.mPicX;
|
|
|
|
mData.mPicY = aData.mPicY;
|
|
|
|
mData.mPicSize = aData.mPicSize;
|
|
|
|
mData.mStereoMode = aData.mStereoMode;
|
|
|
|
// those members are not always equal to aData's, due to potentially different
|
|
|
|
// packing.
|
|
|
|
mData.mYSkip = 0;
|
|
|
|
mData.mCbSkip = 0;
|
|
|
|
mData.mCrSkip = 0;
|
|
|
|
mData.mYStride = mData.mYSize.width;
|
|
|
|
mData.mCbCrStride = mData.mCbCrSize.width;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
void
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
// 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
|
|
|
|
// since it will trigger a full copy.
|
|
|
|
if (!mAllocated) {
|
|
|
|
Data data = aData;
|
|
|
|
if (!Allocate(data)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// do not set mBuffer like in PlanarYCbCrImage because the later
|
|
|
|
// will try to manage this memory without knowing it belongs to a
|
|
|
|
// shmem.
|
2013-05-23 00:17:10 -07:00
|
|
|
mBufferSize = YCbCrImageDataSerializer::ComputeMinBufferSize(mData.mYSize,
|
|
|
|
mData.mCbCrSize);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
mSize = mData.mPicSize;
|
|
|
|
|
2013-05-23 00:17:10 -07:00
|
|
|
YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
MOZ_ASSERT(aData.mCbSkip == aData.mCrSkip);
|
2013-05-23 00:17:10 -07:00
|
|
|
if (!serializer.CopyData(aData.mYChannel, aData.mCbChannel, aData.mCrChannel,
|
|
|
|
aData.mYSize, aData.mYStride,
|
|
|
|
aData.mCbCrSize, aData.mCbCrStride,
|
|
|
|
aData.mYSkip, aData.mCbSkip)) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
NS_WARNING("Failed to copy image data!");
|
|
|
|
}
|
2013-05-23 00:17:10 -07:00
|
|
|
mData.mYChannel = serializer.GetYData();
|
|
|
|
mData.mCbChannel = serializer.GetCbData();
|
|
|
|
mData.mCrChannel = serializer.GetCrData();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// needs to be overriden because the parent class sets mBuffer which we
|
|
|
|
// do not want to happen.
|
|
|
|
uint8_t*
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
2013-05-23 00:17:10 -07:00
|
|
|
size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
// update buffer size
|
|
|
|
mBufferSize = size;
|
|
|
|
|
|
|
|
// get new buffer _without_ setting mBuffer.
|
|
|
|
AllocateBuffer(mBufferSize);
|
2013-05-23 00:17:10 -07:00
|
|
|
YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-05-23 00:17:10 -07:00
|
|
|
return serializer.GetData();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
mData = aData;
|
|
|
|
mSize = aData.mPicSize;
|
2013-05-23 00:17:10 -07:00
|
|
|
YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
|
|
|
|
serializer.InitializeBufferInfo(aData.mYSize,
|
2013-08-04 00:46:17 -07:00
|
|
|
aData.mCbCrSize,
|
|
|
|
aData.mStereoMode);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t*
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
|
|
|
SharedMemory::SharedMemoryType shmType = OptimalShmemType();
|
|
|
|
if (!mSurfaceAllocator->AllocUnsafeShmem(aSize, shmType, &mShmem)) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
mAllocated = true;
|
|
|
|
return mShmem.get<uint8_t>();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
|
|
|
|
|
2013-05-23 00:17:10 -07:00
|
|
|
size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aData.mYSize,
|
|
|
|
aData.mCbCrSize);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
if (AllocateBuffer(static_cast<uint32_t>(size)) == nullptr) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-05-23 00:17:10 -07:00
|
|
|
YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
|
|
|
|
serializer.InitializeBufferInfo(aData.mYSize,
|
2013-08-04 00:46:17 -07:00
|
|
|
aData.mCbCrSize,
|
|
|
|
aData.mStereoMode);
|
2013-05-23 00:17:10 -07:00
|
|
|
if (!serializer.IsValid() || mShmem.Size<uint8_t>() < size) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
mSurfaceAllocator->DeallocShmem(mShmem);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-05-23 00:17:10 -07:00
|
|
|
aData.mYChannel = serializer.GetYData();
|
|
|
|
aData.mCbChannel = serializer.GetCbData();
|
|
|
|
aData.mCrChannel = serializer.GetCrData();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
// copy some of aData's values in mData (most of them)
|
|
|
|
mData.mYChannel = aData.mYChannel;
|
|
|
|
mData.mCbChannel = aData.mCbChannel;
|
|
|
|
mData.mCrChannel = aData.mCrChannel;
|
|
|
|
mData.mYSize = aData.mYSize;
|
|
|
|
mData.mCbCrSize = aData.mCbCrSize;
|
|
|
|
mData.mPicX = aData.mPicX;
|
|
|
|
mData.mPicY = aData.mPicY;
|
|
|
|
mData.mPicSize = aData.mPicSize;
|
|
|
|
mData.mStereoMode = aData.mStereoMode;
|
|
|
|
// those members are not always equal to aData's, due to potentially different
|
|
|
|
// packing.
|
|
|
|
mData.mYSkip = 0;
|
|
|
|
mData.mCbSkip = 0;
|
|
|
|
mData.mCrSkip = 0;
|
|
|
|
mData.mYStride = mData.mYSize.width;
|
|
|
|
mData.mCbCrStride = mData.mCbCrSize.width;
|
|
|
|
|
|
|
|
mAllocated = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
if (!mAllocated) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-05-23 00:17:10 -07:00
|
|
|
aDesc = YCbCrImage(mShmem, reinterpret_cast<uint64_t>(this));
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
this->AddRef();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
if (!mAllocated) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-05-23 00:17:10 -07:00
|
|
|
aDesc = YCbCrImage(mShmem, 0);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
mShmem = Shmem();
|
|
|
|
mAllocated = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-07-24 09:08:35 -07:00
|
|
|
DeprecatedSharedPlanarYCbCrImage*
|
|
|
|
DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
if (aDescriptor.type() != SurfaceDescriptor::TYCbCrImage) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
const YCbCrImage& ycbcr = aDescriptor.get_YCbCrImage();
|
|
|
|
if (ycbcr.owner() == 0) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2013-07-24 09:08:35 -07:00
|
|
|
return reinterpret_cast<DeprecatedSharedPlanarYCbCrImage*>(ycbcr.owner());
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|