2010-05-24 08:28:51 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
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/. */
|
2010-05-24 08:28:51 -07:00
|
|
|
|
|
|
|
#include "ContainerLayerD3D9.h"
|
2010-11-29 21:51:56 -08:00
|
|
|
#include "gfxUtils.h"
|
|
|
|
#include "nsRect.h"
|
2011-02-16 14:43:30 -08:00
|
|
|
#include "ThebesLayerD3D9.h"
|
|
|
|
#include "ReadbackProcessor.h"
|
2010-05-24 08:28:51 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
template<class Container>
|
|
|
|
static void
|
|
|
|
ContainerInsertAfter(Container* aContainer, Layer* aChild, Layer* aAfter)
|
2010-05-24 08:28:51 -07:00
|
|
|
{
|
2012-08-29 03:52:44 -07:00
|
|
|
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
|
|
|
|
"Child has wrong manager");
|
|
|
|
NS_ASSERTION(!aChild->GetParent(),
|
|
|
|
"aChild already in the tree");
|
|
|
|
NS_ASSERTION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
|
|
|
|
"aChild already has siblings?");
|
|
|
|
NS_ASSERTION(!aAfter ||
|
|
|
|
(aAfter->Manager() == aContainer->Manager() &&
|
|
|
|
aAfter->GetParent() == aContainer),
|
|
|
|
"aAfter is not our child");
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aChild->SetParent(aContainer);
|
2012-08-29 03:52:44 -07:00
|
|
|
if (aAfter == aContainer->mLastChild) {
|
|
|
|
aContainer->mLastChild = aChild;
|
|
|
|
}
|
2010-05-24 08:28:51 -07:00
|
|
|
if (!aAfter) {
|
2012-08-29 03:52:44 -07:00
|
|
|
aChild->SetNextSibling(aContainer->mFirstChild);
|
|
|
|
if (aContainer->mFirstChild) {
|
|
|
|
aContainer->mFirstChild->SetPrevSibling(aChild);
|
2010-05-25 00:37:19 -07:00
|
|
|
}
|
2012-08-29 03:52:44 -07:00
|
|
|
aContainer->mFirstChild = aChild;
|
2010-05-24 19:43:59 -07:00
|
|
|
NS_ADDREF(aChild);
|
2011-07-04 06:15:05 -07:00
|
|
|
aContainer->DidInsertChild(aChild);
|
2010-05-24 08:28:51 -07:00
|
|
|
return;
|
|
|
|
}
|
2012-08-29 03:52:44 -07:00
|
|
|
|
|
|
|
Layer* next = aAfter->GetNextSibling();
|
|
|
|
aChild->SetNextSibling(next);
|
|
|
|
aChild->SetPrevSibling(aAfter);
|
|
|
|
if (next) {
|
|
|
|
next->SetPrevSibling(aChild);
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
2012-08-29 03:52:44 -07:00
|
|
|
aAfter->SetNextSibling(aChild);
|
|
|
|
NS_ADDREF(aChild);
|
|
|
|
aContainer->DidInsertChild(aChild);
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
template<class Container>
|
|
|
|
static void
|
|
|
|
ContainerRemoveChild(Container* aContainer, Layer* aChild)
|
2010-05-24 08:28:51 -07:00
|
|
|
{
|
2012-08-29 03:52:44 -07:00
|
|
|
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
|
|
|
|
"Child has wrong manager");
|
|
|
|
NS_ASSERTION(aChild->GetParent() == aContainer,
|
|
|
|
"aChild not our child");
|
|
|
|
|
|
|
|
Layer* prev = aChild->GetPrevSibling();
|
|
|
|
Layer* next = aChild->GetNextSibling();
|
|
|
|
if (prev) {
|
|
|
|
prev->SetNextSibling(next);
|
|
|
|
} else {
|
|
|
|
aContainer->mFirstChild = next;
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
2012-08-29 03:52:44 -07:00
|
|
|
if (next) {
|
|
|
|
next->SetPrevSibling(prev);
|
|
|
|
} else {
|
|
|
|
aContainer->mLastChild = prev;
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
2012-08-29 03:52:44 -07:00
|
|
|
|
|
|
|
aChild->SetNextSibling(nullptr);
|
|
|
|
aChild->SetPrevSibling(nullptr);
|
|
|
|
aChild->SetParent(nullptr);
|
|
|
|
|
|
|
|
aContainer->DidRemoveChild(aChild);
|
|
|
|
NS_RELEASE(aChild);
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
|
|
|
|
2012-08-29 03:52:55 -07:00
|
|
|
template<class Container>
|
|
|
|
static void
|
|
|
|
ContainerRepositionChild(Container* aContainer, Layer* aChild, Layer* aAfter)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
|
|
|
|
"Child has wrong manager");
|
|
|
|
NS_ASSERTION(aChild->GetParent() == aContainer,
|
|
|
|
"aChild not our child");
|
|
|
|
NS_ASSERTION(!aAfter ||
|
|
|
|
(aAfter->Manager() == aContainer->Manager() &&
|
|
|
|
aAfter->GetParent() == aContainer),
|
|
|
|
"aAfter is not our child");
|
|
|
|
|
|
|
|
Layer* prev = aChild->GetPrevSibling();
|
|
|
|
Layer* next = aChild->GetNextSibling();
|
|
|
|
if (prev == aAfter) {
|
|
|
|
// aChild is already in the correct position, nothing to do.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (prev) {
|
|
|
|
prev->SetNextSibling(next);
|
|
|
|
}
|
|
|
|
if (next) {
|
|
|
|
next->SetPrevSibling(prev);
|
|
|
|
}
|
|
|
|
if (!aAfter) {
|
|
|
|
aChild->SetPrevSibling(nullptr);
|
|
|
|
aChild->SetNextSibling(aContainer->mFirstChild);
|
|
|
|
if (aContainer->mFirstChild) {
|
|
|
|
aContainer->mFirstChild->SetPrevSibling(aChild);
|
|
|
|
}
|
|
|
|
aContainer->mFirstChild = aChild;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Layer* afterNext = aAfter->GetNextSibling();
|
|
|
|
if (afterNext) {
|
|
|
|
afterNext->SetPrevSibling(aChild);
|
|
|
|
} else {
|
|
|
|
aContainer->mLastChild = aChild;
|
|
|
|
}
|
|
|
|
aAfter->SetNextSibling(aChild);
|
|
|
|
aChild->SetPrevSibling(aAfter);
|
|
|
|
aChild->SetNextSibling(afterNext);
|
|
|
|
}
|
|
|
|
|
2010-11-29 21:51:56 -08:00
|
|
|
static inline LayerD3D9*
|
2011-07-04 06:15:05 -07:00
|
|
|
GetNextSibling(LayerD3D9* aLayer)
|
2010-11-29 21:51:56 -08:00
|
|
|
{
|
|
|
|
Layer* layer = aLayer->GetLayer()->GetNextSibling();
|
|
|
|
return layer ? static_cast<LayerD3D9*>(layer->
|
2011-07-04 06:15:05 -07:00
|
|
|
ImplData())
|
2012-07-30 07:20:58 -07:00
|
|
|
: nullptr;
|
2010-11-29 21:51:56 -08:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool
|
2011-01-02 17:48:09 -08:00
|
|
|
HasOpaqueAncestorLayer(Layer* aLayer)
|
|
|
|
{
|
|
|
|
for (Layer* l = aLayer->GetParent(); l; l = l->GetParent()) {
|
|
|
|
if (l->GetContentFlags() & Layer::CONTENT_OPAQUE)
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2011-01-02 17:48:09 -08:00
|
|
|
}
|
2011-10-17 07:59:28 -07:00
|
|
|
return false;
|
2011-01-02 17:48:09 -08:00
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
static inline LayerD3D9*
|
|
|
|
GetNextSiblingD3D9(LayerD3D9* aLayer)
|
|
|
|
{
|
|
|
|
Layer* layer = aLayer->GetLayer()->GetNextSibling();
|
|
|
|
return layer ? static_cast<LayerD3D9*>(layer->
|
|
|
|
ImplData())
|
2012-07-30 07:20:58 -07:00
|
|
|
: nullptr;
|
2011-07-04 06:15:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<class Container>
|
|
|
|
static void
|
|
|
|
ContainerRender(Container* aContainer,
|
|
|
|
LayerManagerD3D9* aManager)
|
2010-05-24 08:28:51 -07:00
|
|
|
{
|
|
|
|
nsRefPtr<IDirect3DSurface9> previousRenderTarget;
|
|
|
|
nsRefPtr<IDirect3DTexture9> renderTexture;
|
|
|
|
float previousRenderTargetOffset[4];
|
|
|
|
float renderTargetOffset[] = { 0, 0, 0, 0 };
|
|
|
|
float oldViewMatrix[4][4];
|
|
|
|
|
2011-02-24 23:44:22 -08:00
|
|
|
RECT containerD3D9ClipRect;
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->GetScissorRect(&containerD3D9ClipRect);
|
2011-02-24 23:44:22 -08:00
|
|
|
// Convert scissor to an nsIntRect. RECT's are exclusive on the bottom and
|
|
|
|
// right values.
|
|
|
|
nsIntRect oldScissor(containerD3D9ClipRect.left,
|
|
|
|
containerD3D9ClipRect.top,
|
|
|
|
containerD3D9ClipRect.right - containerD3D9ClipRect.left,
|
|
|
|
containerD3D9ClipRect.bottom - containerD3D9ClipRect.top);
|
2011-01-24 10:57:19 -08:00
|
|
|
|
2011-02-16 14:43:30 -08:00
|
|
|
ReadbackProcessor readback;
|
2011-07-04 06:15:05 -07:00
|
|
|
readback.BuildUpdates(aContainer);
|
2011-02-16 14:43:30 -08:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
nsIntRect visibleRect = aContainer->GetEffectiveVisibleRegion().GetBounds();
|
2011-09-28 23:19:26 -07:00
|
|
|
bool useIntermediate = aContainer->UseIntermediateSurface();
|
2010-05-24 08:28:51 -07:00
|
|
|
|
2011-10-17 07:59:28 -07:00
|
|
|
aContainer->mSupportsComponentAlphaChildren = false;
|
2010-05-24 08:28:51 -07:00
|
|
|
if (useIntermediate) {
|
2012-07-03 17:26:18 -07:00
|
|
|
nsRefPtr<IDirect3DSurface9> renderSurface;
|
2012-08-13 03:10:10 -07:00
|
|
|
if (!aManager->CompositingDisabled()) {
|
|
|
|
aManager->device()->GetRenderTarget(0, getter_AddRefs(previousRenderTarget));
|
|
|
|
HRESULT hr = aManager->device()->CreateTexture(visibleRect.width, visibleRect.height, 1,
|
|
|
|
D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
|
|
|
|
D3DPOOL_DEFAULT, getter_AddRefs(renderTexture),
|
|
|
|
NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
aManager->ReportFailure(NS_LITERAL_CSTRING("ContainerLayerD3D9::ContainerRender(): Failed to create texture"),
|
|
|
|
hr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
renderTexture->GetSurfaceLevel(0, getter_AddRefs(renderSurface));
|
|
|
|
aManager->device()->SetRenderTarget(0, renderSurface);
|
|
|
|
}
|
2012-07-03 17:26:18 -07:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
if (aContainer->mVisibleRegion.GetNumRects() == 1 &&
|
|
|
|
(aContainer->GetContentFlags() & aContainer->CONTENT_OPAQUE)) {
|
2011-01-02 17:48:09 -08:00
|
|
|
// don't need a background, we're going to paint all opaque stuff
|
2011-10-17 07:59:28 -07:00
|
|
|
aContainer->mSupportsComponentAlphaChildren = true;
|
2011-01-02 17:48:09 -08:00
|
|
|
} else {
|
2011-07-04 06:15:05 -07:00
|
|
|
const gfx3DMatrix& transform3D = aContainer->GetEffectiveTransform();
|
2011-01-02 17:48:09 -08:00
|
|
|
gfxMatrix transform;
|
|
|
|
// If we have an opaque ancestor layer, then we can be sure that
|
|
|
|
// all the pixels we draw into are either opaque already or will be
|
|
|
|
// covered by something opaque. Otherwise copying up the background is
|
|
|
|
// not safe.
|
|
|
|
HRESULT hr = E_FAIL;
|
2011-07-04 06:15:05 -07:00
|
|
|
if (HasOpaqueAncestorLayer(aContainer) &&
|
2011-01-02 17:48:09 -08:00
|
|
|
transform3D.Is2D(&transform) && !transform.HasNonIntegerTranslation()) {
|
|
|
|
// Copy background up from below
|
|
|
|
RECT dest = { 0, 0, visibleRect.width, visibleRect.height };
|
|
|
|
RECT src = dest;
|
|
|
|
::OffsetRect(&src,
|
2012-08-22 08:56:38 -07:00
|
|
|
visibleRect.x + int32_t(transform.x0),
|
|
|
|
visibleRect.y + int32_t(transform.y0));
|
2012-08-13 03:10:10 -07:00
|
|
|
if (!aManager->CompositingDisabled()) {
|
|
|
|
hr = aManager->device()->
|
|
|
|
StretchRect(previousRenderTarget, &src, renderSurface, &dest, D3DTEXF_NONE);
|
|
|
|
}
|
2011-01-02 17:48:09 -08:00
|
|
|
}
|
|
|
|
if (hr == S_OK) {
|
2011-10-17 07:59:28 -07:00
|
|
|
aContainer->mSupportsComponentAlphaChildren = true;
|
2012-08-13 03:10:10 -07:00
|
|
|
} else if (!aManager->CompositingDisabled()) {
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->
|
|
|
|
Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_RGBA(0, 0, 0, 0), 0, 0);
|
2011-01-02 17:48:09 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->
|
|
|
|
GetVertexShaderConstantF(CBvRenderTargetOffset, previousRenderTargetOffset, 1);
|
2010-05-31 16:29:37 -07:00
|
|
|
renderTargetOffset[0] = (float)visibleRect.x;
|
|
|
|
renderTargetOffset[1] = (float)visibleRect.y;
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->
|
|
|
|
SetVertexShaderConstantF(CBvRenderTargetOffset, renderTargetOffset, 1);
|
2010-05-24 08:28:51 -07:00
|
|
|
|
2010-10-01 15:24:58 -07:00
|
|
|
gfx3DMatrix viewMatrix;
|
2010-05-24 08:28:51 -07:00
|
|
|
/*
|
2010-05-28 20:27:03 -07:00
|
|
|
* Matrix to transform to viewport space ( <-1.0, 1.0> topleft,
|
2010-05-24 08:28:51 -07:00
|
|
|
* <1.0, -1.0> bottomright)
|
|
|
|
*/
|
2010-10-01 15:24:58 -07:00
|
|
|
viewMatrix._11 = 2.0f / visibleRect.width;
|
|
|
|
viewMatrix._22 = -2.0f / visibleRect.height;
|
|
|
|
viewMatrix._41 = -1.0f;
|
|
|
|
viewMatrix._42 = 1.0f;
|
2010-05-28 20:27:03 -07:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->
|
|
|
|
GetVertexShaderConstantF(CBmProjection, &oldViewMatrix[0][0], 4);
|
|
|
|
aManager->device()->
|
|
|
|
SetVertexShaderConstantF(CBmProjection, &viewMatrix._11, 4);
|
2010-11-29 22:02:46 -08:00
|
|
|
} else {
|
2011-07-04 06:15:05 -07:00
|
|
|
aContainer->mSupportsComponentAlphaChildren =
|
|
|
|
(aContainer->GetContentFlags() & aContainer->CONTENT_OPAQUE) ||
|
|
|
|
(aContainer->mParent &&
|
|
|
|
aContainer->mParent->SupportsComponentAlphaChildren());
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
|
|
|
|
2011-10-06 14:24:32 -07:00
|
|
|
nsAutoTArray<Layer*, 12> children;
|
|
|
|
aContainer->SortChildrenBy3DZOrder(children);
|
|
|
|
|
2010-05-24 08:28:51 -07:00
|
|
|
/*
|
|
|
|
* Render this container's contents.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
for (uint32_t i = 0; i < children.Length(); i++) {
|
2011-10-06 14:24:32 -07:00
|
|
|
LayerD3D9* layerToRender = static_cast<LayerD3D9*>(children.ElementAt(i)->ImplData());
|
2010-11-29 21:51:56 -08:00
|
|
|
|
2011-02-24 23:44:22 -08:00
|
|
|
if (layerToRender->GetLayer()->GetEffectiveVisibleRegion().IsEmpty()) {
|
2010-11-29 21:51:56 -08:00
|
|
|
continue;
|
|
|
|
}
|
2011-02-24 23:44:22 -08:00
|
|
|
|
|
|
|
nsIntRect scissorRect =
|
2012-07-30 07:20:58 -07:00
|
|
|
layerToRender->GetLayer()->CalculateScissorRect(oldScissor, nullptr);
|
2011-02-24 23:44:22 -08:00
|
|
|
if (scissorRect.IsEmpty()) {
|
|
|
|
continue;
|
2010-10-21 13:41:04 -07:00
|
|
|
}
|
|
|
|
|
2011-02-24 23:44:22 -08:00
|
|
|
RECT d3drect;
|
|
|
|
d3drect.left = scissorRect.x;
|
|
|
|
d3drect.top = scissorRect.y;
|
|
|
|
d3drect.right = scissorRect.x + scissorRect.width;
|
|
|
|
d3drect.bottom = scissorRect.y + scissorRect.height;
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->SetScissorRect(&d3drect);
|
2011-02-24 23:44:22 -08:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
if (layerToRender->GetLayer()->GetType() == aContainer->TYPE_THEBES) {
|
2011-02-16 14:43:30 -08:00
|
|
|
static_cast<ThebesLayerD3D9*>(layerToRender)->RenderThebesLayer(&readback);
|
|
|
|
} else {
|
|
|
|
layerToRender->RenderLayer();
|
|
|
|
}
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
2011-02-24 23:44:22 -08:00
|
|
|
|
2012-08-13 03:10:10 -07:00
|
|
|
if (useIntermediate && !aManager->CompositingDisabled()) {
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->SetRenderTarget(0, previousRenderTarget);
|
|
|
|
aManager->device()->SetVertexShaderConstantF(CBvRenderTargetOffset, previousRenderTargetOffset, 1);
|
|
|
|
aManager->device()->SetVertexShaderConstantF(CBmProjection, &oldViewMatrix[0][0], 4);
|
2010-05-24 08:28:51 -07:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->SetVertexShaderConstantF(CBvLayerQuad,
|
2010-10-01 15:24:58 -07:00
|
|
|
ShaderConstantRect(visibleRect.x,
|
|
|
|
visibleRect.y,
|
|
|
|
visibleRect.width,
|
|
|
|
visibleRect.height),
|
|
|
|
1);
|
2010-05-24 08:28:51 -07:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aContainer->SetShaderTransformAndOpacity();
|
2012-03-06 13:07:48 -08:00
|
|
|
aManager->SetShaderMode(DeviceManagerD3D9::RGBALAYER,
|
|
|
|
aContainer->GetMaskLayer(),
|
|
|
|
aContainer->GetTransform().CanDraw2D());
|
2010-05-24 08:28:51 -07:00
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->SetTexture(0, renderTexture);
|
2013-03-07 18:18:04 -08:00
|
|
|
aManager->device()->SetScissorRect(&containerD3D9ClipRect);
|
2011-07-04 06:15:05 -07:00
|
|
|
aManager->device()->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
2013-03-07 18:18:04 -08:00
|
|
|
} else {
|
|
|
|
aManager->device()->SetScissorRect(&containerD3D9ClipRect);
|
2011-07-04 06:15:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ContainerLayerD3D9::ContainerLayerD3D9(LayerManagerD3D9 *aManager)
|
|
|
|
: ContainerLayer(aManager, NULL)
|
|
|
|
, LayerD3D9(aManager)
|
|
|
|
{
|
|
|
|
mImplData = static_cast<LayerD3D9*>(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
ContainerLayerD3D9::~ContainerLayerD3D9()
|
|
|
|
{
|
|
|
|
while (mFirstChild) {
|
|
|
|
RemoveChild(mFirstChild);
|
2010-05-24 08:28:51 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
void
|
|
|
|
ContainerLayerD3D9::InsertAfter(Layer* aChild, Layer* aAfter)
|
|
|
|
{
|
|
|
|
ContainerInsertAfter(this, aChild, aAfter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContainerLayerD3D9::RemoveChild(Layer *aChild)
|
|
|
|
{
|
|
|
|
ContainerRemoveChild(this, aChild);
|
|
|
|
}
|
|
|
|
|
2012-08-29 03:52:55 -07:00
|
|
|
void
|
|
|
|
ContainerLayerD3D9::RepositionChild(Layer* aChild, Layer* aAfter)
|
|
|
|
{
|
|
|
|
ContainerRepositionChild(this, aChild, aAfter);
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
Layer*
|
|
|
|
ContainerLayerD3D9::GetLayer()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerD3D9*
|
|
|
|
ContainerLayerD3D9::GetFirstChildD3D9()
|
|
|
|
{
|
|
|
|
if (!mFirstChild) {
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2011-07-04 06:15:05 -07:00
|
|
|
}
|
|
|
|
return static_cast<LayerD3D9*>(mFirstChild->ImplData());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContainerLayerD3D9::RenderLayer()
|
|
|
|
{
|
|
|
|
ContainerRender(this, mD3DManager);
|
|
|
|
}
|
|
|
|
|
2010-09-15 15:15:49 -07:00
|
|
|
void
|
|
|
|
ContainerLayerD3D9::LayerManagerDestroyed()
|
|
|
|
{
|
|
|
|
while (mFirstChild) {
|
|
|
|
GetFirstChildD3D9()->LayerManagerDestroyed();
|
|
|
|
RemoveChild(mFirstChild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
ShadowContainerLayerD3D9::ShadowContainerLayerD3D9(LayerManagerD3D9 *aManager)
|
|
|
|
: ShadowContainerLayer(aManager, NULL)
|
|
|
|
, LayerD3D9(aManager)
|
|
|
|
{
|
|
|
|
mImplData = static_cast<LayerD3D9*>(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
ShadowContainerLayerD3D9::~ShadowContainerLayerD3D9()
|
|
|
|
{
|
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowContainerLayerD3D9::InsertAfter(Layer* aChild, Layer* aAfter)
|
|
|
|
{
|
|
|
|
ContainerInsertAfter(this, aChild, aAfter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowContainerLayerD3D9::RemoveChild(Layer *aChild)
|
|
|
|
{
|
|
|
|
ContainerRemoveChild(this, aChild);
|
|
|
|
}
|
|
|
|
|
2012-08-29 03:52:55 -07:00
|
|
|
void
|
|
|
|
ShadowContainerLayerD3D9::RepositionChild(Layer* aChild, Layer* aAfter)
|
|
|
|
{
|
|
|
|
ContainerRepositionChild(this, aChild, aAfter);
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:15:05 -07:00
|
|
|
void
|
|
|
|
ShadowContainerLayerD3D9::Destroy()
|
|
|
|
{
|
|
|
|
while (mFirstChild) {
|
|
|
|
RemoveChild(mFirstChild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerD3D9*
|
|
|
|
ShadowContainerLayerD3D9::GetFirstChildD3D9()
|
|
|
|
{
|
|
|
|
if (!mFirstChild) {
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2011-07-04 06:15:05 -07:00
|
|
|
}
|
|
|
|
return static_cast<LayerD3D9*>(mFirstChild->ImplData());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ShadowContainerLayerD3D9::RenderLayer()
|
|
|
|
{
|
|
|
|
ContainerRender(this, mD3DManager);
|
|
|
|
}
|
|
|
|
|
2010-05-24 08:28:51 -07:00
|
|
|
} /* layers */
|
|
|
|
} /* mozilla */
|