2010-07-21 21:17:33 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-04-24 18:42:40 +00:00
|
|
|
#include "LayerTransactionParent.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include <vector> // for vector
|
|
|
|
#include "CompositableHost.h" // for CompositableParent, Get, etc
|
|
|
|
#include "ImageLayers.h" // for ImageLayer
|
|
|
|
#include "Layers.h" // for Layer, ContainerLayer, etc
|
|
|
|
#include "ShadowLayerParent.h" // for ShadowLayerParent
|
|
|
|
#include "gfx3DMatrix.h" // for gfx3DMatrix
|
|
|
|
#include "gfxPoint3D.h" // for gfxPoint3D
|
|
|
|
#include "CompositableTransactionParent.h" // for EditReplyVector
|
|
|
|
#include "ShadowLayersManager.h" // for ShadowLayersManager
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/gfx/BasePoint3D.h" // for BasePoint3D
|
|
|
|
#include "mozilla/layers/CanvasLayerComposite.h"
|
2013-04-25 22:25:33 +00:00
|
|
|
#include "mozilla/layers/ColorLayerComposite.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/Compositor.h" // for Compositor
|
2013-04-25 22:25:33 +00:00
|
|
|
#include "mozilla/layers/ContainerLayerComposite.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/ImageLayerComposite.h"
|
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
2013-09-06 15:41:00 +00:00
|
|
|
#include "mozilla/layers/LayersMessages.h" // for EditReply, etc
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for PGrallocBufferParent
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
|
|
|
|
#include "mozilla/layers/PCompositableParent.h"
|
|
|
|
#include "mozilla/layers/PLayerParent.h" // for PLayerParent
|
|
|
|
#include "mozilla/layers/ThebesLayerComposite.h"
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete, etc
|
|
|
|
#include "nsCoord.h" // for NSAppUnitsToFloatPixels
|
|
|
|
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
|
|
|
#include "nsISupportsImpl.h" // for Layer::Release, etc
|
|
|
|
#include "nsLayoutUtils.h" // for nsLayoutUtils
|
|
|
|
#include "nsMathUtils.h" // for NS_round
|
|
|
|
#include "nsPoint.h" // for nsPoint
|
|
|
|
#include "nsTArray.h" // for nsTArray, nsTArray_Impl, etc
|
|
|
|
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
2013-09-10 19:56:49 +00:00
|
|
|
#include "GeckoProfiler.h"
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
|
|
|
|
|
2010-08-20 23:24:41 +00:00
|
|
|
using mozilla::layout::RenderFrameParent;
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2013-08-11 23:17:23 +00:00
|
|
|
class PGrallocBufferParent;
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
//--------------------------------------------------
|
|
|
|
// Convenience accessors
|
|
|
|
static ShadowLayerParent*
|
|
|
|
cast(const PLayerParent* in)
|
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
|
|
|
{
|
2010-07-21 21:17:33 +00:00
|
|
|
return const_cast<ShadowLayerParent*>(
|
|
|
|
static_cast<const ShadowLayerParent*>(in));
|
|
|
|
}
|
|
|
|
|
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 CompositableParent*
|
|
|
|
cast(const PCompositableParent* in)
|
|
|
|
{
|
|
|
|
return const_cast<CompositableParent*>(
|
|
|
|
static_cast<const CompositableParent*>(in));
|
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
template<class OpCreateT>
|
|
|
|
static ShadowLayerParent*
|
2013-04-25 22:25:33 +00:00
|
|
|
AsLayerComposite(const OpCreateT& op)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
|
|
|
return cast(op.layerParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
static ShadowLayerParent*
|
2013-04-25 22:25:33 +00:00
|
|
|
AsLayerComposite(const OpSetRoot& op)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
|
|
|
return cast(op.rootParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowContainer(const OpInsertAfter& op)
|
|
|
|
{
|
|
|
|
return cast(op.containerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowChild(const OpInsertAfter& op)
|
|
|
|
{
|
|
|
|
return cast(op.childLayerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowAfter(const OpInsertAfter& op)
|
|
|
|
{
|
|
|
|
return cast(op.afterParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowContainer(const OpAppendChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.containerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowChild(const OpAppendChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.childLayerParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowContainer(const OpRemoveChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.containerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowChild(const OpRemoveChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.childLayerParent());
|
|
|
|
}
|
|
|
|
|
2012-08-29 10:52:55 +00:00
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowContainer(const OpRepositionChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.containerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowChild(const OpRepositionChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.childLayerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowAfter(const OpRepositionChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.afterParent());
|
|
|
|
}
|
|
|
|
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowContainer(const OpRaiseToTopChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.containerParent());
|
|
|
|
}
|
|
|
|
static ShadowLayerParent*
|
|
|
|
ShadowChild(const OpRaiseToTopChild& op)
|
|
|
|
{
|
|
|
|
return cast(op.childLayerParent());
|
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
//--------------------------------------------------
|
2013-04-24 18:42:40 +00:00
|
|
|
// LayerTransactionParent
|
2013-04-25 22:25:33 +00:00
|
|
|
LayerTransactionParent::LayerTransactionParent(LayerManagerComposite* aManager,
|
2013-04-24 18:42:40 +00:00
|
|
|
ShadowLayersManager* aLayersManager,
|
|
|
|
uint64_t aId)
|
2012-07-17 23:59:45 +00:00
|
|
|
: mLayerManager(aManager)
|
|
|
|
, mShadowLayersManager(aLayersManager)
|
|
|
|
, mId(aId)
|
|
|
|
, mDestroyed(false)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
2013-04-24 18:42:40 +00:00
|
|
|
MOZ_COUNT_CTOR(LayerTransactionParent);
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2013-04-24 18:42:40 +00:00
|
|
|
LayerTransactionParent::~LayerTransactionParent()
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
2013-04-24 18:42:40 +00:00
|
|
|
MOZ_COUNT_DTOR(LayerTransactionParent);
|
2010-07-21 21:17:33 +00:00
|
|
|
}
|
|
|
|
|
2011-01-06 04:54:47 +00:00
|
|
|
void
|
2013-04-24 18:42:40 +00:00
|
|
|
LayerTransactionParent::Destroy()
|
2011-01-06 04:54:47 +00:00
|
|
|
{
|
2011-01-12 20:13:41 +00:00
|
|
|
mDestroyed = true;
|
2011-01-06 04:54:47 +00:00
|
|
|
for (size_t i = 0; i < ManagedPLayerParent().Length(); ++i) {
|
|
|
|
ShadowLayerParent* slp =
|
|
|
|
static_cast<ShadowLayerParent*>(ManagedPLayerParent()[i]);
|
|
|
|
slp->Destroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-01 19:23:39 +00:00
|
|
|
/* virtual */
|
|
|
|
bool
|
2013-04-24 18:42:40 +00:00
|
|
|
LayerTransactionParent::RecvUpdateNoSwap(const InfallibleTArray<Edit>& cset,
|
|
|
|
const TargetConfig& targetConfig,
|
|
|
|
const bool& isFirstPaint)
|
2012-05-01 19:23:39 +00:00
|
|
|
{
|
2013-03-22 19:22:20 +00:00
|
|
|
return RecvUpdate(cset, targetConfig, isFirstPaint, nullptr);
|
2012-05-01 19:23:39 +00:00
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
bool
|
2013-04-24 18:42:40 +00:00
|
|
|
LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|
|
|
const TargetConfig& targetConfig,
|
|
|
|
const bool& isFirstPaint,
|
|
|
|
InfallibleTArray<EditReply>* reply)
|
2010-07-21 21:17:33 +00:00
|
|
|
{
|
2013-09-27 16:08:45 +00:00
|
|
|
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_START);
|
2013-09-10 19:56:49 +00:00
|
|
|
PROFILER_LABEL("LayerTransactionParent", "RecvUpdate");
|
2012-02-10 23:06:17 +00:00
|
|
|
#ifdef COMPOSITOR_PERFORMANCE_WARNING
|
|
|
|
TimeStamp updateStart = TimeStamp::Now();
|
|
|
|
#endif
|
|
|
|
|
2011-05-31 16:14:54 +00:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] received txn with %d edits", cset.Length()));
|
2010-07-21 21:17:33 +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
|
|
|
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
|
2010-12-27 14:48:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
EditReplyVector replyv;
|
|
|
|
|
2013-09-27 00:37:19 +00:00
|
|
|
layer_manager()->BeginTransactionWithDrawTarget(nullptr);
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
for (EditArray::index_type i = 0; i < cset.Length(); ++i) {
|
|
|
|
const Edit& edit = cset[i];
|
|
|
|
|
|
|
|
switch (edit.type()) {
|
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
|
|
|
// Create* ops
|
2010-07-21 21:17:33 +00:00
|
|
|
case Edit::TOpCreateThebesLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<ThebesLayerComposite> layer =
|
|
|
|
layer_manager()->CreateThebesLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpCreateContainerLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateContainerLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateContainerLayer())->Bind(layer);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpCreateImageLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<ImageLayerComposite> layer =
|
|
|
|
layer_manager()->CreateImageLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateImageLayer())->Bind(layer);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpCreateColorLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<ColorLayerComposite> layer = layer_manager()->CreateColorLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateColorLayer())->Bind(layer);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpCreateCanvasLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<CanvasLayerComposite> layer =
|
|
|
|
layer_manager()->CreateCanvasLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateCanvasLayer())->Bind(layer);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-07-17 23:59:45 +00:00
|
|
|
case Edit::TOpCreateRefLayer: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
nsRefPtr<RefLayerComposite> layer =
|
|
|
|
layer_manager()->CreateRefLayerComposite();
|
|
|
|
AsLayerComposite(edit.get_OpCreateRefLayer())->Bind(layer);
|
2012-07-17 23:59:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-03-21 17:08:01 +00:00
|
|
|
// Attributes
|
2010-07-21 21:17:33 +00:00
|
|
|
case Edit::TOpSetLayerAttributes: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
|
|
|
|
|
|
|
|
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
|
2013-04-25 22:25:33 +00:00
|
|
|
Layer* layer = AsLayerComposite(osla)->AsLayer();
|
2010-07-21 21:17:33 +00:00
|
|
|
const LayerAttributes& attrs = osla.attrs();
|
|
|
|
|
|
|
|
const CommonLayerAttributes& common = attrs.common();
|
|
|
|
layer->SetVisibleRegion(common.visibleRegion());
|
2010-09-02 09:18:40 +00:00
|
|
|
layer->SetContentFlags(common.contentFlags());
|
2012-08-20 13:35:41 +00:00
|
|
|
layer->SetOpacity(common.opacity());
|
2013-07-20 08:48:55 +00:00
|
|
|
layer->SetClipRect(common.useClipRect() ? &common.clipRect() : nullptr);
|
2012-07-31 17:28:20 +00:00
|
|
|
layer->SetBaseTransform(common.transform().value());
|
2012-08-03 21:29:22 +00:00
|
|
|
layer->SetPostScale(common.postXScale(), common.postYScale());
|
2012-12-23 15:47:16 +00:00
|
|
|
layer->SetIsFixedPosition(common.isFixedPosition());
|
|
|
|
layer->SetFixedPositionAnchor(common.fixedPositionAnchor());
|
2013-03-07 10:17:33 +00:00
|
|
|
layer->SetFixedPositionMargins(common.fixedPositionMargin());
|
2013-09-12 04:17:58 +00:00
|
|
|
if (common.isStickyPosition()) {
|
|
|
|
layer->SetStickyPositionData(common.stickyScrollContainerId(),
|
|
|
|
common.stickyScrollRangeOuter(),
|
|
|
|
common.stickyScrollRangeInner());
|
|
|
|
}
|
2012-03-18 23:02:38 +00:00
|
|
|
if (PLayerParent* maskLayer = common.maskLayerParent()) {
|
|
|
|
layer->SetMaskLayer(cast(maskLayer)->AsLayer());
|
|
|
|
} else {
|
2013-07-20 08:48:55 +00:00
|
|
|
layer->SetMaskLayer(nullptr);
|
2012-03-18 23:02:38 +00:00
|
|
|
}
|
2012-07-31 17:28:20 +00:00
|
|
|
layer->SetAnimations(common.animations());
|
2010-07-21 21:17:33 +00:00
|
|
|
|
|
|
|
typedef SpecificLayerAttributes Specific;
|
|
|
|
const SpecificLayerAttributes& specific = attrs.specific();
|
|
|
|
switch (specific.type()) {
|
|
|
|
case Specific::Tnull_t:
|
|
|
|
break;
|
|
|
|
|
2010-09-03 20:10:46 +00:00
|
|
|
case Specific::TThebesLayerAttributes: {
|
2010-07-21 21:17:33 +00:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
|
|
|
|
2013-04-25 22:25:33 +00:00
|
|
|
ThebesLayerComposite* thebesLayer =
|
|
|
|
static_cast<ThebesLayerComposite*>(layer);
|
2010-09-03 20:10:46 +00:00
|
|
|
const ThebesLayerAttributes& attrs =
|
|
|
|
specific.get_ThebesLayerAttributes();
|
|
|
|
|
|
|
|
thebesLayer->SetValidRegion(attrs.validRegion());
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2010-09-03 20:10:46 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-08-03 21:29:22 +00:00
|
|
|
case Specific::TContainerLayerAttributes: {
|
2010-09-03 20:10:45 +00:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] container layer"));
|
|
|
|
|
2012-08-03 21:29:22 +00:00
|
|
|
ContainerLayer* containerLayer =
|
|
|
|
static_cast<ContainerLayer*>(layer);
|
|
|
|
const ContainerLayerAttributes& attrs =
|
|
|
|
specific.get_ContainerLayerAttributes();
|
|
|
|
containerLayer->SetFrameMetrics(attrs.metrics());
|
|
|
|
containerLayer->SetPreScale(attrs.preXScale(), attrs.preYScale());
|
2013-01-08 09:39:12 +00:00
|
|
|
containerLayer->SetInheritedScale(attrs.inheritedXScale(), attrs.inheritedYScale());
|
2010-09-03 20:10:45 +00:00
|
|
|
break;
|
2012-08-03 21:29:22 +00:00
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
case Specific::TColorLayerAttributes:
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] color layer"));
|
|
|
|
|
|
|
|
static_cast<ColorLayer*>(layer)->SetColor(
|
2012-07-31 17:28:20 +00:00
|
|
|
specific.get_ColorLayerAttributes().color().value());
|
2013-07-09 14:11:00 +00:00
|
|
|
static_cast<ColorLayer*>(layer)->SetBounds(
|
|
|
|
specific.get_ColorLayerAttributes().bounds());
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case Specific::TCanvasLayerAttributes:
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] canvas layer"));
|
|
|
|
|
|
|
|
static_cast<CanvasLayer*>(layer)->SetFilter(
|
|
|
|
specific.get_CanvasLayerAttributes().filter());
|
2013-04-25 22:25:33 +00:00
|
|
|
static_cast<CanvasLayerComposite*>(layer)->SetBounds(
|
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
|
|
|
specific.get_CanvasLayerAttributes().bounds());
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
|
2012-07-17 23:59:45 +00:00
|
|
|
case Specific::TRefLayerAttributes:
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] ref layer"));
|
|
|
|
|
|
|
|
static_cast<RefLayer*>(layer)->SetReferentId(
|
|
|
|
specific.get_RefLayerAttributes().id());
|
|
|
|
break;
|
|
|
|
|
2012-05-22 23:14:03 +00:00
|
|
|
case Specific::TImageLayerAttributes: {
|
2010-07-21 21:17:33 +00:00
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] image layer"));
|
|
|
|
|
2012-05-22 23:14:03 +00:00
|
|
|
ImageLayer* imageLayer = static_cast<ImageLayer*>(layer);
|
|
|
|
const ImageLayerAttributes& attrs = specific.get_ImageLayerAttributes();
|
|
|
|
imageLayer->SetFilter(attrs.filter());
|
2013-05-09 21:02:50 +00:00
|
|
|
imageLayer->SetScaleToSize(attrs.scaleToSize(), attrs.scaleMode());
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
2012-05-22 23:14:03 +00:00
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
default:
|
|
|
|
NS_RUNTIMEABORT("not reached");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2013-08-02 22:50:17 +00:00
|
|
|
case Edit::TOpSetDiagnosticTypes: {
|
|
|
|
mLayerManager->GetCompositor()->SetDiagnosticTypes(
|
|
|
|
edit.get_OpSetDiagnosticTypes().diagnostics());
|
2013-03-21 17:08:01 +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
|
|
|
// Tree ops
|
2010-07-21 21:17:33 +00:00
|
|
|
case Edit::TOpSetRoot: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
|
|
|
|
|
2013-07-02 04:17:23 +00:00
|
|
|
mRoot = AsLayerComposite(edit.get_OpSetRoot())->AsLayer();
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpInsertAfter: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] InsertAfter"));
|
|
|
|
|
|
|
|
const OpInsertAfter& oia = edit.get_OpInsertAfter();
|
|
|
|
ShadowContainer(oia)->AsContainer()->InsertAfter(
|
|
|
|
ShadowChild(oia)->AsLayer(), ShadowAfter(oia)->AsLayer());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpAppendChild: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] AppendChild"));
|
|
|
|
|
|
|
|
const OpAppendChild& oac = edit.get_OpAppendChild();
|
|
|
|
ShadowContainer(oac)->AsContainer()->InsertAfter(
|
2013-07-20 08:48:55 +00:00
|
|
|
ShadowChild(oac)->AsLayer(), nullptr);
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpRemoveChild: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] RemoveChild"));
|
|
|
|
|
|
|
|
const OpRemoveChild& orc = edit.get_OpRemoveChild();
|
|
|
|
Layer* childLayer = ShadowChild(orc)->AsLayer();
|
|
|
|
ShadowContainer(orc)->AsContainer()->RemoveChild(childLayer);
|
|
|
|
break;
|
|
|
|
}
|
2012-08-29 10:52:55 +00:00
|
|
|
case Edit::TOpRepositionChild: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] RepositionChild"));
|
|
|
|
|
|
|
|
const OpRepositionChild& orc = edit.get_OpRepositionChild();
|
|
|
|
ShadowContainer(orc)->AsContainer()->RepositionChild(
|
|
|
|
ShadowChild(orc)->AsLayer(), ShadowAfter(orc)->AsLayer());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Edit::TOpRaiseToTopChild: {
|
|
|
|
MOZ_LAYERS_LOG(("[ParentSide] RaiseToTopChild"));
|
|
|
|
|
|
|
|
const OpRaiseToTopChild& rtc = edit.get_OpRaiseToTopChild();
|
|
|
|
ShadowContainer(rtc)->AsContainer()->RepositionChild(
|
2013-07-20 08:48:55 +00:00
|
|
|
ShadowChild(rtc)->AsLayer(), nullptr);
|
2012-08-29 10:52:55 +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 Edit::TCompositableOperation: {
|
|
|
|
ReceiveCompositableUpdate(edit.get_CompositableOperation(),
|
|
|
|
replyv);
|
2012-04-13 15:17:39 +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 Edit::TOpAttachCompositable: {
|
|
|
|
const OpAttachCompositable& op = edit.get_OpAttachCompositable();
|
2013-08-21 01:28:53 +00:00
|
|
|
Attach(cast(op.layerParent()), cast(op.compositableParent()), false);
|
2013-07-30 09:59:51 +00:00
|
|
|
cast(op.compositableParent())->SetCompositorID(
|
|
|
|
mLayerManager->GetCompositor()->GetCompositorID());
|
2010-07-21 21:17:33 +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 Edit::TOpAttachAsyncCompositable: {
|
|
|
|
const OpAttachAsyncCompositable& op = edit.get_OpAttachAsyncCompositable();
|
|
|
|
CompositableParent* compositableParent = CompositableMap::Get(op.containerID());
|
|
|
|
MOZ_ASSERT(compositableParent, "CompositableParent not found in the map");
|
2013-08-21 01:28:53 +00:00
|
|
|
Attach(cast(op.layerParent()), compositableParent, 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
|
|
|
compositableParent->SetCompositorID(mLayerManager->GetCompositor()->GetCompositorID());
|
2010-07-21 21:17:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
NS_RUNTIMEABORT("not reached");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-20 08:48:55 +00:00
|
|
|
layer_manager()->EndTransaction(nullptr, nullptr, LayerManager::END_NO_IMMEDIATE_REDRAW);
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2013-03-22 19:22:20 +00:00
|
|
|
if (reply) {
|
|
|
|
reply->SetCapacity(replyv.size());
|
|
|
|
if (replyv.size() > 0) {
|
|
|
|
reply->AppendElements(&replyv.front(), replyv.size());
|
|
|
|
}
|
2010-07-21 23:13:24 +00:00
|
|
|
}
|
2010-07-21 21:17:33 +00:00
|
|
|
|
2010-09-14 05:23:08 +00:00
|
|
|
// Ensure that any pending operations involving back and front
|
|
|
|
// buffers have completed, so that neither process stomps on the
|
|
|
|
// other's buffer contents.
|
2013-04-25 22:25:33 +00:00
|
|
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
2010-09-14 05:23:08 +00:00
|
|
|
|
2012-07-24 19:01:09 +00:00
|
|
|
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
|
2010-08-20 23:24:41 +00:00
|
|
|
|
2012-02-10 23:06:17 +00:00
|
|
|
#ifdef COMPOSITOR_PERFORMANCE_WARNING
|
2012-03-19 11:55:37 +00:00
|
|
|
int compositeTime = (int)(mozilla::TimeStamp::Now() - updateStart).ToMilliseconds();
|
|
|
|
if (compositeTime > 15) {
|
|
|
|
printf_stderr("Compositor: Layers update took %i ms (blocking gecko).\n", compositeTime);
|
|
|
|
}
|
2012-02-10 23:06:17 +00:00
|
|
|
#endif
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-05-30 00:38:27 +00:00
|
|
|
bool
|
|
|
|
LayerTransactionParent::RecvGetOpacity(PLayerParent* aParent,
|
|
|
|
float* aOpacity)
|
|
|
|
{
|
|
|
|
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
*aOpacity = cast(aParent)->AsLayer()->GetLocalOpacity();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
LayerTransactionParent::RecvGetTransform(PLayerParent* aParent,
|
|
|
|
gfx3DMatrix* aTransform)
|
|
|
|
{
|
|
|
|
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-05-31 00:45:17 +00:00
|
|
|
// The following code recovers the untranslated transform
|
|
|
|
// from the shadow transform by undoing the translations in
|
|
|
|
// AsyncCompositionManager::SampleValue.
|
|
|
|
Layer* layer = cast(aParent)->AsLayer();
|
2013-05-31 18:06:57 +00:00
|
|
|
*aTransform = layer->AsLayerComposite()->GetShadowTransform();
|
|
|
|
if (ContainerLayer* c = layer->AsContainerLayer()) {
|
|
|
|
aTransform->ScalePost(1.0f/c->GetInheritedXScale(),
|
|
|
|
1.0f/c->GetInheritedYScale(),
|
|
|
|
1.0f);
|
|
|
|
}
|
2013-05-31 00:45:17 +00:00
|
|
|
float scale = 1;
|
|
|
|
gfxPoint3D scaledOrigin;
|
|
|
|
gfxPoint3D mozOrigin;
|
|
|
|
for (uint32_t i=0; i < layer->GetAnimations().Length(); i++) {
|
|
|
|
if (layer->GetAnimations()[i].data().type() == AnimationData::TTransformData) {
|
|
|
|
const TransformData& data = layer->GetAnimations()[i].data().get_TransformData();
|
|
|
|
scale = data.appUnitsPerDevPixel();
|
|
|
|
scaledOrigin =
|
|
|
|
gfxPoint3D(NS_round(NSAppUnitsToFloatPixels(data.origin().x, scale)),
|
|
|
|
NS_round(NSAppUnitsToFloatPixels(data.origin().y, scale)),
|
|
|
|
0.0f);
|
|
|
|
mozOrigin = data.mozOrigin();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
aTransform->Translate(-scaledOrigin);
|
|
|
|
*aTransform = nsLayoutUtils::ChangeMatrixBasis(-scaledOrigin - mozOrigin, *aTransform);
|
2013-05-30 00:38:27 +00:00
|
|
|
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
|
|
|
void
|
2013-08-21 01:28:53 +00:00
|
|
|
LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent,
|
|
|
|
CompositableParent* aCompositable,
|
|
|
|
bool aIsAsyncVideo)
|
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-04-25 22:25:33 +00:00
|
|
|
LayerComposite* layer = aLayerParent->AsLayer()->AsLayerComposite();
|
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(layer);
|
|
|
|
|
|
|
|
Compositor* compositor
|
|
|
|
= static_cast<LayerManagerComposite*>(aLayerParent->AsLayer()->Manager())->GetCompositor();
|
|
|
|
|
|
|
|
CompositableHost* compositable = aCompositable->GetCompositableHost();
|
|
|
|
MOZ_ASSERT(compositable);
|
2013-06-05 22:14:51 +00:00
|
|
|
layer->SetCompositableHost(compositable);
|
2013-08-21 01:28:53 +00:00
|
|
|
compositable->Attach(aLayerParent->AsLayer(),
|
|
|
|
compositor,
|
|
|
|
aIsAsyncVideo
|
|
|
|
? CompositableHost::ALLOW_REATTACH
|
|
|
|
| CompositableHost::KEEP_ATTACHED
|
|
|
|
: CompositableHost::NO_FLAGS);
|
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-11-08 03:51:55 +00:00
|
|
|
bool
|
2013-04-24 18:42:40 +00:00
|
|
|
LayerTransactionParent::RecvClearCachedResources()
|
2012-11-08 03:51:55 +00:00
|
|
|
{
|
|
|
|
if (mRoot) {
|
|
|
|
// NB: |mRoot| here is the *child* context's root. In this parent
|
|
|
|
// context, it's just a subtree root. We need to scope the clear
|
|
|
|
// of resources to exactly that subtree, so we specify it here.
|
|
|
|
mLayerManager->ClearCachedResources(mRoot);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-12 12:51:58 +00:00
|
|
|
PGrallocBufferParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::AllocPGrallocBufferParent(const gfxIntSize& aSize,
|
2013-05-27 14:12:13 +00:00
|
|
|
const uint32_t& aFormat,
|
|
|
|
const uint32_t& aUsage,
|
2013-04-24 18:42:40 +00:00
|
|
|
MaybeMagicGrallocBufferHandle* aOutHandle)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
|
|
|
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
|
2013-05-27 14:12:13 +00:00
|
|
|
return GrallocBufferActor::Create(aSize, aFormat, aUsage, aOutHandle);
|
2012-07-12 12:51:58 +00:00
|
|
|
#else
|
|
|
|
NS_RUNTIMEABORT("No gralloc buffers for you");
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2012-07-12 12:51:58 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::DeallocPGrallocBufferParent(PGrallocBufferParent* actor)
|
2012-07-12 12:51:58 +00:00
|
|
|
{
|
|
|
|
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
NS_RUNTIMEABORT("Um, how did we get here?");
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-08-20 23:24:41 +00:00
|
|
|
PLayerParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::AllocPLayerParent()
|
2010-08-20 23:24:41 +00:00
|
|
|
{
|
|
|
|
return new ShadowLayerParent();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::DeallocPLayerParent(PLayerParent* actor)
|
2010-08-20 23:24:41 +00:00
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
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
|
|
|
PCompositableParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::AllocPCompositableParent(const TextureInfo& aInfo)
|
2011-09-27 22:19:26 +00:00
|
|
|
{
|
2013-04-12 07:28:55 +00:00
|
|
|
return new CompositableParent(this, aInfo);
|
2011-09-27 22:19:26 +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
|
|
|
bool
|
2013-07-08 15:48:39 +00:00
|
|
|
LayerTransactionParent::DeallocPCompositableParent(PCompositableParent* actor)
|
2011-09-27 22:19:26 +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
|
|
|
delete actor;
|
|
|
|
return true;
|
2011-09-27 22:19:26 +00:00
|
|
|
}
|
|
|
|
|
2010-07-21 21:17:33 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|