2012-07-12 12:51:58 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
|
|
|
/* 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/. */
|
|
|
|
|
2012-12-14 23:58:45 +00:00
|
|
|
#include "mozilla/DebugOnly.h"
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
#include "mozilla/layers/PGrallocBufferChild.h"
|
|
|
|
#include "mozilla/layers/PGrallocBufferParent.h"
|
2013-11-26 19:58:09 +00:00
|
|
|
#include "mozilla/layers/PLayerTransactionChild.h"
|
2012-07-12 12:51:58 +00:00
|
|
|
#include "mozilla/layers/ShadowLayers.h"
|
2013-04-25 22:25:33 +00:00
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2012-07-12 12:51:58 +00:00
|
|
|
#include "mozilla/unused.h"
|
|
|
|
#include "nsXULAppAPI.h"
|
|
|
|
|
|
|
|
#include "ShadowLayerUtilsGralloc.h"
|
|
|
|
|
2012-11-22 13:39:56 +00:00
|
|
|
#include "nsIMemoryReporter.h"
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
#include "gfxImageSurface.h"
|
2012-08-19 19:33:25 +00:00
|
|
|
#include "gfxPlatform.h"
|
2013-09-04 12:14:52 +00:00
|
|
|
#include "GLContext.h"
|
2012-07-12 12:51:58 +00:00
|
|
|
|
2013-03-18 14:25:50 +00:00
|
|
|
#include "GeckoProfiler.h"
|
2012-08-01 22:49:59 +00:00
|
|
|
|
2013-06-05 20:42:00 +00:00
|
|
|
#include "cutils/properties.h"
|
|
|
|
|
2013-09-24 22:09:20 +00:00
|
|
|
#include "MainThreadUtils.h"
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
using namespace android;
|
|
|
|
using namespace base;
|
|
|
|
using namespace mozilla::layers;
|
2012-10-25 20:12:59 +00:00
|
|
|
using namespace mozilla::gl;
|
2012-07-12 12:51:58 +00:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
void
|
|
|
|
ParamTraits<MagicGrallocBufferHandle>::Write(Message* aMsg,
|
|
|
|
const paramType& aParam)
|
|
|
|
{
|
|
|
|
Flattenable *flattenable = aParam.mGraphicBuffer.get();
|
|
|
|
size_t nbytes = flattenable->getFlattenedSize();
|
|
|
|
size_t nfds = flattenable->getFdCount();
|
|
|
|
|
|
|
|
char data[nbytes];
|
|
|
|
int fds[nfds];
|
|
|
|
flattenable->flatten(data, nbytes, fds, nfds);
|
|
|
|
|
|
|
|
aMsg->WriteSize(nbytes);
|
|
|
|
aMsg->WriteSize(nfds);
|
|
|
|
|
|
|
|
aMsg->WriteBytes(data, nbytes);
|
|
|
|
for (size_t n = 0; n < nfds; ++n) {
|
|
|
|
// These buffers can't die in transit because they're created
|
|
|
|
// synchonously and the parent-side buffer can only be dropped if
|
|
|
|
// there's a crash.
|
|
|
|
aMsg->WriteFileDescriptor(FileDescriptor(fds[n], false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ParamTraits<MagicGrallocBufferHandle>::Read(const Message* aMsg,
|
|
|
|
void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
size_t nbytes;
|
|
|
|
size_t nfds;
|
|
|
|
const char* data;
|
|
|
|
|
|
|
|
if (!aMsg->ReadSize(aIter, &nbytes) ||
|
|
|
|
!aMsg->ReadSize(aIter, &nfds) ||
|
|
|
|
!aMsg->ReadBytes(aIter, &data, nbytes)) {
|
|
|
|
return false;
|
|
|
|
}
|
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 09:20:52 +00:00
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
int fds[nfds];
|
|
|
|
|
|
|
|
for (size_t n = 0; n < nfds; ++n) {
|
|
|
|
FileDescriptor fd;
|
|
|
|
if (!aMsg->ReadFileDescriptor(aIter, &fd)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// If the GraphicBuffer was shared cross-process, SCM_RIGHTS does
|
|
|
|
// the right thing and dup's the fd. If it's shared cross-thread,
|
|
|
|
// SCM_RIGHTS doesn't dup the fd. That's surprising, but we just
|
|
|
|
// deal with it here. NB: only the "default" (master) process can
|
|
|
|
// alloc gralloc buffers.
|
|
|
|
bool sameProcess = (XRE_GetProcessType() == GeckoProcessType_Default);
|
|
|
|
int dupFd = sameProcess ? dup(fd.fd) : fd.fd;
|
|
|
|
fds[n] = dupFd;
|
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer(new GraphicBuffer());
|
|
|
|
Flattenable *flattenable = buffer.get();
|
|
|
|
|
|
|
|
if (NO_ERROR == flattenable->unflatten(data, nbytes, fds, nfds)) {
|
|
|
|
aResult->mGraphicBuffer = buffer;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace IPC
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
MagicGrallocBufferHandle::MagicGrallocBufferHandle(const sp<GraphicBuffer>& aGraphicBuffer)
|
|
|
|
: mGraphicBuffer(aGraphicBuffer)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Parent process
|
|
|
|
|
2013-09-24 20:45:13 +00:00
|
|
|
static gfxImageFormat
|
2012-07-12 12:51:58 +00:00
|
|
|
ImageFormatForPixelFormat(android::PixelFormat aFormat)
|
|
|
|
{
|
|
|
|
switch (aFormat) {
|
|
|
|
case PIXEL_FORMAT_RGBA_8888:
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatARGB32;
|
2012-07-12 12:51:58 +00:00
|
|
|
case PIXEL_FORMAT_RGBX_8888:
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatRGB24;
|
2012-07-12 12:51:58 +00:00
|
|
|
case PIXEL_FORMAT_RGB_565:
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatRGB16_565;
|
2012-07-12 12:51:58 +00:00
|
|
|
case PIXEL_FORMAT_A_8:
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatA8;
|
2012-07-12 12:51:58 +00:00
|
|
|
default:
|
2013-06-29 01:38:30 +00:00
|
|
|
MOZ_CRASH("Unknown gralloc pixel format");
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatARGB32;
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static android::PixelFormat
|
2013-09-24 20:45:13 +00:00
|
|
|
PixelFormatForImageFormat(gfxImageFormat aFormat)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
|
|
|
switch (aFormat) {
|
2013-09-24 20:45:13 +00:00
|
|
|
case gfxImageFormatARGB32:
|
2012-07-12 12:51:58 +00:00
|
|
|
return android::PIXEL_FORMAT_RGBA_8888;
|
2013-09-24 20:45:13 +00:00
|
|
|
case gfxImageFormatRGB24:
|
2012-07-12 12:51:58 +00:00
|
|
|
return android::PIXEL_FORMAT_RGBX_8888;
|
2013-09-24 20:45:13 +00:00
|
|
|
case gfxImageFormatRGB16_565:
|
2012-07-12 12:51:58 +00:00
|
|
|
return android::PIXEL_FORMAT_RGB_565;
|
2013-09-24 20:45:13 +00:00
|
|
|
case gfxImageFormatA8:
|
2012-07-12 12:51:58 +00:00
|
|
|
return android::PIXEL_FORMAT_A_8;
|
|
|
|
default:
|
2013-06-29 01:38:30 +00:00
|
|
|
MOZ_CRASH("Unknown gralloc pixel format");
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
2013-09-24 20:45:13 +00:00
|
|
|
return gfxImageFormatARGB32;
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
|
|
|
|
2013-05-27 14:12:13 +00:00
|
|
|
static size_t
|
|
|
|
BytesPerPixelForPixelFormat(android::PixelFormat aFormat)
|
|
|
|
{
|
|
|
|
switch (aFormat) {
|
|
|
|
case PIXEL_FORMAT_RGBA_8888:
|
|
|
|
case PIXEL_FORMAT_RGBX_8888:
|
|
|
|
case PIXEL_FORMAT_BGRA_8888:
|
|
|
|
return 4;
|
|
|
|
case PIXEL_FORMAT_RGB_888:
|
|
|
|
return 3;
|
|
|
|
case PIXEL_FORMAT_RGB_565:
|
|
|
|
case PIXEL_FORMAT_RGBA_5551:
|
|
|
|
case PIXEL_FORMAT_RGBA_4444:
|
|
|
|
return 2;
|
|
|
|
case PIXEL_FORMAT_A_8:
|
|
|
|
return 1;
|
|
|
|
default:
|
2013-06-07 16:05:03 +00:00
|
|
|
return 0;
|
2013-05-27 14:12:13 +00:00
|
|
|
}
|
2013-06-07 16:05:03 +00:00
|
|
|
return 0;
|
2013-05-27 14:12:13 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
static android::PixelFormat
|
2013-09-24 20:45:13 +00:00
|
|
|
PixelFormatForContentType(gfxContentType aContentType)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
|
|
|
return PixelFormatForImageFormat(
|
|
|
|
gfxPlatform::GetPlatform()->OptimalFormatForContent(aContentType));
|
|
|
|
}
|
|
|
|
|
2013-09-24 20:45:13 +00:00
|
|
|
static gfxContentType
|
2012-07-12 12:51:58 +00:00
|
|
|
ContentTypeFromPixelFormat(android::PixelFormat aFormat)
|
|
|
|
{
|
|
|
|
return gfxASurface::ContentFromFormat(ImageFormatForPixelFormat(aFormat));
|
|
|
|
}
|
|
|
|
|
2013-08-27 23:24:51 +00:00
|
|
|
class GrallocReporter MOZ_FINAL : public MemoryUniReporter
|
2013-01-18 00:45:11 +00:00
|
|
|
{
|
|
|
|
friend class GrallocBufferActor;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GrallocReporter()
|
2013-08-27 23:24:51 +00:00
|
|
|
: MemoryUniReporter("gralloc", KIND_OTHER, UNITS_BYTES,
|
2013-01-18 00:45:11 +00:00
|
|
|
"Special RAM that can be shared between processes and directly accessed by "
|
|
|
|
"both the CPU and GPU. Gralloc memory is usually a relatively precious "
|
|
|
|
"resource, with much less available than generic RAM. When it's exhausted, "
|
|
|
|
"graphics performance can suffer. This value can be incorrect because of race "
|
|
|
|
"conditions.")
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
// There must be only one instance of this class, due to |sAmount|
|
|
|
|
// being static. Assert this.
|
|
|
|
static bool hasRun = false;
|
|
|
|
MOZ_ASSERT(!hasRun);
|
|
|
|
hasRun = true;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int64_t Amount() MOZ_OVERRIDE { return sAmount; }
|
|
|
|
|
|
|
|
static int64_t sAmount;
|
|
|
|
};
|
|
|
|
|
|
|
|
int64_t GrallocReporter::sAmount = 0;
|
2012-11-22 13:39:56 +00:00
|
|
|
|
|
|
|
GrallocBufferActor::GrallocBufferActor()
|
|
|
|
: mAllocBytes(0)
|
|
|
|
{
|
|
|
|
static bool registered;
|
|
|
|
if (!registered) {
|
|
|
|
// We want to be sure that the first call here will always run on
|
|
|
|
// the main thread.
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
|
|
|
|
2013-01-18 00:45:11 +00:00
|
|
|
NS_RegisterMemoryReporter(new GrallocReporter());
|
2012-11-22 13:39:56 +00:00
|
|
|
registered = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GrallocBufferActor::~GrallocBufferActor()
|
|
|
|
{
|
|
|
|
if (mAllocBytes > 0) {
|
2013-01-18 00:45:11 +00:00
|
|
|
GrallocReporter::sAmount -= mAllocBytes;
|
2012-11-22 13:39:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
/*static*/ PGrallocBufferParent*
|
|
|
|
GrallocBufferActor::Create(const gfxIntSize& aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
const uint32_t& aFormat,
|
|
|
|
const uint32_t& aUsage,
|
2012-07-12 12:51:58 +00:00
|
|
|
MaybeMagicGrallocBufferHandle* aOutHandle)
|
|
|
|
{
|
2013-03-16 04:47:02 +00:00
|
|
|
PROFILER_LABEL("GrallocBufferActor", "Create");
|
2012-07-12 12:51:58 +00:00
|
|
|
GrallocBufferActor* actor = new GrallocBufferActor();
|
|
|
|
*aOutHandle = null_t();
|
2013-05-27 14:12:13 +00:00
|
|
|
uint32_t format = aFormat;
|
|
|
|
uint32_t usage = aUsage;
|
|
|
|
|
|
|
|
if (format == 0 || usage == 0) {
|
|
|
|
printf_stderr("GrallocBufferActor::Create -- format and usage must be non-zero");
|
|
|
|
return actor;
|
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer(new GraphicBuffer(aSize.width, aSize.height, format, usage));
|
2012-07-12 12:51:58 +00:00
|
|
|
if (buffer->initCheck() != OK)
|
|
|
|
return actor;
|
|
|
|
|
2013-05-27 14:12:13 +00:00
|
|
|
size_t bpp = BytesPerPixelForPixelFormat(format);
|
2012-11-22 13:39:56 +00:00
|
|
|
actor->mAllocBytes = aSize.width * aSize.height * bpp;
|
2013-01-18 00:45:11 +00:00
|
|
|
GrallocReporter::sAmount += actor->mAllocBytes;
|
2012-11-22 13:39:56 +00:00
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
actor->mGraphicBuffer = buffer;
|
|
|
|
*aOutHandle = MagicGrallocBufferHandle(buffer);
|
2013-05-27 14:12:13 +00:00
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
return actor;
|
|
|
|
}
|
|
|
|
|
2013-09-17 18:48:08 +00:00
|
|
|
// used only for hacky fix for bug 862324
|
2013-04-27 03:31:53 +00:00
|
|
|
void GrallocBufferActor::ActorDestroy(ActorDestroyReason)
|
|
|
|
{
|
2013-09-17 18:48:08 +00:00
|
|
|
for (size_t i = 0; i < mDeprecatedTextureHosts.Length(); i++) {
|
|
|
|
mDeprecatedTextureHosts[i]->ForgetBuffer();
|
2013-04-27 03:31:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-17 18:48:08 +00:00
|
|
|
// used only for hacky fix for bug 862324
|
|
|
|
void GrallocBufferActor::AddDeprecatedTextureHost(DeprecatedTextureHost* aDeprecatedTextureHost)
|
2013-04-27 03:31:53 +00:00
|
|
|
{
|
2013-09-17 18:48:08 +00:00
|
|
|
mDeprecatedTextureHosts.AppendElement(aDeprecatedTextureHost);
|
|
|
|
}
|
|
|
|
|
|
|
|
// used only for hacky fix for bug 862324
|
|
|
|
void GrallocBufferActor::RemoveDeprecatedTextureHost(DeprecatedTextureHost* aDeprecatedTextureHost)
|
|
|
|
{
|
|
|
|
mDeprecatedTextureHosts.RemoveElement(aDeprecatedTextureHost);
|
|
|
|
// that should be the only occurence, otherwise we'd leak this TextureHost...
|
|
|
|
// assert that that's not happening.
|
|
|
|
MOZ_ASSERT(!mDeprecatedTextureHosts.Contains(aDeprecatedTextureHost));
|
2013-04-27 03:31:53 +00:00
|
|
|
}
|
|
|
|
|
2012-07-23 23:58:37 +00:00
|
|
|
/*static*/ already_AddRefed<TextureImage>
|
2013-04-25 22:25:33 +00:00
|
|
|
LayerManagerComposite::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
|
|
|
const SurfaceDescriptor& aDescriptor,
|
|
|
|
GLenum aWrapMode)
|
2012-07-23 23:58:37 +00:00
|
|
|
{
|
2013-04-25 22:25:33 +00:00
|
|
|
PROFILER_LABEL("LayerManagerComposite", "OpenDescriptorForDirectTexturing");
|
2012-07-23 23:58:37 +00:00
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2012-07-23 23:58:37 +00:00
|
|
|
}
|
|
|
|
sp<GraphicBuffer> buffer = GrallocBufferActor::GetFrom(aDescriptor);
|
|
|
|
return aGL->CreateDirectTextureImage(buffer.get(), aWrapMode);
|
|
|
|
}
|
|
|
|
|
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 09:20:52 +00:00
|
|
|
/*static*/ bool
|
2013-04-25 22:25:33 +00:00
|
|
|
LayerManagerComposite::SupportsDirectTexturing()
|
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 09:20:52 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-23 23:58:37 +00:00
|
|
|
/*static*/ void
|
2013-04-25 22:25:33 +00:00
|
|
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
2012-07-23 23:58:37 +00:00
|
|
|
{
|
|
|
|
// Nothing to be done for gralloc.
|
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
bool
|
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 09:20:52 +00:00
|
|
|
ISurfaceAllocator::PlatformDestroySharedSurface(SurfaceDescriptor* aSurface)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aSurface->type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-04-11 23:57:28 +00:00
|
|
|
// we should have either a bufferParent or bufferChild
|
|
|
|
// depending on whether we're on the parent or child side.
|
2012-07-12 12:51:58 +00:00
|
|
|
PGrallocBufferParent* gbp =
|
|
|
|
aSurface->get_SurfaceDescriptorGralloc().bufferParent();
|
2013-04-11 23:57:28 +00:00
|
|
|
if (gbp) {
|
|
|
|
unused << PGrallocBufferParent::Send__delete__(gbp);
|
|
|
|
} else {
|
|
|
|
PGrallocBufferChild* gbc =
|
|
|
|
aSurface->get_SurfaceDescriptorGralloc().bufferChild();
|
|
|
|
unused << PGrallocBufferChild::Send__delete__(gbc);
|
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
*aSurface = SurfaceDescriptor();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Child process
|
|
|
|
|
|
|
|
/*static*/ PGrallocBufferChild*
|
|
|
|
GrallocBufferActor::Create()
|
|
|
|
{
|
|
|
|
return new GrallocBufferActor();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GrallocBufferActor::InitFromHandle(const MagicGrallocBufferHandle& aHandle)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(!mGraphicBuffer.get());
|
|
|
|
MOZ_ASSERT(aHandle.mGraphicBuffer.get());
|
|
|
|
|
|
|
|
mGraphicBuffer = aHandle.mGraphicBuffer;
|
|
|
|
}
|
|
|
|
|
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 09:20:52 +00:00
|
|
|
PGrallocBufferChild*
|
|
|
|
ShadowLayerForwarder::AllocGrallocBuffer(const gfxIntSize& aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
uint32_t aFormat,
|
|
|
|
uint32_t aUsage,
|
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 09:20:52 +00:00
|
|
|
MaybeMagicGrallocBufferHandle* aHandle)
|
|
|
|
{
|
2013-05-27 14:12:13 +00:00
|
|
|
return mShadowManager->SendPGrallocBufferConstructor(aSize, aFormat, aUsage, aHandle);
|
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 09:20:52 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
bool
|
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 09:20:52 +00:00
|
|
|
ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
|
2013-09-24 20:45:13 +00:00
|
|
|
gfxContentType aContent,
|
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 09:20:52 +00:00
|
|
|
uint32_t aCaps,
|
|
|
|
SurfaceDescriptor* aBuffer)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
2013-06-05 20:42:00 +00:00
|
|
|
|
2013-07-17 14:34:52 +00:00
|
|
|
// Check for devices that have problems with gralloc. We only check for
|
|
|
|
// this on ICS or earlier, in hopes that JB will work.
|
2013-06-21 19:33:12 +00:00
|
|
|
#if ANDROID_VERSION <= 15
|
2013-07-17 14:34:52 +00:00
|
|
|
static bool checkedDevice = false;
|
|
|
|
static bool disableGralloc = false;
|
|
|
|
|
|
|
|
if (!checkedDevice) {
|
|
|
|
char propValue[PROPERTY_VALUE_MAX];
|
|
|
|
property_get("ro.product.device", propValue, "None");
|
|
|
|
|
|
|
|
if (strcmp("crespo",propValue) == 0) {
|
|
|
|
NS_WARNING("Nexus S has issues with gralloc, falling back to shmem");
|
|
|
|
disableGralloc = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
checkedDevice = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (disableGralloc) {
|
2013-06-05 20:42:00 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-07-24 15:15:47 +00:00
|
|
|
// Some GL implementations fail to render gralloc textures with
|
|
|
|
// width < 64. There's not much point in gralloc'ing buffers that
|
|
|
|
// small anyway, so fall back on shared memory plus a texture
|
|
|
|
// upload.
|
|
|
|
if (aSize.width < 64) {
|
|
|
|
return false;
|
|
|
|
}
|
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 09:20:52 +00:00
|
|
|
PROFILER_LABEL("ShadowLayerForwarder", "PlatformAllocSurfaceDescriptor");
|
2012-07-12 12:51:58 +00:00
|
|
|
// Gralloc buffers are efficiently mappable as gfxImageSurface, so
|
|
|
|
// no need to check |aCaps & MAP_AS_IMAGE_SURFACE|.
|
|
|
|
MaybeMagicGrallocBufferHandle handle;
|
2013-05-27 14:12:13 +00:00
|
|
|
PGrallocBufferChild* gc;
|
|
|
|
bool defaultRBSwap;
|
|
|
|
|
|
|
|
if (aCaps & USING_GL_RENDERING_ONLY) {
|
2013-07-24 15:15:47 +00:00
|
|
|
gc = AllocGrallocBuffer(aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
PixelFormatForContentType(aContent),
|
|
|
|
GraphicBuffer::USAGE_HW_RENDER |
|
|
|
|
GraphicBuffer::USAGE_HW_TEXTURE,
|
|
|
|
&handle);
|
|
|
|
// If you're allocating for USING_GL_RENDERING_ONLY, then we don't flag
|
|
|
|
// this for RB swap.
|
|
|
|
defaultRBSwap = false;
|
|
|
|
} else {
|
2013-07-24 15:15:47 +00:00
|
|
|
gc = AllocGrallocBuffer(aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
PixelFormatForContentType(aContent),
|
|
|
|
GraphicBuffer::USAGE_SW_READ_OFTEN |
|
|
|
|
GraphicBuffer::USAGE_SW_WRITE_OFTEN |
|
|
|
|
GraphicBuffer::USAGE_HW_TEXTURE,
|
|
|
|
&handle);
|
|
|
|
// But if you're allocating for non-GL-only rendering, we flag for
|
|
|
|
// RB swap to preserve old behaviour and proper interaction with
|
|
|
|
// cairo.
|
|
|
|
defaultRBSwap = true;
|
|
|
|
}
|
|
|
|
|
2013-04-11 11:48:09 +00:00
|
|
|
if (!gc) {
|
|
|
|
NS_ERROR("GrallocBufferConstructor failed by returned null");
|
|
|
|
return false;
|
|
|
|
} else if (handle.Tnull_t == handle.type()) {
|
|
|
|
NS_ERROR("GrallocBufferConstructor failed by returning handle with type Tnull_t");
|
2012-07-12 12:51:58 +00:00
|
|
|
PGrallocBufferChild::Send__delete__(gc);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
GrallocBufferActor* gba = static_cast<GrallocBufferActor*>(gc);
|
|
|
|
gba->InitFromHandle(handle.get_MagicGrallocBufferHandle());
|
|
|
|
|
2013-07-24 15:15:47 +00:00
|
|
|
*aBuffer = SurfaceDescriptorGralloc(nullptr, gc, aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
/* external */ false,
|
|
|
|
defaultRBSwap);
|
2012-07-12 12:51:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Both processes
|
|
|
|
|
|
|
|
/*static*/ sp<GraphicBuffer>
|
|
|
|
GrallocBufferActor::GetFrom(const SurfaceDescriptorGralloc& aDescriptor)
|
|
|
|
{
|
2012-07-30 14:20:58 +00:00
|
|
|
GrallocBufferActor* gba = nullptr;
|
2012-07-12 12:51:58 +00:00
|
|
|
if (PGrallocBufferChild* child = aDescriptor.bufferChild()) {
|
|
|
|
gba = static_cast<GrallocBufferActor*>(child);
|
|
|
|
} else if (PGrallocBufferParent* parent = aDescriptor.bufferParent()) {
|
|
|
|
gba = static_cast<GrallocBufferActor*>(parent);
|
|
|
|
}
|
|
|
|
return gba->mGraphicBuffer;
|
|
|
|
}
|
|
|
|
|
2013-08-09 15:23:46 +00:00
|
|
|
android::GraphicBuffer*
|
|
|
|
GrallocBufferActor::GetGraphicBuffer()
|
|
|
|
{
|
|
|
|
return mGraphicBuffer.get();
|
|
|
|
}
|
2012-07-12 12:51:58 +00:00
|
|
|
|
|
|
|
/*static*/ already_AddRefed<gfxASurface>
|
|
|
|
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
|
|
|
|
const SurfaceDescriptor& aSurface)
|
|
|
|
{
|
2013-03-16 04:47:02 +00:00
|
|
|
PROFILER_LABEL("ShadowLayerForwarder", "PlatformOpenDescriptor");
|
2012-07-12 12:51:58 +00:00
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aSurface.type()) {
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer =
|
|
|
|
GrallocBufferActor::GetFrom(aSurface.get_SurfaceDescriptorGralloc());
|
|
|
|
uint32_t usage = GRALLOC_USAGE_SW_READ_OFTEN;
|
|
|
|
if (OPEN_READ_WRITE == aMode) {
|
|
|
|
usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;
|
|
|
|
}
|
|
|
|
void *vaddr;
|
|
|
|
DebugOnly<status_t> status = buffer->lock(usage, &vaddr);
|
|
|
|
// If we fail to lock, we'll just end up aborting anyway.
|
|
|
|
MOZ_ASSERT(status == OK);
|
|
|
|
|
2013-03-28 13:59:47 +00:00
|
|
|
gfxIntSize size = aSurface.get_SurfaceDescriptorGralloc().size();
|
2012-07-12 12:51:58 +00:00
|
|
|
gfxImageFormat format = ImageFormatForPixelFormat(buffer->getPixelFormat());
|
|
|
|
long pixelStride = buffer->getStride();
|
|
|
|
long byteStride = pixelStride * gfxASurface::BytePerPixelFromFormat(format);
|
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> surf =
|
|
|
|
new gfxImageSurface((unsigned char*)vaddr, size, byteStride, format);
|
2012-07-30 14:20:58 +00:00
|
|
|
return surf->CairoStatus() ? nullptr : surf.forget();
|
2012-07-12 12:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformGetDescriptorSurfaceContentType(
|
|
|
|
const SurfaceDescriptor& aDescriptor, OpenMode aMode,
|
|
|
|
gfxContentType* aContent,
|
|
|
|
gfxASurface** aSurface)
|
|
|
|
{
|
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer =
|
|
|
|
GrallocBufferActor::GetFrom(aDescriptor.get_SurfaceDescriptorGralloc());
|
|
|
|
*aContent = ContentTypeFromPixelFormat(buffer->getPixelFormat());
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformGetDescriptorSurfaceSize(
|
|
|
|
const SurfaceDescriptor& aDescriptor, OpenMode aMode,
|
|
|
|
gfxIntSize* aSize,
|
|
|
|
gfxASurface** aSurface)
|
|
|
|
{
|
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer =
|
|
|
|
GrallocBufferActor::GetFrom(aDescriptor.get_SurfaceDescriptorGralloc());
|
2013-03-28 13:59:47 +00:00
|
|
|
*aSize = aDescriptor.get_SurfaceDescriptorGralloc().size();
|
2012-07-12 12:51:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-08-07 22:38:21 +00:00
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformGetDescriptorSurfaceImageFormat(
|
|
|
|
const SurfaceDescriptor& aDescriptor,
|
|
|
|
OpenMode aMode,
|
|
|
|
gfxImageFormat* aImageFormat,
|
|
|
|
gfxASurface** aSurface)
|
|
|
|
{
|
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
sp<GraphicBuffer> buffer =
|
|
|
|
GrallocBufferActor::GetFrom(aDescriptor.get_SurfaceDescriptorGralloc());
|
|
|
|
*aImageFormat = ImageFormatForPixelFormat(buffer->getPixelFormat());
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformDestroySharedSurface(SurfaceDescriptor* aSurface)
|
|
|
|
{
|
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aSurface->type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
PGrallocBufferChild* gbp =
|
|
|
|
aSurface->get_SurfaceDescriptorGralloc().bufferChild();
|
|
|
|
PGrallocBufferChild::Send__delete__(gbp);
|
|
|
|
*aSurface = SurfaceDescriptor();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ bool
|
|
|
|
ShadowLayerForwarder::PlatformCloseDescriptor(const SurfaceDescriptor& aDescriptor)
|
|
|
|
{
|
2013-03-16 04:47:02 +00:00
|
|
|
PROFILER_LABEL("ShadowLayerForwarder", "PlatformCloseDescriptor");
|
2012-07-12 12:51:58 +00:00
|
|
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-07-23 23:58:37 +00:00
|
|
|
sp<GraphicBuffer> buffer = GrallocBufferActor::GetFrom(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 09:20:52 +00:00
|
|
|
DebugOnly<status_t> status = buffer->unlock();
|
|
|
|
// If we fail to unlock, we'll subsequently fail to lock and end up aborting anyway.
|
|
|
|
MOZ_ASSERT(status == OK);
|
2012-07-12 12:51:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|
|
|
{
|
|
|
|
// Nothing to be done for gralloc.
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|