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
|
|
|
/* -*- 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 "mozilla/layers/CompositableClient.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include <stdint.h> // for uint64_t, uint32_t
|
|
|
|
#include "gfxPlatform.h" // for gfxPlatform
|
2013-08-12 02:21:17 +00:00
|
|
|
#include "mozilla/layers/CompositableForwarder.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/TextureClient.h" // for DeprecatedTextureClient, etc
|
|
|
|
#include "mozilla/layers/TextureClientOGL.h"
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete, etc
|
2013-09-24 01:14:12 +00:00
|
|
|
#include "gfxASurface.h" // for gfxContentType
|
2013-05-03 17:34:29 +00:00
|
|
|
#ifdef XP_WIN
|
2013-08-04 07:46:17 +00:00
|
|
|
#include "mozilla/layers/TextureD3D9.h"
|
2013-05-03 17:34:29 +00:00
|
|
|
#include "mozilla/layers/TextureD3D11.h"
|
|
|
|
#include "gfxWindowsPlatform.h"
|
2013-12-05 18:39:22 +00:00
|
|
|
#include "gfx2DGlue.h"
|
2013-05-03 17:34:29 +00:00
|
|
|
#endif
|
2014-02-05 16:39:02 +00:00
|
|
|
#ifdef MOZ_X11
|
|
|
|
#include "mozilla/layers/TextureClientX11.h"
|
|
|
|
#endif
|
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
|
|
|
|
2013-12-05 18:39:22 +00:00
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
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
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
CompositableClient::CompositableClient(CompositableForwarder* aForwarder)
|
2013-12-12 01:44:47 +00:00
|
|
|
: mCompositableChild(nullptr)
|
2013-07-30 09:59:51 +00:00
|
|
|
, mForwarder(aForwarder)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(CompositableClient);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
CompositableClient::~CompositableClient()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(CompositableClient);
|
|
|
|
Destroy();
|
2013-09-12 14:50:35 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
LayersBackend
|
|
|
|
CompositableClient::GetCompositorBackendType() const
|
|
|
|
{
|
|
|
|
return mForwarder->GetCompositorBackendType();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositableClient::SetIPDLActor(CompositableChild* aChild)
|
|
|
|
{
|
|
|
|
mCompositableChild = aChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
CompositableChild*
|
|
|
|
CompositableClient::GetIPDLActor() const
|
|
|
|
{
|
|
|
|
return mCompositableChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
CompositableClient::Connect()
|
|
|
|
{
|
|
|
|
if (!GetForwarder() || GetIPDLActor()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
GetForwarder()->Connect(this);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositableClient::Destroy()
|
|
|
|
{
|
|
|
|
if (!mCompositableChild) {
|
|
|
|
return;
|
|
|
|
}
|
2013-09-27 09:48:42 +00:00
|
|
|
mCompositableChild->SetClient(nullptr);
|
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
|
|
|
mCompositableChild->Destroy();
|
|
|
|
mCompositableChild = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t
|
|
|
|
CompositableClient::GetAsyncID() const
|
|
|
|
{
|
|
|
|
if (mCompositableChild) {
|
|
|
|
return mCompositableChild->GetAsyncID();
|
|
|
|
}
|
|
|
|
return 0; // zero is always an invalid async ID
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositableChild::Destroy()
|
|
|
|
{
|
|
|
|
Send__delete__(this);
|
|
|
|
}
|
|
|
|
|
2013-07-08 21:30:44 +00:00
|
|
|
TemporaryRef<DeprecatedTextureClient>
|
2013-09-24 01:14:12 +00:00
|
|
|
CompositableClient::CreateDeprecatedTextureClient(DeprecatedTextureClientType aDeprecatedTextureClientType,
|
2013-09-24 20:45:13 +00:00
|
|
|
gfxContentType aContentType)
|
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
|
|
|
{
|
|
|
|
MOZ_ASSERT(GetForwarder(), "Can't create a texture client if the compositable is not connected to the compositor.");
|
|
|
|
LayersBackend parentBackend = GetForwarder()->GetCompositorBackendType();
|
2013-07-08 21:30:44 +00:00
|
|
|
RefPtr<DeprecatedTextureClient> result;
|
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
|
|
|
|
2013-07-08 21:30:44 +00:00
|
|
|
switch (aDeprecatedTextureClientType) {
|
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
|
|
|
case TEXTURE_SHARED_GL:
|
|
|
|
case TEXTURE_SHARED_GL_EXTERNAL:
|
|
|
|
case TEXTURE_STREAM_GL:
|
2014-02-04 20:47:20 +00:00
|
|
|
MOZ_CRASH("Unsupported. this should not be reached");
|
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
|
|
|
case TEXTURE_YCBCR:
|
2014-02-04 20:47:20 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D9 ||
|
2014-01-23 18:26:41 +00:00
|
|
|
parentBackend == LayersBackend::LAYERS_D3D11 ||
|
|
|
|
parentBackend == LayersBackend::LAYERS_BASIC) {
|
2013-07-08 21:30:44 +00:00
|
|
|
result = new DeprecatedTextureClientShmemYCbCr(GetForwarder(), GetTextureInfo());
|
2014-02-04 20:47:20 +00:00
|
|
|
} else {
|
|
|
|
MOZ_CRASH("Unsupported. this should not be reached");
|
2013-05-01 00:42:05 +00:00
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
case TEXTURE_CONTENT:
|
2013-05-03 17:34:29 +00:00
|
|
|
#ifdef XP_WIN
|
2014-01-23 18:26:41 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D11 && gfxWindowsPlatform::GetPlatform()->GetD2DDevice()) {
|
2013-07-08 21:30:44 +00:00
|
|
|
result = new DeprecatedTextureClientD3D11(GetForwarder(), GetTextureInfo());
|
2013-05-03 17:34:29 +00:00
|
|
|
break;
|
|
|
|
}
|
2014-01-23 18:26:41 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D9 &&
|
2013-08-04 07:46:17 +00:00
|
|
|
!GetForwarder()->ForwardsToDifferentProcess()) {
|
2013-11-21 22:07:57 +00:00
|
|
|
// We can't use a d3d9 texture for an RGBA surface because we cannot get a DC for
|
|
|
|
// for a gfxWindowsSurface.
|
|
|
|
// We have to wait for the compositor thread to create a d3d9 device before we
|
|
|
|
// can create d3d9 textures on the main thread (because we need to reset on the
|
|
|
|
// compositor thread, and the d3d9 device must be reset on the same thread it was
|
|
|
|
// created on).
|
2014-01-23 18:26:40 +00:00
|
|
|
if (aContentType == gfxContentType::COLOR_ALPHA ||
|
2013-11-21 22:07:57 +00:00
|
|
|
!gfxWindowsPlatform::GetPlatform()->GetD3D9Device()) {
|
2013-09-24 01:14:12 +00:00
|
|
|
result = new DeprecatedTextureClientDIB(GetForwarder(), GetTextureInfo());
|
|
|
|
} else {
|
|
|
|
result = new DeprecatedTextureClientD3D9(GetForwarder(), GetTextureInfo());
|
|
|
|
}
|
2013-08-04 07:46:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-05-03 17:34:29 +00:00
|
|
|
#endif
|
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
|
|
|
// fall through to TEXTURE_SHMEM
|
|
|
|
case TEXTURE_SHMEM:
|
2013-07-08 21:30:44 +00:00
|
|
|
result = new DeprecatedTextureClientShmem(GetForwarder(), GetTextureInfo());
|
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
|
|
|
break;
|
2013-08-04 07:46:17 +00:00
|
|
|
case TEXTURE_FALLBACK:
|
|
|
|
#ifdef XP_WIN
|
2014-01-23 18:26:41 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D11 ||
|
|
|
|
parentBackend == LayersBackend::LAYERS_D3D9) {
|
2013-08-04 07:46:17 +00:00
|
|
|
result = new DeprecatedTextureClientShmem(GetForwarder(), GetTextureInfo());
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
break;
|
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
|
|
|
default:
|
|
|
|
MOZ_ASSERT(false, "Unhandled texture client type");
|
|
|
|
}
|
|
|
|
|
2013-05-01 00:42:05 +00:00
|
|
|
// If we couldn't create an appropriate texture client,
|
|
|
|
// then return nullptr so the caller can chose another
|
|
|
|
// type.
|
|
|
|
if (!result) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2013-07-08 21:30:44 +00:00
|
|
|
MOZ_ASSERT(result->SupportsType(aDeprecatedTextureClientType),
|
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
|
|
|
"Created the wrong texture client?");
|
2013-04-12 07:28:55 +00:00
|
|
|
result->SetFlags(GetTextureInfo().mTextureFlags);
|
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 result.forget();
|
|
|
|
}
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
TemporaryRef<BufferTextureClient>
|
2013-12-05 18:39:22 +00:00
|
|
|
CompositableClient::CreateBufferTextureClient(SurfaceFormat aFormat,
|
|
|
|
TextureFlags aTextureFlags)
|
2013-07-30 09:59:51 +00:00
|
|
|
{
|
2013-08-28 13:21:13 +00:00
|
|
|
// XXX - Once bug 908196 is fixed, we can use gralloc textures here which will
|
|
|
|
// improve performances of videos using SharedPlanarYCbCrImage on b2g.
|
|
|
|
//#ifdef MOZ_WIDGET_GONK
|
|
|
|
// {
|
|
|
|
// RefPtr<BufferTextureClient> result = new GrallocTextureClientOGL(this,
|
|
|
|
// aFormat,
|
|
|
|
// aTextureFlags);
|
|
|
|
// return result.forget();
|
|
|
|
// }
|
|
|
|
//#endif
|
2013-07-30 09:59:51 +00:00
|
|
|
if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) {
|
2013-08-03 17:30:28 +00:00
|
|
|
RefPtr<BufferTextureClient> result = new MemoryTextureClient(this, aFormat, aTextureFlags);
|
2013-07-30 09:59:51 +00:00
|
|
|
return result.forget();
|
|
|
|
}
|
2013-08-03 17:30:28 +00:00
|
|
|
RefPtr<BufferTextureClient> result = new ShmemTextureClient(this, aFormat, aTextureFlags);
|
2013-07-30 09:59:51 +00:00
|
|
|
return result.forget();
|
|
|
|
}
|
|
|
|
|
2013-12-05 18:39:22 +00:00
|
|
|
TemporaryRef<TextureClient>
|
|
|
|
CompositableClient::CreateTextureClientForDrawing(SurfaceFormat aFormat,
|
|
|
|
TextureFlags aTextureFlags)
|
|
|
|
{
|
|
|
|
RefPtr<TextureClient> result;
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
LayersBackend parentBackend = GetForwarder()->GetCompositorBackendType();
|
2014-01-23 18:26:41 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D11 && gfxWindowsPlatform::GetPlatform()->GetD2DDevice() &&
|
2013-12-05 18:39:22 +00:00
|
|
|
!(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
|
2014-01-07 16:20:11 +00:00
|
|
|
result = new TextureClientD3D11(aFormat, aTextureFlags);
|
2013-12-05 18:39:22 +00:00
|
|
|
}
|
2014-01-23 18:26:41 +00:00
|
|
|
if (parentBackend == LayersBackend::LAYERS_D3D9 &&
|
2013-12-05 18:39:22 +00:00
|
|
|
!GetForwarder()->ForwardsToDifferentProcess() &&
|
|
|
|
!(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
|
|
|
|
// non-DIB textures don't work with alpha, see notes in TextureD3D9.
|
2014-01-23 18:26:40 +00:00
|
|
|
if (ContentForFormat(aFormat) != gfxContentType::COLOR) {
|
2014-01-07 16:20:40 +00:00
|
|
|
result = new DIBTextureClientD3D9(aFormat, aTextureFlags);
|
2013-12-05 18:39:22 +00:00
|
|
|
} else {
|
2014-01-07 16:20:40 +00:00
|
|
|
result = new CairoTextureClientD3D9(aFormat, aTextureFlags);
|
2013-12-05 18:39:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2014-02-05 16:39:02 +00:00
|
|
|
|
|
|
|
#ifdef MOZ_X11
|
|
|
|
LayersBackend parentBackend = GetForwarder()->GetCompositorBackendType();
|
|
|
|
if (parentBackend == LayersBackend::LAYERS_BASIC &&
|
|
|
|
gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType() == gfxSurfaceType::Xlib &&
|
|
|
|
!(aTextureFlags & TEXTURE_ALLOC_FALLBACK))
|
|
|
|
{
|
|
|
|
result = new TextureClientX11(aFormat, aTextureFlags);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-12-05 18:39:22 +00:00
|
|
|
// Can't do any better than a buffer texture client.
|
|
|
|
if (!result) {
|
|
|
|
result = CreateBufferTextureClient(aFormat, aTextureFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(!result || result->AsTextureClientDrawTarget(),
|
|
|
|
"Not a TextureClientDrawTarget?");
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
CompositableClient::AddTextureClient(TextureClient* aClient)
|
|
|
|
{
|
2013-12-12 01:44:44 +00:00
|
|
|
return aClient->InitIPDLActor(mForwarder);
|
2013-12-11 19:52:50 +00:00
|
|
|
}
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
void
|
|
|
|
CompositableClient::OnTransaction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|