2010-08-07 09:09:18 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 15:12:37 +04: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-03-30 08:48:52 +04:00
|
|
|
|
|
|
|
#ifndef GFX_CONTAINERLAYEROGL_H
|
|
|
|
#define GFX_CONTAINERLAYEROGL_H
|
|
|
|
|
|
|
|
#include "Layers.h"
|
|
|
|
#include "LayerManagerOGL.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2010-10-14 02:55:45 +04:00
|
|
|
template<class Container>
|
|
|
|
static void ContainerInsertAfter(Container* aContainer, Layer* aChild, Layer* aAfter);
|
|
|
|
template<class Container>
|
|
|
|
static void ContainerRemoveChild(Container* aContainer, Layer* aChild);
|
|
|
|
template<class Container>
|
2012-08-29 14:52:55 +04:00
|
|
|
static void ContainerRepositionChild(Container* aContainer, Layer* aChild, Layer* aAfter);
|
|
|
|
template<class Container>
|
2010-10-14 02:55:45 +04:00
|
|
|
static void ContainerDestroy(Container* aContainer);
|
|
|
|
template<class Container>
|
|
|
|
static void ContainerRender(Container* aContainer,
|
|
|
|
int aPreviousFrameBuffer,
|
|
|
|
const nsIntPoint& aOffset,
|
|
|
|
LayerManagerOGL* aManager);
|
|
|
|
|
2010-11-08 12:06:15 +03:00
|
|
|
class ContainerLayerOGL : public ContainerLayer,
|
2010-03-30 08:48:52 +04:00
|
|
|
public LayerOGL
|
|
|
|
{
|
2010-10-14 02:55:45 +04:00
|
|
|
template<class Container>
|
|
|
|
friend void ContainerInsertAfter(Container* aContainer, Layer* aChild, Layer* aAfter);
|
|
|
|
template<class Container>
|
|
|
|
friend void ContainerRemoveChild(Container* aContainer, Layer* aChild);
|
|
|
|
template<class Container>
|
2012-08-29 14:52:55 +04:00
|
|
|
friend void ContainerRepositionChild(Container* aContainer, Layer* aChild, Layer* aAfter);
|
|
|
|
template<class Container>
|
2010-10-14 02:55:45 +04:00
|
|
|
friend void ContainerDestroy(Container* aContainer);
|
|
|
|
template<class Container>
|
|
|
|
friend void ContainerRender(Container* aContainer,
|
|
|
|
int aPreviousFrameBuffer,
|
|
|
|
const nsIntPoint& aOffset,
|
|
|
|
LayerManagerOGL* aManager);
|
|
|
|
|
2010-03-30 08:48:52 +04:00
|
|
|
public:
|
2010-04-27 06:09:47 +04:00
|
|
|
ContainerLayerOGL(LayerManagerOGL *aManager);
|
2010-05-21 07:20:48 +04:00
|
|
|
~ContainerLayerOGL();
|
2010-03-30 08:48:52 +04:00
|
|
|
|
|
|
|
void InsertAfter(Layer* aChild, Layer* aAfter);
|
|
|
|
|
|
|
|
void RemoveChild(Layer* aChild);
|
|
|
|
|
2012-08-29 14:52:55 +04:00
|
|
|
void RepositionChild(Layer* aChild, Layer* aAfter);
|
|
|
|
|
2010-03-30 08:48:52 +04:00
|
|
|
/** LayerOGL implementation */
|
2010-10-14 02:55:45 +04:00
|
|
|
Layer* GetLayer() { return this; }
|
2010-03-30 08:48:52 +04:00
|
|
|
|
2010-08-07 09:09:18 +04:00
|
|
|
void Destroy();
|
|
|
|
|
2010-03-30 08:48:52 +04:00
|
|
|
LayerOGL* GetFirstChildOGL();
|
|
|
|
|
2010-10-14 02:55:45 +04:00
|
|
|
virtual void RenderLayer(int aPreviousFrameBuffer,
|
2010-11-08 12:06:15 +03:00
|
|
|
const nsIntPoint& aOffset);
|
|
|
|
|
|
|
|
virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface)
|
|
|
|
{
|
|
|
|
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
|
|
|
}
|
2012-01-16 09:41:55 +04:00
|
|
|
|
|
|
|
virtual void CleanupResources();
|
2010-10-14 02:55:45 +04:00
|
|
|
};
|
|
|
|
|
2010-03-30 08:48:52 +04:00
|
|
|
} /* layers */
|
|
|
|
} /* mozilla */
|
|
|
|
|
|
|
|
#endif /* GFX_CONTAINERLAYEROGL_H */
|