mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
[Bug 774505] Don't include Layers.h everywhere r=cjones
This commit is contained in:
parent
77c3bf67cc
commit
9a61d96c70
@ -19,9 +19,9 @@
|
||||
#include "nsIURI.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsFrameMessageManager.h"
|
||||
#include "Layers.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "Layers.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsSubDocumentFrame;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIObserver.h"
|
||||
|
||||
#include "GLContextProvider.h"
|
||||
#include "Layers.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
|
@ -196,9 +196,12 @@ destroying the nsBuiltinDecoder object.
|
||||
#include "nsMediaDecoder.h"
|
||||
#include "nsHTMLMediaElement.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
|
||||
#include "ImageLayers.h"
|
||||
class nsAudioStream;
|
||||
|
||||
typedef mozilla::layers::Image Image;
|
||||
typedef mozilla::layers::ImageContainer ImageContainer;
|
||||
|
||||
static inline bool IsCurrentThread(nsIThread* aThread) {
|
||||
return NS_GetCurrentThread() == aThread;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsBuiltinDecoderReader_h_
|
||||
|
||||
#include <nsDeque.h>
|
||||
#include "ImageLayers.h"
|
||||
#include "nsSize.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
#include "MediaStreamGraph.h"
|
||||
|
@ -550,11 +550,11 @@ void nsBuiltinDecoderStateMachine::SendOutputStreamAudio(AudioData* aAudio,
|
||||
aStream->mAudioFramesWritten += aAudio->mFrames - PRInt32(offset);
|
||||
}
|
||||
|
||||
static void WriteVideoToMediaStream(Image* aImage,
|
||||
static void WriteVideoToMediaStream(mozilla::layers::Image* aImage,
|
||||
PRInt64 aDuration, const gfxIntSize& aIntrinsicSize,
|
||||
VideoSegment* aOutput)
|
||||
{
|
||||
nsRefPtr<Image> image = aImage;
|
||||
nsRefPtr<mozilla::layers::Image> image = aImage;
|
||||
aOutput->AppendFrame(image.forget(), aDuration, aIntrinsicSize);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#if !defined(nsMediaDecoder_h_)
|
||||
#define nsMediaDecoder_h_
|
||||
|
||||
#include "ImageLayers.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
#include "VideoFrameContainer.h"
|
||||
#include "MediaStreamGraph.h"
|
||||
@ -38,8 +37,6 @@ static const PRUint32 FRAMEBUFFER_LENGTH_MAX = 16384;
|
||||
class nsMediaDecoder : public nsIObserver
|
||||
{
|
||||
public:
|
||||
typedef mozilla::layers::Image Image;
|
||||
typedef mozilla::layers::ImageContainer ImageContainer;
|
||||
typedef mozilla::MediaResource MediaResource;
|
||||
typedef mozilla::ReentrantMonitor ReentrantMonitor;
|
||||
typedef mozilla::SourceMediaStream SourceMediaStream;
|
||||
@ -368,7 +365,7 @@ public:
|
||||
virtual PRInt64 AudioQueueMemoryInUse() = 0;
|
||||
|
||||
VideoFrameContainer* GetVideoFrameContainer() { return mVideoFrameContainer; }
|
||||
ImageContainer* GetImageContainer()
|
||||
mozilla::layers::ImageContainer* GetImageContainer()
|
||||
{
|
||||
return mVideoFrameContainer ? mVideoFrameContainer->GetImageContainer() : nsnull;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsDOMEventTargetHelper.h"
|
||||
#include "nsIDOMBluetoothManager.h"
|
||||
#include "mozilla/Observer.h"
|
||||
#include "nsIEventTarget.h"
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "FileCommon.h"
|
||||
|
||||
#include "nsIRequestObserver.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
class nsIFileStorage;
|
||||
|
||||
|
@ -20,7 +20,7 @@ include "IPC/nsGUIEventIPC.h";
|
||||
|
||||
using IPC::URI;
|
||||
using gfxMatrix;
|
||||
using mozilla::LayersBackend;
|
||||
using mozilla::layers::LayersBackend;
|
||||
using mozilla::WindowsHandle;
|
||||
using nscolor;
|
||||
using nsCompositionEvent;
|
||||
|
@ -1030,7 +1030,7 @@ TabChild::InitWidget(const nsIntSize& size)
|
||||
nsnull // nsDeviceContext
|
||||
);
|
||||
|
||||
LayerManager::LayersBackend be;
|
||||
LayersBackend be;
|
||||
uint64_t id;
|
||||
int32_t maxTextureSize;
|
||||
RenderFrameChild* remoteFrame =
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#include "nsIOSurface.h"
|
||||
@ -133,9 +134,9 @@ public:
|
||||
virtual already_AddRefed<gfxASurface> GetAsSurface() = 0;
|
||||
virtual gfxIntSize GetSize() = 0;
|
||||
|
||||
ImageBackendData* GetBackendData(LayerManager::LayersBackend aBackend)
|
||||
ImageBackendData* GetBackendData(LayersBackend aBackend)
|
||||
{ return mBackendData[aBackend]; }
|
||||
void SetBackendData(LayerManager::LayersBackend aBackend, ImageBackendData* aData)
|
||||
void SetBackendData(LayersBackend aBackend, ImageBackendData* aData)
|
||||
{ mBackendData[aBackend] = aData; }
|
||||
|
||||
protected:
|
||||
@ -144,7 +145,7 @@ protected:
|
||||
mFormat(aFormat)
|
||||
{}
|
||||
|
||||
nsAutoPtr<ImageBackendData> mBackendData[LayerManager::LAYERS_LAST];
|
||||
nsAutoPtr<ImageBackendData> mBackendData[mozilla::layers::LAYERS_LAST];
|
||||
|
||||
void* mImplData;
|
||||
Format mFormat;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "DirectedGraph.h"
|
||||
#include "limits.h"
|
||||
#include "gfxLineSegment.h"
|
||||
#include "Layers.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
@ -6,11 +6,13 @@
|
||||
#ifndef GFX_LAYERSORTER_H
|
||||
#define GFX_LAYERSORTER_H
|
||||
|
||||
#include "Layers.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class Layer;
|
||||
|
||||
void SortLayersBy3DZOrder(nsTArray<Layer*>& aLayers);
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "gfxPattern.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "LayersBackend.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
@ -200,15 +200,6 @@ class THEBES_API LayerManager {
|
||||
NS_INLINE_DECL_REFCOUNTING(LayerManager)
|
||||
|
||||
public:
|
||||
enum LayersBackend {
|
||||
LAYERS_NONE = 0,
|
||||
LAYERS_BASIC,
|
||||
LAYERS_OPENGL,
|
||||
LAYERS_D3D9,
|
||||
LAYERS_D3D10,
|
||||
LAYERS_LAST
|
||||
};
|
||||
|
||||
LayerManager() : mDestroyed(false), mSnapEffectiveTransforms(true), mId(0)
|
||||
{
|
||||
InitLog();
|
||||
@ -508,7 +499,7 @@ public:
|
||||
static bool IsLogEnabled();
|
||||
static PRLogModuleInfo* GetLog() { return sLog; }
|
||||
|
||||
bool IsCompositingCheap(LayerManager::LayersBackend aBackend)
|
||||
bool IsCompositingCheap(LayersBackend aBackend)
|
||||
{ return LAYERS_BASIC != aBackend; }
|
||||
|
||||
virtual bool IsCompositingCheap() { return true; }
|
||||
|
22
gfx/layers/LayersBackend.h
Normal file
22
gfx/layers/LayersBackend.h
Normal file
@ -0,0 +1,22 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* 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/. */
|
||||
|
||||
#ifndef GFX_LAYERSBACKEND_H
|
||||
#define GFX_LAYERSBACKEND_H
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
enum LayersBackend {
|
||||
LAYERS_NONE = 0,
|
||||
LAYERS_BASIC,
|
||||
LAYERS_OPENGL,
|
||||
LAYERS_D3D9,
|
||||
LAYERS_D3D10,
|
||||
LAYERS_LAST
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GFX_LAYERSBACKEND_H */
|
@ -33,6 +33,7 @@ EXPORTS = \
|
||||
BasicImplData.h \
|
||||
ImageLayers.h \
|
||||
Layers.h \
|
||||
LayersBackend.h \
|
||||
LayerManagerOGLShaders.h \
|
||||
LayerManagerOGL.h \
|
||||
LayerManagerOGLProgram.h \
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "BasicLayersImpl.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
@ -374,7 +375,7 @@ BasicShadowableCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
|
||||
}
|
||||
|
||||
if (mGLContext &&
|
||||
BasicManager()->GetParentBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
BasicManager()->GetParentBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
TextureImage::TextureShareType flags;
|
||||
// if process type is default, then it is single-process (non-e10s)
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
||||
|
@ -1133,7 +1133,7 @@ BasicShadowLayerManager::CreateThebesLayer()
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
#ifdef FORCE_BASICTILEDTHEBESLAYER
|
||||
if (HasShadowManager() && GetParentBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
if (HasShadowManager() && GetParentBackendType() == LAYERS_OPENGL) {
|
||||
// BasicTiledThebesLayer doesn't support main
|
||||
// thread compositing so only return this layer
|
||||
// type if we have a shadow manager.
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
|
||||
static already_AddRefed<ID3D10Texture2D>
|
||||
DataToTexture(ID3D10Device *aDevice,
|
||||
unsigned char *data,
|
||||
@ -22,13 +22,13 @@ DataToTexture(ID3D10Device *aDevice,
|
||||
const gfxIntSize &aSize)
|
||||
{
|
||||
D3D10_SUBRESOURCE_DATA srdata;
|
||||
|
||||
|
||||
CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM,
|
||||
aSize.width,
|
||||
aSize.height,
|
||||
1, 1);
|
||||
desc.Usage = D3D10_USAGE_IMMUTABLE;
|
||||
|
||||
|
||||
srdata.pSysMem = data;
|
||||
srdata.SysMemPitch = stride;
|
||||
|
||||
@ -99,14 +99,14 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
||||
if (aImage->GetFormat() == Image::REMOTE_IMAGE_BITMAP) {
|
||||
RemoteBitmapImage *remoteImage =
|
||||
static_cast<RemoteBitmapImage*>(aImage);
|
||||
|
||||
if (!aImage->GetBackendData(LayerManager::LAYERS_D3D10)) {
|
||||
|
||||
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
|
||||
nsAutoPtr<TextureD3D10BackendData> dat(new TextureD3D10BackendData());
|
||||
dat->mTexture = DataToTexture(device(), remoteImage->mData, remoteImage->mStride, remoteImage->mSize);
|
||||
|
||||
if (dat->mTexture) {
|
||||
device()->CreateShaderResourceView(dat->mTexture, NULL, getter_AddRefs(dat->mSRView));
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D10, dat.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,13 +126,13 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (!aImage->GetBackendData(LayerManager::LAYERS_D3D10)) {
|
||||
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
|
||||
nsAutoPtr<TextureD3D10BackendData> dat(new TextureD3D10BackendData());
|
||||
dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
|
||||
|
||||
if (dat->mTexture) {
|
||||
device()->CreateShaderResourceView(dat->mTexture, NULL, getter_AddRefs(dat->mSRView));
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D10, dat.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
||||
}
|
||||
|
||||
TextureD3D10BackendData *data =
|
||||
static_cast<TextureD3D10BackendData*>(aImage->GetBackendData(LayerManager::LAYERS_D3D10));
|
||||
static_cast<TextureD3D10BackendData*>(aImage->GetBackendData(mozilla::layers::LAYERS_D3D10));
|
||||
|
||||
if (!data) {
|
||||
return nsnull;
|
||||
@ -201,7 +201,7 @@ ImageLayerD3D10::RenderLayer()
|
||||
if (!srView) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
PRUint8 shaderFlags = SHADER_PREMUL;
|
||||
shaderFlags |= LoadMaskTexture();
|
||||
shaderFlags |= hasAlpha
|
||||
@ -228,12 +228,12 @@ ImageLayerD3D10::RenderLayer()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!yuvImage->GetBackendData(LayerManager::LAYERS_D3D10)) {
|
||||
if (!yuvImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
|
||||
AllocateTexturesYCbCr(yuvImage);
|
||||
}
|
||||
|
||||
PlanarYCbCrD3D10BackendData *data =
|
||||
static_cast<PlanarYCbCrD3D10BackendData*>(yuvImage->GetBackendData(LayerManager::LAYERS_D3D10));
|
||||
static_cast<PlanarYCbCrD3D10BackendData*>(yuvImage->GetBackendData(mozilla::layers::LAYERS_D3D10));
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
@ -367,7 +367,7 @@ void ImageLayerD3D10::AllocateTexturesYCbCr(PlanarYCbCrImage *aImage)
|
||||
device()->CreateShaderResourceView(backendData->mCbTexture, NULL, getter_AddRefs(backendData->mCbView));
|
||||
device()->CreateShaderResourceView(backendData->mCrTexture, NULL, getter_AddRefs(backendData->mCrView));
|
||||
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D10, backendData.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, backendData.forget());
|
||||
}
|
||||
|
||||
already_AddRefed<ID3D10ShaderResourceView>
|
||||
@ -469,9 +469,9 @@ RemoteDXGITextureImage::GetAsSurface()
|
||||
TextureD3D10BackendData*
|
||||
RemoteDXGITextureImage::GetD3D10TextureBackendData(ID3D10Device *aDevice)
|
||||
{
|
||||
if (GetBackendData(LayerManager::LAYERS_D3D10)) {
|
||||
if (GetBackendData(mozilla::layers::LAYERS_D3D10)) {
|
||||
TextureD3D10BackendData *data =
|
||||
static_cast<TextureD3D10BackendData*>(GetBackendData(LayerManager::LAYERS_D3D10));
|
||||
static_cast<TextureD3D10BackendData*>(GetBackendData(mozilla::layers::LAYERS_D3D10));
|
||||
|
||||
nsRefPtr<ID3D10Device> device;
|
||||
data->mTexture->GetDevice(getter_AddRefs(device));
|
||||
@ -494,7 +494,7 @@ RemoteDXGITextureImage::GetD3D10TextureBackendData(ID3D10Device *aDevice)
|
||||
|
||||
aDevice->CreateShaderResourceView(texture, NULL, getter_AddRefs(data->mSRView));
|
||||
|
||||
SetBackendData(LayerManager::LAYERS_D3D10, data);
|
||||
SetBackendData(mozilla::layers::LAYERS_D3D10, data);
|
||||
|
||||
return data.forget();
|
||||
}
|
||||
|
@ -55,8 +55,6 @@ extern cairo_user_data_key_t gKeyD3D10Texture;
|
||||
class THEBES_API LayerManagerD3D10 : public ShadowLayerManager,
|
||||
public ShadowLayerForwarder {
|
||||
public:
|
||||
typedef LayerManager::LayersBackend LayersBackend;
|
||||
|
||||
LayerManagerD3D10(nsIWidget *aWidget);
|
||||
virtual ~LayerManagerD3D10();
|
||||
|
||||
|
@ -279,7 +279,7 @@ static void AllocateTexturesYCbCr(PlanarYCbCrImage *aImage,
|
||||
backendData->mCrTexture->UnlockRect(0);
|
||||
}
|
||||
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D9, backendData.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D9, backendData.forget());
|
||||
}
|
||||
|
||||
Layer*
|
||||
@ -304,11 +304,11 @@ ImageLayerD3D9::GetTexture(Image *aImage, bool& aHasAlpha)
|
||||
RemoteBitmapImage *remoteImage =
|
||||
static_cast<RemoteBitmapImage*>(aImage);
|
||||
|
||||
if (!aImage->GetBackendData(LayerManager::LAYERS_D3D9)) {
|
||||
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
|
||||
nsAutoPtr<TextureD3D9BackendData> dat(new TextureD3D9BackendData());
|
||||
dat->mTexture = DataToTexture(device(), remoteImage->mData, remoteImage->mStride, remoteImage->mSize, D3DFMT_A8R8G8B8);
|
||||
if (dat->mTexture) {
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D9, dat.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D9, dat.forget());
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,11 +321,11 @@ ImageLayerD3D9::GetTexture(Image *aImage, bool& aHasAlpha)
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (!aImage->GetBackendData(LayerManager::LAYERS_D3D9)) {
|
||||
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
|
||||
nsAutoPtr<TextureD3D9BackendData> dat(new TextureD3D9BackendData());
|
||||
dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
|
||||
if (dat->mTexture) {
|
||||
aImage->SetBackendData(LayerManager::LAYERS_D3D9, dat.forget());
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D9, dat.forget());
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ ImageLayerD3D9::GetTexture(Image *aImage, bool& aHasAlpha)
|
||||
}
|
||||
|
||||
TextureD3D9BackendData *data =
|
||||
static_cast<TextureD3D9BackendData*>(aImage->GetBackendData(LayerManager::LAYERS_D3D9));
|
||||
static_cast<TextureD3D9BackendData*>(aImage->GetBackendData(mozilla::layers::LAYERS_D3D9));
|
||||
|
||||
if (!data) {
|
||||
return nsnull;
|
||||
@ -416,12 +416,12 @@ ImageLayerD3D9::RenderLayer()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!yuvImage->GetBackendData(LayerManager::LAYERS_D3D9)) {
|
||||
if (!yuvImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
|
||||
AllocateTexturesYCbCr(yuvImage, device(), mD3DManager);
|
||||
}
|
||||
|
||||
PlanarYCbCrD3D9BackendData *data =
|
||||
static_cast<PlanarYCbCrD3D9BackendData*>(yuvImage->GetBackendData(LayerManager::LAYERS_D3D9));
|
||||
static_cast<PlanarYCbCrD3D9BackendData*>(yuvImage->GetBackendData(mozilla::layers::LAYERS_D3D9));
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
@ -616,12 +616,12 @@ ShadowImageLayerD3D9::RenderLayer()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mYCbCrImage->GetBackendData(LayerManager::LAYERS_D3D9)) {
|
||||
if (!mYCbCrImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
|
||||
AllocateTexturesYCbCr(mYCbCrImage, device(), mD3DManager);
|
||||
}
|
||||
|
||||
PlanarYCbCrD3D9BackendData *data =
|
||||
static_cast<PlanarYCbCrD3D9BackendData*>(mYCbCrImage->GetBackendData(LayerManager::LAYERS_D3D9));
|
||||
static_cast<PlanarYCbCrD3D9BackendData*>(mYCbCrImage->GetBackendData(mozilla::layers::LAYERS_D3D9));
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
@ -630,7 +630,7 @@ ShadowImageLayerD3D9::RenderLayer()
|
||||
if (!mYCbCrImage->mBufferSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SetShaderTransformAndOpacity();
|
||||
|
||||
device()->SetVertexShaderConstantF(CBvLayerQuad,
|
||||
|
@ -640,7 +640,7 @@ CompositorParent::AllocPLayers(const LayersBackend& aBackendHint,
|
||||
|
||||
*aBackend = aBackendHint;
|
||||
|
||||
if (aBackendHint == LayerManager::LAYERS_OPENGL) {
|
||||
if (aBackendHint == mozilla::layers::LAYERS_OPENGL) {
|
||||
nsRefPtr<LayerManagerOGL> layerManager;
|
||||
layerManager =
|
||||
new LayerManagerOGL(mWidget, mEGLSurfaceSize.width, mEGLSurfaceSize.height, mRenderToEGLSurface);
|
||||
@ -662,7 +662,7 @@ CompositorParent::AllocPLayers(const LayersBackend& aBackendHint,
|
||||
}
|
||||
*aMaxTextureSize = layerManager->GetMaxTextureSize();
|
||||
return new ShadowLayersParent(slm, this, 0);
|
||||
} else if (aBackendHint == LayerManager::LAYERS_BASIC) {
|
||||
} else if (aBackendHint == mozilla::layers::LAYERS_BASIC) {
|
||||
nsRefPtr<LayerManager> layerManager = new BasicShadowLayerManager(mWidget);
|
||||
mWidget = NULL;
|
||||
mLayerManager = layerManager;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
include protocol PLayers;
|
||||
|
||||
using mozilla::LayersBackend;
|
||||
using mozilla::layers::LayersBackend;
|
||||
using mozilla::null_t;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RenderTrace.h"
|
||||
#include "sampler.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
@ -109,7 +110,7 @@ struct AutoTxnEnd {
|
||||
ShadowLayerForwarder::ShadowLayerForwarder()
|
||||
: mShadowManager(NULL)
|
||||
, mMaxTextureSize(0)
|
||||
, mParentBackend(LayerManager::LAYERS_NONE)
|
||||
, mParentBackend(mozilla::layers::LAYERS_NONE)
|
||||
, mIsFirstPaint(false)
|
||||
{
|
||||
mTxn = new Transaction();
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "gfxASurface.h"
|
||||
|
||||
#include "ImageLayers.h"
|
||||
#include "Layers.h"
|
||||
#include "LayersBackend.h"
|
||||
#include "mozilla/ipc/SharedMemory.h"
|
||||
|
||||
class gfxSharedImageSurface;
|
||||
@ -101,7 +101,6 @@ class ShadowLayerForwarder
|
||||
|
||||
public:
|
||||
typedef gfxASurface::gfxContentType gfxContentType;
|
||||
typedef LayerManager::LayersBackend LayersBackend;
|
||||
|
||||
virtual ~ShadowLayerForwarder();
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "gfxUtils.h"
|
||||
#include "yuv_convert.h"
|
||||
#include "GLContextProvider.h"
|
||||
#include "LayersBackend.h"
|
||||
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
# include "GLXLibrary.h"
|
||||
# include "mozilla/X11Util.h"
|
||||
@ -172,7 +173,7 @@ AllocateTextureIOSurface(MacIOSurfaceImage *aIOImage, mozilla::gl::GLContext* aG
|
||||
|
||||
aGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||
|
||||
aIOImage->SetBackendData(LayerManager::LAYERS_OPENGL, backendData.forget());
|
||||
aIOImage->SetBackendData(LAYERS_OPENGL, backendData.forget());
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -189,7 +190,7 @@ AllocateTextureIOSurface(GonkIOSurfaceImage *aIOImage, mozilla::gl::GLContext* a
|
||||
new GonkIOSurfaceImageOGLBackendData);
|
||||
|
||||
backendData->mTexture.Allocate(aGL);
|
||||
aIOImage->SetBackendData(LayerManager::LAYERS_OPENGL, backendData.forget());
|
||||
aIOImage->SetBackendData(LAYERS_OPENGL, backendData.forget());
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -231,18 +232,18 @@ ImageLayerOGL::RenderLayer(int,
|
||||
}
|
||||
|
||||
PlanarYCbCrOGLBackendData *data =
|
||||
static_cast<PlanarYCbCrOGLBackendData*>(yuvImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
static_cast<PlanarYCbCrOGLBackendData*>(yuvImage->GetBackendData(LAYERS_OPENGL));
|
||||
|
||||
if (data && data->mTextures->GetGLContext() != gl()) {
|
||||
// If these textures were allocated by another layer manager,
|
||||
// clear them out and re-allocate below.
|
||||
data = nsnull;
|
||||
yuvImage->SetBackendData(LayerManager::LAYERS_OPENGL, nsnull);
|
||||
yuvImage->SetBackendData(LAYERS_OPENGL, nsnull);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
AllocateTexturesYCbCr(yuvImage);
|
||||
data = static_cast<PlanarYCbCrOGLBackendData*>(yuvImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
data = static_cast<PlanarYCbCrOGLBackendData*>(yuvImage->GetBackendData(LAYERS_OPENGL));
|
||||
}
|
||||
|
||||
if (!data || data->mTextures->GetGLContext() != gl()) {
|
||||
@ -294,18 +295,18 @@ ImageLayerOGL::RenderLayer(int,
|
||||
"Image layer has alpha image");
|
||||
|
||||
CairoOGLBackendData *data =
|
||||
static_cast<CairoOGLBackendData*>(cairoImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
static_cast<CairoOGLBackendData*>(cairoImage->GetBackendData(LAYERS_OPENGL));
|
||||
|
||||
if (data && data->mTexture.GetGLContext() != gl()) {
|
||||
// If this texture was allocated by another layer manager, clear
|
||||
// it out and re-allocate below.
|
||||
data = nsnull;
|
||||
cairoImage->SetBackendData(LayerManager::LAYERS_OPENGL, nsnull);
|
||||
cairoImage->SetBackendData(LAYERS_OPENGL, nsnull);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
AllocateTexturesCairo(cairoImage);
|
||||
data = static_cast<CairoOGLBackendData*>(cairoImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
data = static_cast<CairoOGLBackendData*>(cairoImage->GetBackendData(LAYERS_OPENGL));
|
||||
}
|
||||
|
||||
if (!data || data->mTexture.GetGLContext() != gl()) {
|
||||
@ -380,19 +381,19 @@ ImageLayerOGL::RenderLayer(int,
|
||||
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
|
||||
if (!ioImage->GetBackendData(LayerManager::LAYERS_OPENGL)) {
|
||||
if (!ioImage->GetBackendData(LAYERS_OPENGL)) {
|
||||
AllocateTextureIOSurface(ioImage, gl());
|
||||
}
|
||||
|
||||
MacIOSurfaceImageOGLBackendData *data =
|
||||
static_cast<MacIOSurfaceImageOGLBackendData*>(ioImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
static_cast<MacIOSurfaceImageOGLBackendData*>(ioImage->GetBackendData(LAYERS_OPENGL));
|
||||
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, data->mTexture.GetTextureID());
|
||||
|
||||
ShaderProgramOGL *program =
|
||||
mOGLManager->GetProgram(gl::RGBARectLayerProgramType, GetMaskLayer());
|
||||
|
||||
|
||||
program->Activate();
|
||||
if (program->GetTexCoordMultiplierUniformLocation() != -1) {
|
||||
// 2DRect case, get the multiplier right for a sampler2DRect
|
||||
@ -400,16 +401,16 @@ ImageLayerOGL::RenderLayer(int,
|
||||
} else {
|
||||
NS_ASSERTION(0, "no rects?");
|
||||
}
|
||||
|
||||
program->SetLayerQuadRect(nsIntRect(0, 0,
|
||||
ioImage->GetSize().width,
|
||||
|
||||
program->SetLayerQuadRect(nsIntRect(0, 0,
|
||||
ioImage->GetSize().width,
|
||||
ioImage->GetSize().height));
|
||||
program->SetLayerTransform(GetEffectiveTransform());
|
||||
program->SetLayerOpacity(GetEffectiveOpacity());
|
||||
program->SetRenderOffset(aOffset);
|
||||
program->SetTextureUnit(0);
|
||||
program->LoadMask(GetMaskLayer());
|
||||
|
||||
|
||||
mOGLManager->BindAndDrawQuad(program);
|
||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||
#endif
|
||||
@ -424,11 +425,11 @@ ImageLayerOGL::RenderLayer(int,
|
||||
gl()->MakeCurrent();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
|
||||
if (!ioImage->GetBackendData(LayerManager::LAYERS_OPENGL)) {
|
||||
if (!ioImage->GetBackendData(LAYERS_OPENGL)) {
|
||||
AllocateTextureIOSurface(ioImage, gl());
|
||||
}
|
||||
GonkIOSurfaceImageOGLBackendData *data =
|
||||
static_cast<GonkIOSurfaceImageOGLBackendData*>(ioImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
static_cast<GonkIOSurfaceImageOGLBackendData*>(ioImage->GetBackendData(LAYERS_OPENGL));
|
||||
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->BindExternalBuffer(data->mTexture.GetTextureID(), ioImage->GetNativeBuffer());
|
||||
@ -514,7 +515,7 @@ ImageLayerOGL::AllocateTexturesYCbCr(PlanarYCbCrImage *aImage)
|
||||
PlanarYCbCrImage::Data &data = aImage->mData;
|
||||
|
||||
gl()->MakeCurrent();
|
||||
|
||||
|
||||
mTextureRecycleBin->GetTexture(TextureRecycleBin::TEXTURE_Y, data.mYSize, gl(), &backendData->mTextures[0]);
|
||||
SetClamping(gl(), backendData->mTextures[0].GetTextureID());
|
||||
|
||||
@ -533,7 +534,7 @@ ImageLayerOGL::AllocateTexturesYCbCr(PlanarYCbCrImage *aImage)
|
||||
backendData->mCbCrSize = aImage->mData.mCbCrSize;
|
||||
backendData->mTextureRecycleBin = mTextureRecycleBin;
|
||||
|
||||
aImage->SetBackendData(LayerManager::LAYERS_OPENGL, backendData.forget());
|
||||
aImage->SetBackendData(LAYERS_OPENGL, backendData.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -566,7 +567,7 @@ ImageLayerOGL::AllocateTexturesCairo(CairoImage *aImage)
|
||||
backendData->mLayerProgram = gl::RGBXLayerProgramType;
|
||||
}
|
||||
|
||||
aImage->SetBackendData(LayerManager::LAYERS_OPENGL, backendData.forget());
|
||||
aImage->SetBackendData(LAYERS_OPENGL, backendData.forget());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -575,7 +576,7 @@ ImageLayerOGL::AllocateTexturesCairo(CairoImage *aImage)
|
||||
nsIntRect(0,0, aImage->mSize.width, aImage->mSize.height),
|
||||
tex, true);
|
||||
|
||||
aImage->SetBackendData(LayerManager::LAYERS_OPENGL, backendData.forget());
|
||||
aImage->SetBackendData(LAYERS_OPENGL, backendData.forget());
|
||||
}
|
||||
|
||||
/*
|
||||
@ -620,7 +621,7 @@ ImageLayerOGL::LoadAsTexture(GLuint aTextureUnit, gfxIntSize* aSize)
|
||||
}
|
||||
|
||||
CairoOGLBackendData *data = static_cast<CairoOGLBackendData*>(
|
||||
cairoImage->GetBackendData(LayerManager::LAYERS_OPENGL));
|
||||
cairoImage->GetBackendData(LAYERS_OPENGL));
|
||||
|
||||
if (!data) {
|
||||
NS_ASSERTION(cairoImage->mSurface->GetContentType() == gfxASurface::CONTENT_ALPHA,
|
||||
@ -650,7 +651,7 @@ ImageLayerOGL::LoadAsTexture(GLuint aTextureUnit, gfxIntSize* aSize)
|
||||
texID, true, nsIntPoint(0,0), false,
|
||||
aTextureUnit);
|
||||
|
||||
cairoImage->SetBackendData(LayerManager::LAYERS_OPENGL, data);
|
||||
cairoImage->SetBackendData(LAYERS_OPENGL, data);
|
||||
|
||||
gl()->MakeCurrent();
|
||||
gl()->fActiveTexture(aTextureUnit);
|
||||
|
@ -12,12 +12,13 @@
|
||||
|
||||
#include "nsString.h"
|
||||
#include "GLContext.h"
|
||||
#include "Layers.h"
|
||||
|
||||
#include "gfx3DMatrix.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class Layer;
|
||||
|
||||
// The kinds of mask layer a shader can support
|
||||
// We rely on the items in this enum being sequential
|
||||
enum MaskType {
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "nsRect.h"
|
||||
#include "nsRegion.h"
|
||||
#include "gfxASurface.h"
|
||||
#include "Layers.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4800 )
|
||||
@ -40,15 +40,13 @@
|
||||
namespace base { struct FileDescriptor { }; }
|
||||
#endif
|
||||
|
||||
using mozilla::layers::LayerManager;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
typedef gfxASurface::gfxContentType gfxContentType;
|
||||
typedef gfxASurface::gfxImageFormat PixelFormat;
|
||||
typedef gfxASurface::gfxSurfaceType gfxSurfaceType;
|
||||
typedef gfxPattern::GraphicsFilter GraphicsFilterType;
|
||||
typedef LayerManager::LayersBackend LayersBackend;
|
||||
typedef layers::LayersBackend LayersBackend;
|
||||
|
||||
// This is a cross-platform approximation to HANDLE, which we expect
|
||||
// to be typedef'd to void* or thereabouts.
|
||||
@ -518,10 +516,10 @@ struct ParamTraits<mozilla::GraphicsFilterType>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::LayersBackend>
|
||||
: public EnumSerializer<mozilla::LayersBackend,
|
||||
LayerManager::LAYERS_NONE,
|
||||
LayerManager::LAYERS_LAST>
|
||||
struct ParamTraits<mozilla::layers::LayersBackend>
|
||||
: public EnumSerializer<mozilla::layers::LayersBackend,
|
||||
mozilla::layers::LAYERS_NONE,
|
||||
mozilla::layers::LAYERS_LAST>
|
||||
{};
|
||||
|
||||
template <>
|
||||
|
@ -20,6 +20,10 @@ class gfxContext;
|
||||
class nsRootPresContext;
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
class ContainerLayer;
|
||||
class ThebesLayer;
|
||||
}
|
||||
|
||||
class FrameLayerBuilder;
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsISelection.h"
|
||||
#include "nsCaret.h"
|
||||
#include "plarena.h"
|
||||
#include "Layers.h"
|
||||
#include "nsRegion.h"
|
||||
#include "FrameLayerBuilder.h"
|
||||
#include "nsThemeConstants.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
include protocol PBrowser;
|
||||
include protocol PLayers;
|
||||
|
||||
using mozilla::LayersBackend;
|
||||
using mozilla::layers::LayersBackend;
|
||||
|
||||
namespace mozilla {
|
||||
namespace layout {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "RenderFrameChild.h"
|
||||
#include "mozilla/layers/ShadowLayersChild.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
using mozilla::layers::PLayersChild;
|
||||
using mozilla::layers::ShadowLayersChild;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsViewportFrame.h"
|
||||
#include "RenderFrameParent.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
typedef nsContentView::ViewConfig ViewConfig;
|
||||
using namespace mozilla::layers;
|
||||
@ -95,7 +96,7 @@ AssertInTopLevelChromeDoc(ContainerLayer* aContainer,
|
||||
nsIFrame* aContainedFrame)
|
||||
{
|
||||
NS_ASSERTION(
|
||||
(aContainer->Manager()->GetBackendType() != LayerManager::LAYERS_BASIC) ||
|
||||
(aContainer->Manager()->GetBackendType() != mozilla::layers::LAYERS_BASIC) ||
|
||||
(aContainedFrame->GetNearestWidget() ==
|
||||
static_cast<BasicLayerManager*>(aContainer->Manager())->GetRetainerWidget()),
|
||||
"Expected frame to be in top-level chrome document");
|
||||
@ -316,7 +317,7 @@ ClearContainer(ContainerLayer* aContainer)
|
||||
static bool
|
||||
IsTempLayerManager(LayerManager* aManager)
|
||||
{
|
||||
return (LayerManager::LAYERS_BASIC == aManager->GetBackendType() &&
|
||||
return (mozilla::layers::LAYERS_BASIC == aManager->GetBackendType() &&
|
||||
!static_cast<BasicLayerManager*>(aManager)->IsRetained());
|
||||
}
|
||||
|
||||
@ -453,7 +454,7 @@ GetFrom(nsFrameLoader* aFrameLoader)
|
||||
}
|
||||
|
||||
RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
|
||||
LayerManager::LayersBackend* aBackendType,
|
||||
mozilla::layers::LayersBackend* aBackendType,
|
||||
int* aMaxTextureSize,
|
||||
uint64_t* aId)
|
||||
: mLayersId(0)
|
||||
@ -464,7 +465,7 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
|
||||
mContentViews[FrameMetrics::ROOT_SCROLL_ID] =
|
||||
new nsContentView(aFrameLoader, FrameMetrics::ROOT_SCROLL_ID);
|
||||
|
||||
*aBackendType = LayerManager::LAYERS_NONE;
|
||||
*aBackendType = mozilla::layers::LAYERS_NONE;
|
||||
*aMaxTextureSize = 0;
|
||||
*aId = 0;
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <map>
|
||||
#include "nsDisplayList.h"
|
||||
#include "Layers.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
class nsContentView;
|
||||
class nsFrameLoader;
|
||||
@ -41,7 +41,7 @@ public:
|
||||
typedef std::map<ViewID, nsRefPtr<nsContentView> > ViewMap;
|
||||
|
||||
RenderFrameParent(nsFrameLoader* aFrameLoader,
|
||||
LayerManager::LayersBackend* aBackendType,
|
||||
mozilla::layers::LayersBackend* aBackendType,
|
||||
int* aMaxTextureSize,
|
||||
uint64_t* aId);
|
||||
virtual ~RenderFrameParent();
|
||||
|
@ -989,7 +989,7 @@ nsWindow::DrawTo(gfxASurface *targetSurface, const nsIntRect &invalidRect)
|
||||
event.region = invalidRect;
|
||||
|
||||
switch (GetLayerManager(nsnull)->GetBackendType()) {
|
||||
case LayerManager::LAYERS_BASIC: {
|
||||
case mozilla::layers::LAYERS_BASIC: {
|
||||
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
|
||||
|
||||
@ -1013,7 +1013,7 @@ nsWindow::DrawTo(gfxASurface *targetSurface, const nsIntRect &invalidRect)
|
||||
break;
|
||||
}
|
||||
|
||||
case LayerManager::LAYERS_OPENGL: {
|
||||
case mozilla::layers::LAYERS_OPENGL: {
|
||||
|
||||
static_cast<mozilla::layers::LayerManagerOGL*>(GetLayerManager(nsnull))->
|
||||
SetClippingRegion(nsIntRegion(boundsRect));
|
||||
@ -1114,7 +1114,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
|
||||
|
||||
AndroidBridge::Bridge()->HideProgressDialogOnce();
|
||||
|
||||
if (GetLayerManager(nsnull)->GetBackendType() == LayerManager::LAYERS_BASIC) {
|
||||
if (GetLayerManager(nsnull)->GetBackendType() == mozilla::layers::LAYERS_BASIC) {
|
||||
if (sNativeWindow) {
|
||||
unsigned char *bits;
|
||||
int width, height, format, stride;
|
||||
|
@ -140,9 +140,9 @@ public:
|
||||
NS_IMETHOD OnIMESelectionChange(void);
|
||||
virtual nsIMEUpdatePreference GetIMEUpdatePreference();
|
||||
|
||||
LayerManager* GetLayerManager (PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
LayerManager* GetLayerManager (PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
|
||||
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
|
||||
|
@ -2551,7 +2551,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
#endif
|
||||
|
||||
LayerManager *layerManager = mGeckoChild->GetLayerManager(nsnull);
|
||||
if (layerManager->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
if (layerManager->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
NSOpenGLContext *glContext;
|
||||
|
||||
LayerManagerOGL *manager = static_cast<LayerManagerOGL*>(layerManager);
|
||||
|
@ -245,7 +245,7 @@ public:
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect);
|
||||
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
|
||||
virtual LayerManager* GetLayerManager(PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ;
|
||||
|
@ -204,12 +204,12 @@ nsWindow::DoDraw(void)
|
||||
gWindowToRedraw->mDirtyRegion.SetEmpty();
|
||||
|
||||
LayerManager* lm = gWindowToRedraw->GetLayerManager();
|
||||
if (LayerManager::LAYERS_OPENGL == lm->GetBackendType()) {
|
||||
if (mozilla::layers::LAYERS_OPENGL == lm->GetBackendType()) {
|
||||
LayerManagerOGL* oglm = static_cast<LayerManagerOGL*>(lm);
|
||||
oglm->SetClippingRegion(event.region);
|
||||
oglm->SetWorldTransform(sRotationMatrix);
|
||||
gWindowToRedraw->mEventCallback(&event);
|
||||
} else if (LayerManager::LAYERS_BASIC == lm->GetBackendType()) {
|
||||
} else if (mozilla::layers::LAYERS_BASIC == lm->GetBackendType()) {
|
||||
MOZ_ASSERT(sFramebufferOpen || sUsingOMTC);
|
||||
nsRefPtr<gfxASurface> targetSurface;
|
||||
|
||||
@ -585,7 +585,7 @@ PRUint32
|
||||
nsWindow::GetGLFrameBufferFormat()
|
||||
{
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
mLayerManager->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
// We directly map the hardware fb on Gonk. The hardware fb
|
||||
// has RGB format.
|
||||
return LOCAL_GL_RGB;
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
virtual float GetDPI();
|
||||
virtual mozilla::layers::LayerManager*
|
||||
GetLayerManager(PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
gfxASurface* GetThebesSurface();
|
||||
|
@ -610,7 +610,7 @@ nsWindow::Destroy(void)
|
||||
/** Need to clean our LayerManager up while still alive */
|
||||
if (mLayerManager) {
|
||||
nsRefPtr<GLContext> gl = nsnull;
|
||||
if (mLayerManager->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
if (mLayerManager->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
LayerManagerOGL *ogllm = static_cast<LayerManagerOGL*>(mLayerManager.get());
|
||||
gl = ogllm->gl();
|
||||
}
|
||||
@ -2140,7 +2140,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
|
||||
|
||||
return TRUE;
|
||||
|
||||
} else if (GetLayerManager()->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
} else if (GetLayerManager()->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
LayerManagerOGL *manager = static_cast<LayerManagerOGL*>(GetLayerManager());
|
||||
manager->SetClippingRegion(event.region);
|
||||
|
||||
@ -6204,7 +6204,7 @@ void
|
||||
nsWindow::ClearCachedResources()
|
||||
{
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_BASIC) {
|
||||
mLayerManager->GetBackendType() == mozilla::layers::LAYERS_BASIC) {
|
||||
static_cast<BasicLayerManager*> (mLayerManager.get())->
|
||||
ClearCachedResources();
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
#include "prthread.h"
|
||||
#include "Layers.h"
|
||||
#include "nsEvent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsITheme.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#include "nsWidgetInitData.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
// forward declarations
|
||||
class nsFontMetrics;
|
||||
@ -41,6 +41,7 @@ namespace dom {
|
||||
class TabChild;
|
||||
}
|
||||
namespace layers {
|
||||
class LayerManager;
|
||||
class PLayersChild;
|
||||
}
|
||||
}
|
||||
@ -363,7 +364,7 @@ class nsIWidget : public nsISupports {
|
||||
|
||||
public:
|
||||
typedef mozilla::layers::LayerManager LayerManager;
|
||||
typedef LayerManager::LayersBackend LayersBackend;
|
||||
typedef mozilla::layers::LayersBackend LayersBackend;
|
||||
typedef mozilla::layers::PLayersChild PLayersChild;
|
||||
typedef mozilla::widget::IMEState IMEState;
|
||||
typedef mozilla::widget::InputContext InputContext;
|
||||
@ -1040,14 +1041,14 @@ class nsIWidget : public nsISupports {
|
||||
*/
|
||||
inline LayerManager* GetLayerManager(bool* aAllowRetaining = nsnull)
|
||||
{
|
||||
return GetLayerManager(nsnull, LayerManager::LAYERS_NONE,
|
||||
return GetLayerManager(nsnull, mozilla::layers::LAYERS_NONE,
|
||||
LAYER_MANAGER_CURRENT, aAllowRetaining);
|
||||
}
|
||||
|
||||
inline LayerManager* GetLayerManager(LayerManagerPersistence aPersistence,
|
||||
bool* aAllowRetaining = nsnull)
|
||||
{
|
||||
return GetLayerManager(nsnull, LayerManager::LAYERS_NONE,
|
||||
return GetLayerManager(nsnull, mozilla::layers::LAYERS_NONE,
|
||||
aPersistence, aAllowRetaining);
|
||||
}
|
||||
|
||||
|
@ -1040,7 +1040,7 @@ nsWindow::DoPaint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, Q
|
||||
startup->RemoveFakeLayout();
|
||||
}
|
||||
|
||||
if (GetLayerManager(nsnull)->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
if (GetLayerManager(nsnull)->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
aPainter->beginNativePainting();
|
||||
nsPaintEvent event(true, NS_PAINT, this);
|
||||
event.willSendDidPaint = true;
|
||||
@ -3308,7 +3308,7 @@ PRUint32
|
||||
nsWindow::GetGLFrameBufferFormat()
|
||||
{
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
mLayerManager->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
// On maemo the hardware fb has RGB format.
|
||||
#ifdef MOZ_PLATFORM_MAEMO
|
||||
return LOCAL_GL_RGB;
|
||||
|
@ -1339,7 +1339,7 @@ NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
||||
// region, some drivers or OSes may incorrectly copy into the clipped-out
|
||||
// area.
|
||||
if (mWindowType == eWindowType_plugin &&
|
||||
(!mLayerManager || mLayerManager->GetBackendType() == LayerManager::LAYERS_D3D9) &&
|
||||
(!mLayerManager || mLayerManager->GetBackendType() == LAYERS_D3D9) &&
|
||||
mClipRects &&
|
||||
(mClipRectCount != 1 || !mClipRects[0].IsEqualInterior(nsIntRect(0, 0, mBounds.width, mBounds.height)))) {
|
||||
flags |= SWP_NOCOPYBITS;
|
||||
@ -3140,11 +3140,10 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
if (mLayerManager) {
|
||||
if (mLayerManager->GetBackendType() ==
|
||||
mozilla::layers::LayerManager::LAYERS_D3D10)
|
||||
if (mLayerManager->GetBackendType() == LAYERS_D3D10)
|
||||
{
|
||||
mozilla::layers::LayerManagerD3D10 *layerManagerD3D10 =
|
||||
static_cast<mozilla::layers::LayerManagerD3D10*>(mLayerManager.get());
|
||||
LayerManagerD3D10 *layerManagerD3D10 =
|
||||
static_cast<LayerManagerD3D10*>(mLayerManager.get());
|
||||
if (layerManagerD3D10->device() !=
|
||||
gfxWindowsPlatform::GetPlatform()->GetD3D10Device())
|
||||
{
|
||||
@ -3160,8 +3159,7 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
|
||||
if (!mLayerManager ||
|
||||
(!sAllowD3D9 && aPersistence == LAYER_MANAGER_PERSISTENT &&
|
||||
mLayerManager->GetBackendType() ==
|
||||
mozilla::layers::LayerManager::LAYERS_BASIC)) {
|
||||
mLayerManager->GetBackendType() == LAYERS_BASIC)) {
|
||||
// If D3D9 is not currently allowed but the permanent manager is required,
|
||||
// -and- we're currently using basic layers, run through this check.
|
||||
LayerManagerPrefs prefs;
|
||||
@ -3187,8 +3185,8 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
if (!prefs.mPreferD3D9 && !prefs.mPreferOpenGL) {
|
||||
nsRefPtr<mozilla::layers::LayerManagerD3D10> layerManager =
|
||||
new mozilla::layers::LayerManagerD3D10(this);
|
||||
nsRefPtr<LayerManagerD3D10> layerManager =
|
||||
new LayerManagerD3D10(this);
|
||||
if (layerManager->Initialize(prefs.mForceAcceleration)) {
|
||||
mLayerManager = layerManager;
|
||||
}
|
||||
@ -3196,8 +3194,8 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_D3D9_LAYER
|
||||
if (!prefs.mPreferOpenGL && !mLayerManager && sAllowD3D9) {
|
||||
nsRefPtr<mozilla::layers::LayerManagerD3D9> layerManager =
|
||||
new mozilla::layers::LayerManagerD3D9(this);
|
||||
nsRefPtr<LayerManagerD3D9> layerManager =
|
||||
new LayerManagerD3D9(this);
|
||||
if (layerManager->Initialize(prefs.mForceAcceleration)) {
|
||||
mLayerManager = layerManager;
|
||||
}
|
||||
@ -3212,8 +3210,8 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
}
|
||||
|
||||
if (status == nsIGfxInfo::FEATURE_NO_INFO) {
|
||||
nsRefPtr<mozilla::layers::LayerManagerOGL> layerManager =
|
||||
new mozilla::layers::LayerManagerOGL(this);
|
||||
nsRefPtr<LayerManagerOGL> layerManager =
|
||||
new LayerManagerOGL(this);
|
||||
if (layerManager->Initialize()) {
|
||||
mLayerManager = layerManager;
|
||||
}
|
||||
@ -6778,7 +6776,7 @@ nsWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
|
||||
|
||||
if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() ==
|
||||
gfxWindowsPlatform::RENDER_DIRECT2D ||
|
||||
GetLayerManager()->GetBackendType() != LayerManager::LAYERS_BASIC) {
|
||||
GetLayerManager()->GetBackendType() != LAYERS_BASIC) {
|
||||
// XXX - Workaround for Bug 587508. This will invalidate the part of the
|
||||
// plugin window that might be touched by moving content somehow. The
|
||||
// underlying problem should be found and fixed!
|
||||
@ -7751,7 +7749,7 @@ nsWindow::ClearCachedResources()
|
||||
mD2DWindowSurface = nsnull;
|
||||
#endif
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_BASIC) {
|
||||
mLayerManager->GetBackendType() == LAYERS_BASIC) {
|
||||
static_cast<BasicLayerManager*>(mLayerManager.get())->
|
||||
ClearCachedResources();
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
||||
virtual bool HasPendingInputEvent();
|
||||
virtual LayerManager* GetLayerManager(PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
gfxASurface *GetThebesSurface();
|
||||
|
@ -70,7 +70,7 @@ using namespace mozilla::widget;
|
||||
/**************************************************************
|
||||
*
|
||||
* SECTION: nsWindow statics
|
||||
*
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
static nsAutoPtr<PRUint8> sSharedSurfaceData;
|
||||
@ -304,7 +304,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
|
||||
#endif // WIDGET_DEBUG_OUTPUT
|
||||
|
||||
switch (GetLayerManager()->GetBackendType()) {
|
||||
case LayerManager::LAYERS_BASIC:
|
||||
case LAYERS_BASIC:
|
||||
{
|
||||
nsRefPtr<gfxASurface> targetSurface;
|
||||
|
||||
@ -535,13 +535,13 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LayerManager::LAYERS_OPENGL:
|
||||
case LAYERS_OPENGL:
|
||||
static_cast<mozilla::layers::LayerManagerOGL*>(GetLayerManager())->
|
||||
SetClippingRegion(event.region);
|
||||
result = DispatchWindowEvent(&event, eventStatus);
|
||||
break;
|
||||
#ifdef MOZ_ENABLE_D3D9_LAYER
|
||||
case LayerManager::LAYERS_D3D9:
|
||||
case LAYERS_D3D9:
|
||||
{
|
||||
LayerManagerD3D9 *layerManagerD3D9 =
|
||||
static_cast<mozilla::layers::LayerManagerD3D9*>(GetLayerManager());
|
||||
@ -559,7 +559,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
|
||||
break;
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
case LayerManager::LAYERS_D3D10:
|
||||
case LAYERS_D3D10:
|
||||
{
|
||||
gfxWindowsPlatform::GetPlatform()->UpdateRenderMode();
|
||||
LayerManagerD3D10 *layerManagerD3D10 = static_cast<mozilla::layers::LayerManagerD3D10*>(GetLayerManager());
|
||||
|
@ -290,7 +290,7 @@ PuppetWidget::GetLayerManager(PLayersChild* aShadowManager,
|
||||
// The backend hint is a temporary placeholder until Azure, when
|
||||
// all content-process layer managers will be BasicLayerManagers.
|
||||
#if defined(MOZ_ENABLE_D3D10_LAYER)
|
||||
if (LayerManager::LAYERS_D3D10 == aBackendHint) {
|
||||
if (mozilla::layers::LAYERS_D3D10 == aBackendHint) {
|
||||
nsRefPtr<LayerManagerD3D10> m = new LayerManagerD3D10(this);
|
||||
m->AsShadowForwarder()->SetShadowManager(aShadowManager);
|
||||
if (m->Initialize()) {
|
||||
@ -498,7 +498,7 @@ PuppetWidget::DispatchPaintEvent()
|
||||
nsCAutoString("PuppetWidget"), nsnull);
|
||||
#endif
|
||||
|
||||
if (LayerManager::LAYERS_D3D10 == mLayerManager->GetBackendType()) {
|
||||
if (mozilla::layers::LAYERS_D3D10 == mLayerManager->GetBackendType()) {
|
||||
DispatchEvent(&event, status);
|
||||
} else {
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(mSurface);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
class gfxASurface;
|
||||
|
||||
@ -135,7 +136,7 @@ public:
|
||||
//NS_IMETHOD CaptureMouse(bool aCapture);
|
||||
virtual LayerManager*
|
||||
GetLayerManager(PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
// virtual nsDeviceContext* GetDeviceContext();
|
||||
|
@ -145,7 +145,7 @@ void nsBaseWidget::DestroyCompositor()
|
||||
nsBaseWidget::~nsBaseWidget()
|
||||
{
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_BASIC) {
|
||||
mLayerManager->GetBackendType() == LAYERS_BASIC) {
|
||||
static_cast<BasicLayerManager*>(mLayerManager.get())->ClearRetainerWidget();
|
||||
}
|
||||
|
||||
@ -737,7 +737,7 @@ nsBaseWidget::AutoLayerManagerSetup::AutoLayerManagerSetup(
|
||||
BasicLayerManager* manager =
|
||||
static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
|
||||
if (manager) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LayerManager::LAYERS_BASIC,
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||
manager->SetDefaultTarget(aTarget, aDoubleBuffering);
|
||||
}
|
||||
@ -748,7 +748,7 @@ nsBaseWidget::AutoLayerManagerSetup::~AutoLayerManagerSetup()
|
||||
BasicLayerManager* manager =
|
||||
static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
|
||||
if (manager) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LayerManager::LAYERS_BASIC,
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||
manager->SetDefaultTarget(nsnull, BasicLayerManager::BUFFER_NONE);
|
||||
}
|
||||
@ -878,9 +878,9 @@ void nsBaseWidget::CreateCompositor()
|
||||
mCompositorChild->Open(parentChannel, childMessageLoop, childSide);
|
||||
PRInt32 maxTextureSize;
|
||||
PLayersChild* shadowManager;
|
||||
LayerManager::LayersBackend backendHint =
|
||||
mUseAcceleratedRendering ? LayerManager::LAYERS_OPENGL : LayerManager::LAYERS_BASIC;
|
||||
LayerManager::LayersBackend parentBackend;
|
||||
mozilla::layers::LayersBackend backendHint =
|
||||
mUseAcceleratedRendering ? mozilla::layers::LAYERS_OPENGL : mozilla::layers::LAYERS_BASIC;
|
||||
mozilla::layers::LayersBackend parentBackend;
|
||||
shadowManager = mCompositorChild->SendPLayersConstructor(
|
||||
backendHint, 0, &parentBackend, &maxTextureSize);
|
||||
|
||||
@ -1314,7 +1314,7 @@ PRUint32
|
||||
nsBaseWidget::GetGLFrameBufferFormat()
|
||||
{
|
||||
if (mLayerManager &&
|
||||
mLayerManager->GetBackendType() == LayerManager::LAYERS_OPENGL) {
|
||||
mLayerManager->GetBackendType() == LAYERS_OPENGL) {
|
||||
// Assume that the default framebuffer has RGBA format. Specific
|
||||
// backends that know differently will override this method.
|
||||
return LOCAL_GL_RGBA;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "BasicLayers.h"
|
||||
#include "nsIRollupListener.h"
|
||||
#include "LayersBackend.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsAutoRollup;
|
||||
@ -98,7 +99,7 @@ public:
|
||||
NS_IMETHOD MakeFullScreen(bool aFullScreen);
|
||||
virtual nsDeviceContext* GetDeviceContext();
|
||||
virtual LayerManager* GetLayerManager(PLayersChild* aShadowManager = nsnull,
|
||||
LayersBackend aBackendHint = LayerManager::LAYERS_NONE,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nsnull);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user