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 13:20:52 +04: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/. */
|
|
|
|
|
|
|
|
#include "CompositableTransactionParent.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "CompositableHost.h" // for CompositableParent, etc
|
2016-03-22 21:08:38 +03:00
|
|
|
#include "CompositorBridgeParent.h" // for CompositorBridgeParent
|
2014-02-25 08:23:41 +04:00
|
|
|
#include "GLContext.h" // for GLContext
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "Layers.h" // for Layer
|
|
|
|
#include "RenderTrace.h" // for RenderTraceInvalidateEnd, etc
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/ContentHost.h" // for ContentHostBase
|
2014-05-24 20:14:45 +04:00
|
|
|
#include "mozilla/layers/ImageBridgeParent.h" // for ImageBridgeParent
|
2014-05-01 05:52:00 +04:00
|
|
|
#include "mozilla/layers/SharedBufferManagerParent.h"
|
2013-04-26 02:25:33 +04:00
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
|
|
|
|
#include "mozilla/layers/TextureHost.h" // for TextureHost
|
2014-02-25 08:23:41 +04:00
|
|
|
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
2015-07-01 14:51:03 +03:00
|
|
|
#include "mozilla/layers/TiledContentHost.h"
|
2014-09-26 21:06:08 +04:00
|
|
|
#include "mozilla/layers/PaintedLayerComposite.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
2014-05-06 05:56:40 +04:00
|
|
|
#include "mozilla/unused.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "nsDebug.h" // for NS_WARNING, NS_ASSERTION
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2014-03-08 01:34:04 +04:00
|
|
|
class ClientTiledLayerBuffer;
|
2013-08-12 03:17:23 +04:00
|
|
|
class Compositor;
|
|
|
|
|
2013-11-13 16:25:50 +04:00
|
|
|
// This function can in some cases fail and return false without it being a bug.
|
|
|
|
// This can theoretically happen if the ImageBridge sends frames before
|
|
|
|
// we created the layer tree. Since we can't enforce that the layer
|
|
|
|
// tree is already created before ImageBridge operates, there isn't much
|
|
|
|
// we can do about it, but in practice it is very rare.
|
|
|
|
// Typically when a tab with a video is dragged from a window to another,
|
|
|
|
// there can be a short time when the video is still sending frames
|
|
|
|
// asynchonously while the layer tree is not reconstructed. It's not a
|
|
|
|
// big deal.
|
|
|
|
// Note that Layers transactions do not need to call this because they always
|
|
|
|
// schedule the composition, in LayerManagerComposite::EndTransaction.
|
2016-03-25 11:35:16 +03:00
|
|
|
static bool
|
|
|
|
ScheduleComposition(CompositableHost* aCompositable)
|
2013-07-30 13:59:51 +04:00
|
|
|
{
|
2016-03-25 11:35:16 +03:00
|
|
|
uint64_t id = aCompositable->GetCompositorID();
|
|
|
|
if (!id) {
|
2013-07-30 13:59:51 +04:00
|
|
|
return false;
|
|
|
|
}
|
2016-03-22 21:08:38 +03:00
|
|
|
CompositorBridgeParent* cp = CompositorBridgeParent::GetCompositor(id);
|
2013-07-30 13:59:51 +04:00
|
|
|
if (!cp) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
cp->ScheduleComposition();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-04 01:52:42 +03:00
|
|
|
#if defined(DEBUG) || defined(MOZ_WIDGET_GONK)
|
|
|
|
static bool ValidatePictureRect(const mozilla::gfx::IntSize& aSize,
|
|
|
|
const nsIntRect& aPictureRect)
|
|
|
|
{
|
|
|
|
return nsIntRect(0, 0, aSize.width, aSize.height).Contains(aPictureRect) &&
|
|
|
|
!aPictureRect.IsEmpty();
|
|
|
|
}
|
|
|
|
#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 13:20:52 +04:00
|
|
|
bool
|
|
|
|
CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation& aEdit,
|
|
|
|
EditReplyVector& replyv)
|
|
|
|
{
|
2016-03-25 11:38:55 +03:00
|
|
|
// Ignore all operations on compositables created on stale compositors. We
|
|
|
|
// return true because the child is unable to handle errors.
|
2016-03-25 11:35:16 +03:00
|
|
|
CompositableHost* compositable = CompositableHost::FromIPDLActor(aEdit.compositableParent());
|
2016-03-25 11:38:55 +03:00
|
|
|
if (compositable->GetCompositor() && compositable->GetCompositor()->IsValid()) {
|
|
|
|
return true;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
|
|
|
|
switch (aEdit.detail().type()) {
|
|
|
|
case CompositableOperationDetail::TOpPaintTextureRegion: {
|
2014-09-26 21:06:08 +04:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Paint PaintedLayer"));
|
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 13:20:52 +04:00
|
|
|
|
2016-03-25 11:35:16 +03:00
|
|
|
const OpPaintTextureRegion& op = aEdit.detail().get_OpPaintTextureRegion();
|
2014-02-21 00:05:48 +04:00
|
|
|
Layer* layer = compositable->GetLayer();
|
2014-09-26 21:07:06 +04:00
|
|
|
if (!layer || layer->GetType() != Layer::TYPE_PAINTED) {
|
2014-02-21 00:05:48 +04:00
|
|
|
return false;
|
|
|
|
}
|
2014-09-26 21:06:08 +04:00
|
|
|
PaintedLayerComposite* thebes = static_cast<PaintedLayerComposite*>(layer);
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
const ThebesBufferData& bufferData = op.bufferData();
|
|
|
|
|
|
|
|
RenderTraceInvalidateStart(thebes, "FF00FF", op.updatedRegion().GetBounds());
|
|
|
|
|
|
|
|
nsIntRegion frontUpdatedRegion;
|
2014-02-20 17:05:32 +04:00
|
|
|
if (!compositable->UpdateThebes(bufferData,
|
|
|
|
op.updatedRegion(),
|
|
|
|
thebes->GetValidRegion(),
|
|
|
|
&frontUpdatedRegion))
|
|
|
|
{
|
|
|
|
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 13:20:52 +04:00
|
|
|
replyv.push_back(
|
2016-03-25 11:35:16 +03:00
|
|
|
OpContentBufferSwap(aEdit.compositableParent(), nullptr, frontUpdatedRegion));
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
RenderTraceInvalidateEnd(thebes, "FF00FF");
|
|
|
|
break;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpUseTiledLayerBuffer: {
|
2013-04-17 01:36:06 +04:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer"));
|
2016-03-25 11:35:16 +03:00
|
|
|
const OpUseTiledLayerBuffer& op = aEdit.detail().get_OpUseTiledLayerBuffer();
|
|
|
|
TiledContentHost* tiledHost = compositable->AsTiledContentHost();
|
2013-04-17 01:36:06 +04:00
|
|
|
|
2016-03-25 11:35:16 +03:00
|
|
|
NS_ASSERTION(tiledHost, "The compositable is not tiled");
|
2013-04-17 01:36:06 +04:00
|
|
|
|
2013-08-19 17:59:22 +04:00
|
|
|
const SurfaceDescriptorTiles& tileDesc = op.tileLayerDescriptor();
|
2016-03-25 11:35:16 +03:00
|
|
|
bool success = tiledHost->UseTiledLayerBuffer(this, tileDesc);
|
2014-09-30 20:30:23 +04:00
|
|
|
if (!success) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-04-17 01:36:06 +04:00
|
|
|
break;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpRemoveTexture: {
|
|
|
|
const OpRemoveTexture& op = aEdit.detail().get_OpRemoveTexture();
|
2016-03-25 11:38:55 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TextureHost> tex = TextureHost::AsTextureHost(op.textureParent());
|
2014-02-11 00:52:35 +04:00
|
|
|
|
|
|
|
MOZ_ASSERT(tex.get());
|
|
|
|
compositable->RemoveTextureHost(tex);
|
2014-05-24 20:14:45 +04:00
|
|
|
// send FenceHandle if present.
|
2016-03-08 06:16:40 +03:00
|
|
|
SendFenceHandleIfPresent(op.textureParent());
|
2014-02-11 00:52:35 +04:00
|
|
|
break;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpRemoveTextureAsync: {
|
|
|
|
const OpRemoveTextureAsync& op = aEdit.detail().get_OpRemoveTextureAsync();
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TextureHost> tex = TextureHost::AsTextureHost(op.textureParent());
|
2014-05-12 18:39:25 +04:00
|
|
|
|
|
|
|
MOZ_ASSERT(tex.get());
|
|
|
|
compositable->RemoveTextureHost(tex);
|
|
|
|
|
2016-03-17 16:58:58 +03:00
|
|
|
if (!UsesImageBridge() && ImageBridgeParent::GetInstance(GetChildProcessId())) {
|
2014-05-24 20:14:45 +04:00
|
|
|
// send FenceHandle if present via ImageBridge.
|
2015-04-10 03:21:00 +03:00
|
|
|
ImageBridgeParent::AppendDeliverFenceMessage(
|
2014-05-24 20:14:45 +04:00
|
|
|
GetChildProcessId(),
|
|
|
|
op.holderId(),
|
|
|
|
op.transactionId(),
|
2016-03-08 06:16:40 +03:00
|
|
|
op.textureParent());
|
2014-05-24 20:14:45 +04:00
|
|
|
|
|
|
|
// If the message is recievied via PLayerTransaction,
|
|
|
|
// Send message back via PImageBridge.
|
|
|
|
ImageBridgeParent::ReplyRemoveTexture(
|
|
|
|
GetChildProcessId(),
|
2015-04-10 03:19:00 +03:00
|
|
|
OpReplyRemoveTexture(op.holderId(),
|
2014-05-24 20:14:45 +04:00
|
|
|
op.transactionId()));
|
|
|
|
} else {
|
|
|
|
// send FenceHandle if present.
|
2016-03-08 06:16:40 +03:00
|
|
|
SendFenceHandleIfPresent(op.textureParent());
|
2014-05-24 20:14:45 +04:00
|
|
|
|
2015-04-10 03:19:00 +03:00
|
|
|
ReplyRemoveTexture(OpReplyRemoveTexture(op.holderId(),
|
2014-05-24 20:14:45 +04:00
|
|
|
op.transactionId()));
|
|
|
|
}
|
2014-05-12 18:39:25 +04:00
|
|
|
break;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpUseTexture: {
|
|
|
|
const OpUseTexture& op = aEdit.detail().get_OpUseTexture();
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2016-02-02 18:36:30 +03:00
|
|
|
AutoTArray<CompositableHost::TimedTexture,4> textures;
|
2015-05-04 13:59:02 +03:00
|
|
|
for (auto& timedTexture : op.textures()) {
|
|
|
|
CompositableHost::TimedTexture* t = textures.AppendElement();
|
|
|
|
t->mTexture =
|
|
|
|
TextureHost::AsTextureHost(timedTexture.textureParent());
|
|
|
|
MOZ_ASSERT(t->mTexture);
|
|
|
|
t->mTimeStamp = timedTexture.timeStamp();
|
|
|
|
t->mPictureRect = timedTexture.picture();
|
2015-07-06 06:02:26 +03:00
|
|
|
t->mFrameID = timedTexture.frameID();
|
|
|
|
t->mProducerID = timedTexture.producerID();
|
2016-01-09 05:50:10 +03:00
|
|
|
t->mInputFrameID = timedTexture.inputFrameID();
|
2015-05-04 13:59:02 +03:00
|
|
|
MOZ_ASSERT(ValidatePictureRect(t->mTexture->GetSize(), t->mPictureRect));
|
|
|
|
|
|
|
|
MaybeFence maybeFence = timedTexture.fence();
|
|
|
|
if (maybeFence.type() == MaybeFence::TFenceHandle) {
|
|
|
|
FenceHandle fence = maybeFence.get_FenceHandle();
|
|
|
|
if (fence.IsValid()) {
|
|
|
|
t->mTexture->SetAcquireFenceHandle(fence);
|
|
|
|
}
|
2015-04-10 03:19:00 +03:00
|
|
|
}
|
|
|
|
}
|
2016-03-25 11:38:55 +03:00
|
|
|
if (textures.Length() > 0) {
|
|
|
|
compositable->UseTextureHost(textures);
|
|
|
|
}
|
2015-04-10 03:19:00 +03:00
|
|
|
|
2016-03-17 16:58:58 +03:00
|
|
|
if (UsesImageBridge() && compositable->GetLayer()) {
|
2016-03-25 11:35:16 +03:00
|
|
|
ScheduleComposition(compositable);
|
2013-07-30 13:59:51 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpUseComponentAlphaTextures: {
|
|
|
|
const OpUseComponentAlphaTextures& op = aEdit.detail().get_OpUseComponentAlphaTextures();
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TextureHost> texOnBlack = TextureHost::AsTextureHost(op.textureOnBlackParent());
|
|
|
|
RefPtr<TextureHost> texOnWhite = TextureHost::AsTextureHost(op.textureOnWhiteParent());
|
2014-02-06 15:28:29 +04:00
|
|
|
|
|
|
|
MOZ_ASSERT(texOnBlack && texOnWhite);
|
|
|
|
compositable->UseComponentAlphaTextures(texOnBlack, texOnWhite);
|
|
|
|
|
2016-03-17 16:58:58 +03:00
|
|
|
if (UsesImageBridge()) {
|
2016-03-25 11:35:16 +03:00
|
|
|
ScheduleComposition(compositable);
|
2014-02-06 15:28:29 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2014-08-19 06:14:00 +04:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2016-03-25 11:35:16 +03:00
|
|
|
case CompositableOperationDetail::TOpUseOverlaySource: {
|
|
|
|
const OpUseOverlaySource& op = aEdit.detail().get_OpUseOverlaySource();
|
2015-07-04 01:52:42 +03:00
|
|
|
if (!ValidatePictureRect(op.overlay().size(), op.picture())) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
compositable->UseOverlaySource(op.overlay(), op.picture());
|
2014-08-19 06:14:00 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#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 13:20:52 +04:00
|
|
|
default: {
|
|
|
|
MOZ_ASSERT(false, "bad type");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-07 13:17:40 +03:00
|
|
|
void
|
|
|
|
CompositableParentManager::DestroyActor(const OpDestroy& aOp)
|
|
|
|
{
|
|
|
|
switch (aOp.type()) {
|
|
|
|
case OpDestroy::TPTextureParent: {
|
|
|
|
auto actor = aOp.get_PTextureParent();
|
|
|
|
TextureHost::ReceivedDestroy(actor);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OpDestroy::TPCompositableParent: {
|
|
|
|
auto actor = aOp.get_PCompositableParent();
|
|
|
|
CompositableHost::ReceivedDestroy(actor);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
MOZ_ASSERT(false, "unsupported type");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-07 02:45:03 +04:00
|
|
|
void
|
2015-04-10 03:21:00 +03:00
|
|
|
CompositableParentManager::SendPendingAsyncMessages()
|
2014-10-07 02:45:03 +04:00
|
|
|
{
|
|
|
|
if (mPendingAsyncMessage.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Some type of AsyncParentMessageData message could have
|
|
|
|
// one file descriptor (e.g. OpDeliverFence).
|
|
|
|
// A number of file descriptors per gecko ipc message have a limitation
|
|
|
|
// on OS_POSIX (MACOSX or LINUX).
|
|
|
|
#if defined(OS_POSIX)
|
|
|
|
static const uint32_t kMaxMessageNumber = FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE;
|
|
|
|
#else
|
|
|
|
// default number that works everywhere else
|
|
|
|
static const uint32_t kMaxMessageNumber = 250;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
InfallibleTArray<AsyncParentMessageData> messages;
|
|
|
|
messages.SetCapacity(mPendingAsyncMessage.size());
|
|
|
|
for (size_t i = 0; i < mPendingAsyncMessage.size(); i++) {
|
|
|
|
messages.AppendElement(mPendingAsyncMessage[i]);
|
|
|
|
// Limit maximum number of messages.
|
|
|
|
if (messages.Length() >= kMaxMessageNumber) {
|
|
|
|
SendAsyncMessage(messages);
|
|
|
|
// Initialize Messages.
|
|
|
|
messages.Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (messages.Length() > 0) {
|
|
|
|
SendAsyncMessage(messages);
|
|
|
|
}
|
|
|
|
mPendingAsyncMessage.clear();
|
|
|
|
}
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
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 13:20:52 +04:00
|
|
|
|