2012-05-09 19:32:54 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2011-12-12 07:15:57 -08:00
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 04:12:37 -07: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/. */
|
2011-12-12 07:15:57 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_layers_CompositorParent_h
|
|
|
|
#define mozilla_layers_CompositorParent_h
|
|
|
|
|
2012-02-10 15:06:17 -08:00
|
|
|
// Enable this pref to turn on compositor performance warning.
|
|
|
|
// This will print warnings if the compositor isn't meeting
|
2012-03-12 13:32:02 -07:00
|
|
|
// its responsiveness objectives:
|
2012-02-10 15:06:17 -08:00
|
|
|
// 1) Compose a frame within 15ms of receiving a ScheduleCompositeCall
|
|
|
|
// 2) Unless a frame was composited within the throttle threshold in
|
|
|
|
// which the deadline will be 15ms + throttle threshold
|
2012-05-28 14:28:31 -07:00
|
|
|
//#define COMPOSITOR_PERFORMANCE_WARNING
|
2012-02-10 15:06:17 -08:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint64_t
|
|
|
|
#include "Layers.h" // for Layer
|
|
|
|
#include "ShadowLayersManager.h" // for ShadowLayersManager
|
|
|
|
#include "base/basictypes.h" // for DISALLOW_EVIL_CONSTRUCTORS
|
|
|
|
#include "base/platform_thread.h" // for PlatformThreadId
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/Monitor.h" // for Monitor
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
|
|
|
#include "mozilla/TimeStamp.h" // for TimeStamp
|
|
|
|
#include "mozilla/ipc/ProtocolUtils.h"
|
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2013-09-06 08:41:00 -07:00
|
|
|
#include "mozilla/layers/LayersMessages.h" // for TargetConfig
|
2011-12-12 07:15:57 -08:00
|
|
|
#include "mozilla/layers/PCompositorParent.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "nsSize.h" // for nsIntSize
|
2013-04-27 23:46:30 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class CancelableTask;
|
|
|
|
class MessageLoop;
|
|
|
|
class gfxContext;
|
2012-01-06 14:52:32 -08:00
|
|
|
class nsIWidget;
|
2011-12-15 12:07:25 -08:00
|
|
|
|
2011-12-12 07:15:57 -08:00
|
|
|
namespace mozilla {
|
2013-09-26 17:37:19 -07:00
|
|
|
namespace gfx {
|
|
|
|
class DrawTarget;
|
|
|
|
}
|
|
|
|
|
2011-12-12 07:15:57 -08:00
|
|
|
namespace layers {
|
|
|
|
|
2013-07-30 11:03:40 -07:00
|
|
|
class APZCTreeManager;
|
2013-08-11 19:21:17 -07:00
|
|
|
class AsyncCompositionManager;
|
2013-12-08 17:40:58 -08:00
|
|
|
class Compositor;
|
2013-08-11 16:17:23 -07:00
|
|
|
class LayerManagerComposite;
|
|
|
|
class LayerTransactionParent;
|
2012-01-06 14:52:32 -08:00
|
|
|
|
2013-07-30 11:03:41 -07:00
|
|
|
struct ScopedLayerTreeRegistration
|
|
|
|
{
|
|
|
|
ScopedLayerTreeRegistration(uint64_t aLayersId,
|
|
|
|
Layer* aRoot,
|
|
|
|
GeckoContentController* aController);
|
|
|
|
~ScopedLayerTreeRegistration();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint64_t mLayersId;
|
|
|
|
};
|
|
|
|
|
2011-12-15 12:20:06 -08:00
|
|
|
class CompositorParent : public PCompositorParent,
|
2012-01-06 14:52:32 -08:00
|
|
|
public ShadowLayersManager
|
2011-12-12 07:15:57 -08:00
|
|
|
{
|
2012-01-06 14:52:32 -08:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorParent)
|
2012-11-21 18:40:57 -08:00
|
|
|
|
2011-12-12 07:15:57 -08:00
|
|
|
public:
|
2012-07-13 08:25:29 -07:00
|
|
|
CompositorParent(nsIWidget* aWidget,
|
2013-04-29 20:16:04 -07:00
|
|
|
bool aUseExternalSurfaceSize = false,
|
2012-05-08 12:40:41 -07:00
|
|
|
int aSurfaceWidth = -1, int aSurfaceHeight = -1);
|
2012-04-24 06:22:34 -07:00
|
|
|
|
2011-12-15 12:07:19 -08:00
|
|
|
virtual ~CompositorParent();
|
2011-12-12 07:15:57 -08:00
|
|
|
|
2013-06-03 03:14:37 -07:00
|
|
|
// IToplevelProtocol::CloneToplevel()
|
|
|
|
virtual IToplevelProtocol*
|
|
|
|
CloneToplevel(const InfallibleTArray<mozilla::ipc::ProtocolFdMapping>& aFds,
|
|
|
|
base::ProcessHandle aPeerProcess,
|
|
|
|
mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
|
|
|
|
|
2012-03-30 12:43:11 -07:00
|
|
|
virtual bool RecvWillStop() MOZ_OVERRIDE;
|
2012-01-16 07:31:16 -08:00
|
|
|
virtual bool RecvStop() MOZ_OVERRIDE;
|
2012-03-28 15:00:10 -07:00
|
|
|
virtual bool RecvPause() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvResume() MOZ_OVERRIDE;
|
2013-07-11 19:32:09 -07:00
|
|
|
virtual bool RecvNotifyChildCreated(const uint64_t& child) MOZ_OVERRIDE;
|
2012-10-04 00:05:24 -07:00
|
|
|
virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
2014-01-17 11:49:39 -08:00
|
|
|
SurfaceDescriptor* aOutSnapshot) MOZ_OVERRIDE;
|
2013-06-18 00:58:43 -07:00
|
|
|
virtual bool RecvFlushRendering() MOZ_OVERRIDE;
|
2011-12-12 07:15:57 -08:00
|
|
|
|
2013-11-21 11:25:16 -08:00
|
|
|
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) MOZ_OVERRIDE;
|
2013-11-26 23:32:19 -08:00
|
|
|
virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) MOZ_OVERRIDE;
|
2013-11-21 11:25:16 -08:00
|
|
|
|
2013-04-11 03:14:29 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
2012-07-24 12:01:09 -07:00
|
|
|
const TargetConfig& aTargetConfig,
|
2013-12-15 21:38:42 -08:00
|
|
|
bool aIsFirstPaint,
|
|
|
|
bool aScheduleComposite) MOZ_OVERRIDE;
|
2014-03-02 16:59:58 -08:00
|
|
|
virtual void ForceComposite(LayerTransactionParent* aLayerTree) MOZ_OVERRIDE;
|
2014-03-21 14:59:57 -07:00
|
|
|
virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
|
|
|
|
const TimeStamp& aTime) MOZ_OVERRIDE;
|
|
|
|
virtual void LeaveTestMode(LayerTransactionParent* aLayerTree) MOZ_OVERRIDE;
|
2014-02-24 14:45:40 -08:00
|
|
|
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) MOZ_OVERRIDE { return mCompositionManager; }
|
2014-03-21 14:59:57 -07:00
|
|
|
|
2013-02-04 12:13:17 -08:00
|
|
|
/**
|
|
|
|
* This forces the is-first-paint flag to true. This is intended to
|
|
|
|
* be called by the widget code when it loses its viewport information
|
|
|
|
* (or for whatever reason wants to refresh the viewport information).
|
|
|
|
* The information refresh happens because the compositor will call
|
|
|
|
* SetFirstPaintViewport on the next frame of composition.
|
|
|
|
*/
|
2013-04-27 23:46:30 -07:00
|
|
|
void ForceIsFirstPaint();
|
2011-12-22 07:59:53 -08:00
|
|
|
void Destroy();
|
|
|
|
|
2013-07-11 19:32:09 -07:00
|
|
|
void NotifyChildCreated(uint64_t aChild);
|
|
|
|
|
2012-02-01 11:31:34 -08:00
|
|
|
void AsyncRender();
|
2012-02-09 14:39:04 -08:00
|
|
|
|
2012-02-06 09:38:23 -08:00
|
|
|
// Can be called from any thread
|
2012-03-12 13:32:02 -07:00
|
|
|
void ScheduleRenderOnCompositorThread();
|
|
|
|
void SchedulePauseOnCompositorThread();
|
2013-01-10 08:21:10 -08:00
|
|
|
/**
|
|
|
|
* Returns true if a surface was obtained and the resume succeeded; false
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
bool ScheduleResumeOnCompositorThread(int width, int height);
|
2012-02-01 11:31:34 -08:00
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
virtual void ScheduleComposition();
|
2013-12-15 21:38:42 -08:00
|
|
|
void NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint, bool aScheduleComposite);
|
2012-08-06 19:41:29 -07:00
|
|
|
|
2013-07-30 11:03:43 -07:00
|
|
|
/**
|
|
|
|
* Returns the unique layer tree identifier that corresponds to the root
|
|
|
|
* tree of this compositor.
|
|
|
|
*/
|
|
|
|
uint64_t RootLayerTreeId();
|
|
|
|
|
2012-07-13 12:38:09 -07: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 02:20:52 -07:00
|
|
|
* Returns a pointer to the compositor corresponding to the given ID.
|
2012-07-13 12:38:09 -07:00
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
static CompositorParent* GetCompositor(uint64_t id);
|
2012-07-13 12:38:09 -07:00
|
|
|
|
2012-07-13 08:25:29 -07:00
|
|
|
/**
|
|
|
|
* Returns the compositor thread's message loop.
|
|
|
|
*
|
|
|
|
* This message loop is used by CompositorParent and ImageBridgeParent.
|
|
|
|
*/
|
|
|
|
static MessageLoop* CompositorLoop();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates the compositor thread and the global compositor map.
|
|
|
|
*/
|
|
|
|
static void StartUp();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the compositor thread and the global compositor map.
|
|
|
|
*/
|
|
|
|
static void ShutDown();
|
|
|
|
|
2012-07-19 23:48:27 -07:00
|
|
|
/**
|
|
|
|
* Allocate an ID that can be used to refer to a layer tree and
|
|
|
|
* associated resources that live only on the compositor thread.
|
|
|
|
*
|
|
|
|
* Must run on the content main thread.
|
|
|
|
*/
|
2012-07-17 16:59:45 -07:00
|
|
|
static uint64_t AllocateLayerTreeId();
|
2012-07-19 23:48:27 -07:00
|
|
|
/**
|
|
|
|
* Release compositor-thread resources referred to by |aID|.
|
|
|
|
*
|
|
|
|
* Must run on the content main thread.
|
|
|
|
*/
|
|
|
|
static void DeallocateLayerTreeId(uint64_t aId);
|
|
|
|
|
|
|
|
/**
|
2013-07-30 11:03:40 -07:00
|
|
|
* Set aController as the pan/zoom callback for the subtree referred
|
2012-07-19 23:48:27 -07:00
|
|
|
* to by aLayersId.
|
|
|
|
*
|
|
|
|
* Must run on content main thread.
|
|
|
|
*/
|
2013-07-30 11:03:40 -07:00
|
|
|
static void SetControllerForLayerTree(uint64_t aLayersId,
|
|
|
|
GeckoContentController* aController);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This returns a reference to the APZCTreeManager to which
|
|
|
|
* pan/zoom-related events can be sent.
|
|
|
|
*/
|
|
|
|
static APZCTreeManager* GetAPZCTreeManager(uint64_t aLayersId);
|
2012-07-17 16:59:45 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A new child process has been configured to push transactions
|
|
|
|
* directly to us. Transport is to its thread context.
|
|
|
|
*/
|
2013-09-25 21:19:09 -07:00
|
|
|
static PCompositorParent*
|
2012-07-17 16:59:45 -07:00
|
|
|
Create(Transport* aTransport, ProcessId aOtherProcess);
|
|
|
|
|
2012-07-25 12:47:01 -07:00
|
|
|
/**
|
|
|
|
* Setup external message loop and thread ID for Compositor.
|
|
|
|
* Should be used when CompositorParent should work in existing thread/MessageLoop,
|
|
|
|
* for example moving Compositor into native toolkit main thread will allow to avoid
|
|
|
|
* extra synchronization and call ::Composite() right from toolkit::Paint event
|
|
|
|
*/
|
|
|
|
static void StartUpWithExistingThread(MessageLoop* aMsgLoop,
|
|
|
|
PlatformThreadId aThreadID);
|
|
|
|
|
2013-04-27 23:46:30 -07:00
|
|
|
struct LayerTreeState {
|
2013-07-31 15:20:24 -07:00
|
|
|
LayerTreeState();
|
2013-04-27 23:46:30 -07:00
|
|
|
nsRefPtr<Layer> mRoot;
|
2013-07-30 11:03:40 -07:00
|
|
|
nsRefPtr<GeckoContentController> mController;
|
2013-07-31 15:20:24 -07:00
|
|
|
CompositorParent* mParent;
|
2013-12-08 17:40:58 -08:00
|
|
|
LayerManagerComposite* mLayerManager;
|
2013-12-19 12:19:25 -08:00
|
|
|
// Pointer to the CrossProcessCompositorParent. Used by APZCs to share
|
|
|
|
// their FrameMetrics with the corresponding child process that holds
|
|
|
|
// the PCompositorChild
|
|
|
|
PCompositorParent* mCrossProcessParent;
|
2013-04-27 23:46:30 -07:00
|
|
|
TargetConfig mTargetConfig;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lookup the indirect shadow tree for |aId| and return it if it
|
|
|
|
* exists. Otherwise null is returned. This must only be called on
|
|
|
|
* the compositor thread.
|
|
|
|
*/
|
|
|
|
static const LayerTreeState* GetIndirectShadowTree(uint64_t aId);
|
|
|
|
|
2013-12-08 17:40:59 -08:00
|
|
|
float ComputeRenderIntegrity();
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
/**
|
2013-08-08 05:53:12 -07:00
|
|
|
* Returns true if the calling thread is the compositor thread.
|
2013-07-30 02:59:51 -07:00
|
|
|
*/
|
|
|
|
static bool IsInCompositorThread();
|
2014-02-11 20:41:57 -08:00
|
|
|
|
2012-01-06 14:52:32 -08:00
|
|
|
protected:
|
2013-04-24 11:42:40 -07:00
|
|
|
virtual PLayerTransactionParent*
|
2013-08-17 23:46:16 -07:00
|
|
|
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
|
2013-07-08 08:48:39 -07:00
|
|
|
const uint64_t& aId,
|
2013-08-04 00:46:17 -07:00
|
|
|
TextureFactoryIdentifier* aTextureFactoryIdentifier,
|
2014-01-17 11:49:39 -08:00
|
|
|
bool* aSuccess) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
|
2012-04-24 06:22:36 -07:00
|
|
|
virtual void ScheduleTask(CancelableTask*, int);
|
2014-02-10 20:58:01 -08:00
|
|
|
void Composite();
|
|
|
|
void CompositeToTarget(gfx::DrawTarget* aTarget);
|
|
|
|
void ForceComposeToTarget(gfx::DrawTarget* aTarget);
|
2013-04-26 10:26:39 -07:00
|
|
|
|
2012-05-08 12:40:41 -07:00
|
|
|
void SetEGLSurfaceSize(int width, int height);
|
2011-12-12 07:15:57 -08:00
|
|
|
|
2011-12-15 12:07:19 -08:00
|
|
|
private:
|
2013-08-17 23:46:16 -07:00
|
|
|
void InitializeLayerManager(const nsTArray<LayersBackend>& aBackendHints);
|
2012-02-14 15:36:33 -08:00
|
|
|
void PauseComposition();
|
|
|
|
void ResumeComposition();
|
2012-04-20 08:46:30 -07:00
|
|
|
void ResumeCompositionAndResize(int width, int height);
|
2012-11-21 18:40:57 -08:00
|
|
|
void ForceComposition();
|
2014-03-09 21:47:12 -07:00
|
|
|
void CancelCurrentCompositeTask();
|
2012-02-14 15:36:33 -08:00
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
inline static PlatformThreadId CompositorThreadID();
|
2012-04-24 06:22:34 -07:00
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
/**
|
|
|
|
* Creates a global map referencing each compositor by ID.
|
|
|
|
*
|
|
|
|
* This map is used by the ImageBridge protocol to trigger
|
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 02:20:52 -07:00
|
|
|
* compositions without having to keep references to the
|
2012-07-13 12:38:09 -07:00
|
|
|
* compositor
|
|
|
|
*/
|
|
|
|
static void CreateCompositorMap();
|
|
|
|
static void DestroyCompositorMap();
|
|
|
|
|
2012-07-13 08:25:29 -07:00
|
|
|
/**
|
|
|
|
* Creates the compositor thread.
|
|
|
|
*
|
|
|
|
* All compositors live on the same thread.
|
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 02:20:52 -07:00
|
|
|
* The thread is not lazily created on first access to avoid dealing with
|
2012-07-13 08:25:29 -07:00
|
|
|
* thread safety. Therefore it's best to create and destroy the thread when
|
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 02:20:52 -07:00
|
|
|
* we know we areb't using it (So creating/destroying along with gfxPlatform
|
2012-07-13 08:25:29 -07:00
|
|
|
* looks like a good place).
|
|
|
|
*/
|
|
|
|
static bool CreateThread();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the compositor thread.
|
|
|
|
*
|
|
|
|
* It is safe to call this fucntion more than once, although the second call
|
|
|
|
* will have no effect.
|
|
|
|
* This function is not thread-safe.
|
|
|
|
*/
|
|
|
|
static void DestroyThread();
|
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
/**
|
|
|
|
* Add a compositor to the global compositor map.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
static void AddCompositor(CompositorParent* compositor, uint64_t* id);
|
2012-07-13 12:38:09 -07:00
|
|
|
/**
|
|
|
|
* Remove a compositor from the global compositor map.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
static CompositorParent* RemoveCompositor(uint64_t id);
|
2012-07-13 12:38:09 -07:00
|
|
|
|
2012-10-04 00:05:24 -07:00
|
|
|
/**
|
|
|
|
* Return true if current state allows compositing, that is
|
|
|
|
* finishing a layers transaction.
|
|
|
|
*/
|
|
|
|
bool CanComposite();
|
2012-07-13 12:38:09 -07: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 02:20:52 -07:00
|
|
|
nsRefPtr<LayerManagerComposite> mLayerManager;
|
2013-12-08 17:40:58 -08:00
|
|
|
nsRefPtr<Compositor> mCompositor;
|
2013-04-27 23:46:30 -07:00
|
|
|
RefPtr<AsyncCompositionManager> mCompositionManager;
|
2012-01-06 14:52:32 -08:00
|
|
|
nsIWidget* mWidget;
|
2012-02-06 09:38:23 -08:00
|
|
|
CancelableTask *mCurrentCompositeTask;
|
2012-02-06 10:51:33 -08:00
|
|
|
TimeStamp mLastCompose;
|
2013-05-27 16:47:45 -07:00
|
|
|
TimeStamp mTestTime;
|
|
|
|
bool mIsTesting;
|
2012-02-10 15:06:17 -08:00
|
|
|
#ifdef COMPOSITOR_PERFORMANCE_WARNING
|
2014-03-04 11:41:24 -08:00
|
|
|
TimeStamp mExpectedComposeStartTime;
|
2012-02-10 15:06:17 -08:00
|
|
|
#endif
|
2012-02-06 09:38:23 -08:00
|
|
|
|
|
|
|
bool mPaused;
|
2012-03-19 21:06:56 -07:00
|
|
|
|
2013-04-29 20:16:04 -07:00
|
|
|
bool mUseExternalSurfaceSize;
|
2012-05-08 12:40:41 -07:00
|
|
|
nsIntSize mEGLSurfaceSize;
|
2012-04-24 06:22:34 -07:00
|
|
|
|
2012-05-09 19:32:54 -07:00
|
|
|
mozilla::Monitor mPauseCompositionMonitor;
|
2012-05-29 10:49:03 -07:00
|
|
|
mozilla::Monitor mResumeCompositionMonitor;
|
2012-05-09 19:32:54 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint64_t mCompositorID;
|
2013-07-30 11:03:43 -07:00
|
|
|
uint64_t mRootLayerTreeID;
|
2012-07-13 12:38:09 -07:00
|
|
|
|
2012-11-21 18:40:57 -08:00
|
|
|
bool mOverrideComposeReadiness;
|
|
|
|
CancelableTask* mForceCompositionTask;
|
|
|
|
|
2013-07-30 11:03:40 -07:00
|
|
|
nsRefPtr<APZCTreeManager> mApzcTreeManager;
|
|
|
|
|
2011-12-15 12:07:19 -08:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
|
2011-12-12 07:15:57 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_layers_CompositorParent_h
|