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: 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-11 23:17:23 +00:00
|
|
|
#include "CompositableHost.h" // for CompositableParent, etc
|
|
|
|
#include "CompositorParent.h" // for CompositorParent
|
2014-02-25 04:23:41 +00:00
|
|
|
#include "GLContext.h" // for GLContext
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "Layers.h" // for Layer
|
|
|
|
#include "RenderTrace.h" // for RenderTraceInvalidateEnd, etc
|
|
|
|
#include "TiledLayerBuffer.h" // for TiledLayerComposer
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/ContentHost.h" // for ContentHostBase
|
2013-04-25 22:25:33 +00:00
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
2013-08-11 23:17:23 +00: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 04:23:41 +00:00
|
|
|
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
2013-04-25 22:25:33 +00:00
|
|
|
#include "mozilla/layers/ThebesLayerComposite.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#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 09:20:52 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2014-03-07 21:34:04 +00:00
|
|
|
class ClientTiledLayerBuffer;
|
2013-08-11 23:17:23 +00:00
|
|
|
class Compositor;
|
|
|
|
|
2014-04-25 15:15:58 +00:00
|
|
|
template<typename Op>
|
|
|
|
CompositableHost* AsCompositable(const Op& op)
|
2013-07-30 09:59:51 +00:00
|
|
|
{
|
2014-04-25 15:15:58 +00:00
|
|
|
return CompositableHost::FromIPDLActor(op.compositableParent());
|
2013-07-30 09:59:51 +00:00
|
|
|
}
|
|
|
|
|
2013-11-13 12:25:50 +00: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.
|
2013-07-30 09:59:51 +00:00
|
|
|
template<typename T>
|
|
|
|
bool ScheduleComposition(const T& op)
|
|
|
|
{
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* comp = AsCompositable(op);
|
|
|
|
uint64_t id = comp->GetCompositorID();
|
|
|
|
if (!comp || !id) {
|
2013-07-30 09:59:51 +00:00
|
|
|
return false;
|
|
|
|
}
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositorParent* cp = CompositorParent::GetCompositor(id);
|
2013-07-30 09:59:51 +00:00
|
|
|
if (!cp) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
cp->ScheduleComposition();
|
|
|
|
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 09:20:52 +00:00
|
|
|
bool
|
|
|
|
CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation& aEdit,
|
|
|
|
EditReplyVector& replyv)
|
|
|
|
{
|
|
|
|
switch (aEdit.type()) {
|
2013-05-16 03:45:43 +00:00
|
|
|
case CompositableOperation::TOpCreatedIncrementalTexture: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Created texture"));
|
|
|
|
const OpCreatedIncrementalTexture& op = aEdit.get_OpCreatedIncrementalTexture();
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
2013-05-16 03:45:43 +00:00
|
|
|
|
2014-04-23 14:46:02 +00:00
|
|
|
bool success =
|
2014-04-25 15:15:58 +00:00
|
|
|
compositable->CreatedIncrementalTexture(this,
|
2014-04-23 14:46:02 +00:00
|
|
|
op.textureInfo(),
|
|
|
|
op.bufferRect());
|
|
|
|
if (!success) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-05-16 03:45:43 +00:00
|
|
|
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
|
|
|
case CompositableOperation::TOpPaintTextureRegion: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
|
|
|
|
|
|
|
const OpPaintTextureRegion& op = aEdit.get_OpPaintTextureRegion();
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
2014-02-20 20:05:48 +00:00
|
|
|
Layer* layer = compositable->GetLayer();
|
|
|
|
if (!layer || layer->GetType() != Layer::TYPE_THEBES) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
ThebesLayerComposite* thebes = static_cast<ThebesLayerComposite*>(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 09:20:52 +00:00
|
|
|
|
|
|
|
const ThebesBufferData& bufferData = op.bufferData();
|
|
|
|
|
|
|
|
RenderTraceInvalidateStart(thebes, "FF00FF", op.updatedRegion().GetBounds());
|
|
|
|
|
|
|
|
nsIntRegion frontUpdatedRegion;
|
2014-02-20 13:05:32 +00: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 09:20:52 +00:00
|
|
|
replyv.push_back(
|
2014-04-25 15:15:58 +00:00
|
|
|
OpContentBufferSwap(op.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 09:20:52 +00:00
|
|
|
|
|
|
|
RenderTraceInvalidateEnd(thebes, "FF00FF");
|
2014-02-25 04:23:41 +00:00
|
|
|
// return texure data to client if necessary
|
|
|
|
ReturnTextureDataIfNecessary(compositable, replyv, op.compositableParent());
|
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-05-16 03:45:43 +00:00
|
|
|
case CompositableOperation::TOpPaintTextureIncremental: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
|
|
|
|
|
|
|
const OpPaintTextureIncremental& op = aEdit.get_OpPaintTextureIncremental();
|
|
|
|
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
2013-05-16 03:45:43 +00:00
|
|
|
|
|
|
|
SurfaceDescriptor desc = op.image();
|
|
|
|
|
|
|
|
compositable->UpdateIncremental(op.textureId(),
|
|
|
|
desc,
|
|
|
|
op.updatedRegion(),
|
|
|
|
op.bufferRect(),
|
|
|
|
op.bufferRotation());
|
|
|
|
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
|
|
|
case CompositableOperation::TOpUpdatePictureRect: {
|
|
|
|
const OpUpdatePictureRect& op = aEdit.get_OpUpdatePictureRect();
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
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(compositable);
|
|
|
|
compositable->SetPictureRect(op.picture());
|
|
|
|
break;
|
|
|
|
}
|
2014-03-07 21:34:04 +00:00
|
|
|
case CompositableOperation::TOpUseTiledLayerBuffer: {
|
2013-04-16 21:36:06 +00:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer"));
|
2014-03-07 21:34:04 +00:00
|
|
|
const OpUseTiledLayerBuffer& op = aEdit.get_OpUseTiledLayerBuffer();
|
2014-04-25 15:15:58 +00:00
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
2013-04-16 21:36:06 +00:00
|
|
|
|
|
|
|
TiledLayerComposer* tileComposer = compositable->AsTiledLayerComposer();
|
|
|
|
NS_ASSERTION(tileComposer, "compositable is not a tile composer");
|
|
|
|
|
2013-08-19 13:59:22 +00:00
|
|
|
const SurfaceDescriptorTiles& tileDesc = op.tileLayerDescriptor();
|
2014-03-07 21:34:04 +00:00
|
|
|
tileComposer->UseTiledLayerBuffer(this, tileDesc);
|
2013-04-16 21:36:06 +00:00
|
|
|
break;
|
|
|
|
}
|
2014-02-10 20:52:35 +00:00
|
|
|
case CompositableOperation::TOpRemoveTexture: {
|
|
|
|
const OpRemoveTexture& op = aEdit.get_OpRemoveTexture();
|
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
|
|
|
RefPtr<TextureHost> tex = TextureHost::AsTextureHost(op.textureParent());
|
|
|
|
|
|
|
|
MOZ_ASSERT(tex.get());
|
|
|
|
compositable->RemoveTextureHost(tex);
|
2014-02-25 04:23:41 +00:00
|
|
|
// return texure data to client if necessary
|
|
|
|
ReturnTextureDataIfNecessary(compositable, replyv, op.compositableParent());
|
2014-02-10 20:52:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-07-30 09:59:51 +00:00
|
|
|
case CompositableOperation::TOpUseTexture: {
|
|
|
|
const OpUseTexture& op = aEdit.get_OpUseTexture();
|
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
2013-12-12 01:44:44 +00:00
|
|
|
RefPtr<TextureHost> tex = TextureHost::AsTextureHost(op.textureParent());
|
2013-07-30 09:59:51 +00:00
|
|
|
|
|
|
|
MOZ_ASSERT(tex.get());
|
|
|
|
compositable->UseTextureHost(tex);
|
|
|
|
|
2013-11-13 12:25:50 +00:00
|
|
|
if (IsAsync()) {
|
|
|
|
ScheduleComposition(op);
|
2014-02-10 02:24:28 +00:00
|
|
|
// Async layer updates don't trigger invalidation, manually tell the layer
|
|
|
|
// that its content have changed.
|
|
|
|
if (compositable->GetLayer()) {
|
|
|
|
compositable->GetLayer()->SetInvalidRectToVisibleRegion();
|
|
|
|
}
|
2013-07-30 09:59:51 +00:00
|
|
|
}
|
2014-02-25 04:23:41 +00:00
|
|
|
// return texure data to client if necessary
|
|
|
|
ReturnTextureDataIfNecessary(compositable, replyv, op.compositableParent());
|
2013-07-30 09:59:51 +00:00
|
|
|
break;
|
|
|
|
}
|
2014-02-06 11:28:29 +00:00
|
|
|
case CompositableOperation::TOpUseComponentAlphaTextures: {
|
|
|
|
const OpUseComponentAlphaTextures& op = aEdit.get_OpUseComponentAlphaTextures();
|
|
|
|
CompositableHost* compositable = AsCompositable(op);
|
|
|
|
RefPtr<TextureHost> texOnBlack = TextureHost::AsTextureHost(op.textureOnBlackParent());
|
|
|
|
RefPtr<TextureHost> texOnWhite = TextureHost::AsTextureHost(op.textureOnWhiteParent());
|
|
|
|
|
|
|
|
MOZ_ASSERT(texOnBlack && texOnWhite);
|
|
|
|
compositable->UseComponentAlphaTextures(texOnBlack, texOnWhite);
|
|
|
|
|
|
|
|
if (IsAsync()) {
|
|
|
|
ScheduleComposition(op);
|
|
|
|
}
|
2014-02-25 04:23:41 +00:00
|
|
|
// return texure data to client if necessary
|
|
|
|
ReturnTextureDataIfNecessary(compositable, replyv, op.compositableParent());
|
2014-02-06 11:28:29 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-07-30 09:59:51 +00:00
|
|
|
case CompositableOperation::TOpUpdateTexture: {
|
|
|
|
const OpUpdateTexture& op = aEdit.get_OpUpdateTexture();
|
2013-12-12 01:44:44 +00:00
|
|
|
RefPtr<TextureHost> texture = TextureHost::AsTextureHost(op.textureParent());
|
2013-07-30 09:59:51 +00:00
|
|
|
MOZ_ASSERT(texture);
|
2013-08-08 12:53:12 +00:00
|
|
|
|
|
|
|
texture->Updated(op.region().type() == MaybeRegion::TnsIntRegion
|
|
|
|
? &op.region().get_nsIntRegion()
|
|
|
|
: nullptr); // no region means invalidate the entire surface
|
2013-07-30 09:59:51 +00:00
|
|
|
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, "bad type");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-03-27 01:01:15 +00:00
|
|
|
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
2014-02-25 04:23:41 +00:00
|
|
|
void
|
|
|
|
CompositableParentManager::ReturnTextureDataIfNecessary(CompositableHost* aCompositable,
|
|
|
|
EditReplyVector& replyv,
|
|
|
|
PCompositableParent* aParent)
|
|
|
|
{
|
|
|
|
if (!aCompositable || !aCompositable->GetCompositableBackendSpecificData()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::vector< RefPtr<TextureHost> > textureList =
|
|
|
|
aCompositable->GetCompositableBackendSpecificData()->GetPendingReleaseFenceTextureList();
|
|
|
|
// Return pending Texture data
|
|
|
|
for (size_t i = 0; i < textureList.size(); i++) {
|
2014-03-21 16:57:01 +00:00
|
|
|
// File descriptor number is limited to 4 per IPC message.
|
|
|
|
// See Bug 986253
|
|
|
|
if (mPrevFenceHandles.size() >= 4) {
|
|
|
|
break;
|
|
|
|
}
|
2014-02-25 04:23:41 +00:00
|
|
|
TextureHostOGL* hostOGL = textureList[i]->AsHostOGL();
|
|
|
|
PTextureParent* actor = textureList[i]->GetIPDLActor();
|
|
|
|
if (!hostOGL || !actor) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
android::sp<android::Fence> fence = hostOGL->GetAndResetReleaseFence();
|
|
|
|
if (fence.get() && fence->isValid()) {
|
|
|
|
FenceHandle handle = FenceHandle(fence);
|
|
|
|
replyv.push_back(ReturnReleaseFence(aParent, nullptr, actor, nullptr, handle));
|
|
|
|
// Hold fence handle to prevent fence's file descriptor is closed before IPC happens.
|
|
|
|
mPrevFenceHandles.push_back(handle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aCompositable->GetCompositableBackendSpecificData()->ClearPendingReleaseFenceTextureList();
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
CompositableParentManager::ReturnTextureDataIfNecessary(CompositableHost* aCompositable,
|
|
|
|
EditReplyVector& replyv,
|
|
|
|
PCompositableParent* aParent)
|
|
|
|
{
|
|
|
|
if (!aCompositable || !aCompositable->GetCompositableBackendSpecificData()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
aCompositable->GetCompositableBackendSpecificData()->ClearPendingReleaseFenceTextureList();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
CompositableParentManager::ClearPrevFenceHandles()
|
|
|
|
{
|
|
|
|
mPrevFenceHandles.clear();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
} // namespace
|
|
|
|
|