2012-07-17 16:59:45 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 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/. */
|
2012-01-19 06:45:37 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_layers_CompositorChild_h
|
|
|
|
#define mozilla_layers_CompositorChild_h
|
|
|
|
|
|
|
|
#include "mozilla/layers/PCompositorChild.h"
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "nsXULAppAPI.h"
|
2012-01-19 06:45:37 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class LayerManager;
|
|
|
|
class CompositorParent;
|
|
|
|
|
|
|
|
class CompositorChild : public PCompositorChild
|
|
|
|
{
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(CompositorChild)
|
|
|
|
public:
|
|
|
|
CompositorChild(LayerManager *aLayerManager);
|
|
|
|
virtual ~CompositorChild();
|
|
|
|
|
|
|
|
void Destroy();
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
/**
|
|
|
|
* We're asked to create a new Compositor in response to an Opens()
|
|
|
|
* or Bridge() request from our parent process. The Transport is to
|
|
|
|
* the compositor's context.
|
|
|
|
*/
|
|
|
|
static PCompositorChild*
|
|
|
|
Create(Transport* aTransport, ProcessId aOtherProcess);
|
|
|
|
|
|
|
|
static PCompositorChild* Get();
|
|
|
|
|
2012-01-19 06:45:37 -08:00
|
|
|
protected:
|
2012-07-17 16:59:45 -07:00
|
|
|
virtual PLayersChild* AllocPLayers(const LayersBackend &aBackend, const uint64_t& aId, int* aMaxTextureSize);
|
2012-01-19 06:45:37 -08:00
|
|
|
virtual bool DeallocPLayers(PLayersChild *aChild);
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
|
|
|
|
2012-01-19 06:45:37 -08:00
|
|
|
private:
|
|
|
|
nsRefPtr<LayerManager> mLayerManager;
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
// When we're in a child process, this is the process-global
|
|
|
|
// compositor that we use to forward transactions directly to the
|
|
|
|
// compositor context in another process.
|
|
|
|
static CompositorChild* sCompositor;
|
|
|
|
|
2012-01-19 06:45:37 -08:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(CompositorChild);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_layers_CompositorChild_h
|