зеркало из https://github.com/mozilla/gecko-dev.git
Bug 784739 - Switch from NULL to nullptr in gfx/layers/d3d10/; r=ehsan
--HG-- extra : rebase_source : 69b7ab7e4aa0eed92d597451bcab820f9d5c3957
This commit is contained in:
Родитель
0fe77b3a6e
Коммит
84bee5be5d
|
@ -68,7 +68,7 @@ CanvasLayerD3D10::Initialize(const Data& aData)
|
|||
"CanvasLayer can't have both surface and WebGLContext/Surface");
|
||||
|
||||
mBounds.SetRect(0, 0, aData.mSize.width, aData.mSize.height);
|
||||
device()->CreateShaderResourceView(mTexture, NULL, getter_AddRefs(mSRView));
|
||||
device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ CanvasLayerD3D10::Initialize(const Data& aData)
|
|||
if (data) {
|
||||
mTexture = static_cast<ID3D10Texture2D*>(data);
|
||||
mIsD2DTexture = true;
|
||||
device()->CreateShaderResourceView(mTexture, NULL, getter_AddRefs(mSRView));
|
||||
device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
mHasAlpha =
|
||||
mSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA;
|
||||
return;
|
||||
|
@ -100,13 +100,13 @@ CanvasLayerD3D10::Initialize(const Data& aData)
|
|||
desc.Usage = D3D10_USAGE_DYNAMIC;
|
||||
desc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
|
||||
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(mTexture));
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTexture));
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create texture for CanvasLayer!");
|
||||
return;
|
||||
}
|
||||
|
||||
device()->CreateShaderResourceView(mTexture, NULL, getter_AddRefs(mUploadSRView));
|
||||
device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mUploadSRView));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -20,7 +20,7 @@ class CanvasLayerD3D10 : public CanvasLayer,
|
|||
{
|
||||
public:
|
||||
CanvasLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: CanvasLayer(aManager, NULL)
|
||||
: CanvasLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
, mDataIsPremultiplied(false)
|
||||
, mNeedsYFlip(false)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
ColorLayerD3D10::ColorLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ColorLayer(aManager, NULL)
|
||||
: ColorLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
ContainerLayerD3D10::ContainerLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ContainerLayer(aManager, NULL)
|
||||
: ContainerLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
|
@ -215,7 +215,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
gfx3DMatrix oldViewMatrix;
|
||||
|
||||
if (useIntermediate) {
|
||||
device()->OMGetRenderTargets(1, getter_AddRefs(previousRTView), NULL);
|
||||
device()->OMGetRenderTargets(1, getter_AddRefs(previousRTView), nullptr);
|
||||
|
||||
D3D10_TEXTURE2D_DESC desc;
|
||||
memset(&desc, 0, sizeof(D3D10_TEXTURE2D_DESC));
|
||||
|
@ -227,7 +227,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
desc.SampleDesc.Count = 1;
|
||||
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||
HRESULT hr;
|
||||
hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(renderTexture));
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(renderTexture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("Failed to create new texture for ContainerLayerD3D10!"),
|
||||
|
@ -235,7 +235,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateRenderTargetView(renderTexture, NULL, getter_AddRefs(rtView));
|
||||
hr = device()->CreateRenderTargetView(renderTexture, nullptr, getter_AddRefs(rtView));
|
||||
NS_ASSERTION(SUCCEEDED(hr), "Failed to create render target view for ContainerLayerD3D10!");
|
||||
|
||||
effect()->GetVariableByName("vRenderTargetOffset")->
|
||||
|
@ -277,7 +277,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
}
|
||||
|
||||
ID3D10RenderTargetView *rtViewPtr = rtView;
|
||||
device()->OMSetRenderTargets(1, &rtViewPtr, NULL);
|
||||
device()->OMSetRenderTargets(1, &rtViewPtr, nullptr);
|
||||
|
||||
renderTargetOffset[0] = (float)visibleRect.x;
|
||||
renderTargetOffset[1] = (float)visibleRect.y;
|
||||
|
@ -332,7 +332,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
if (useIntermediate) {
|
||||
mD3DManager->SetViewport(previousViewportSize);
|
||||
ID3D10RenderTargetView *rtView = previousRTView;
|
||||
device()->OMSetRenderTargets(1, &rtView, NULL);
|
||||
device()->OMSetRenderTargets(1, &rtView, nullptr);
|
||||
effect()->GetVariableByName("vRenderTargetOffset")->
|
||||
SetRawValue(previousRenderTargetOffset, 0, 8);
|
||||
|
||||
|
@ -360,7 +360,7 @@ ContainerLayerD3D10::RenderLayer()
|
|||
technique->GetPassByIndex(0)->Apply(0);
|
||||
|
||||
ID3D10ShaderResourceView *view;
|
||||
device()->CreateShaderResourceView(renderTexture, NULL, &view);
|
||||
device()->CreateShaderResourceView(renderTexture, nullptr, &view);
|
||||
device()->PSSetShaderResources(0, 1, &view);
|
||||
device()->Draw(4, 0);
|
||||
view->Release();
|
||||
|
|
|
@ -50,7 +50,7 @@ SurfaceToTexture(ID3D10Device *aDevice,
|
|||
const gfxIntSize &aSize)
|
||||
{
|
||||
if (!aSurface) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aSurface->GetType() == gfxASurface::SurfaceTypeD2D) {
|
||||
|
@ -106,7 +106,7 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
|||
dat->mTexture = DataToTexture(device(), remoteImage->mData, remoteImage->mStride, remoteImage->mSize);
|
||||
|
||||
if (dat->mTexture) {
|
||||
device()->CreateShaderResourceView(dat->mTexture, NULL, getter_AddRefs(dat->mSRView));
|
||||
device()->CreateShaderResourceView(dat->mTexture, nullptr, getter_AddRefs(dat->mSRView));
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
|||
dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
|
||||
|
||||
if (dat->mTexture) {
|
||||
device()->CreateShaderResourceView(dat->mTexture, NULL, getter_AddRefs(dat->mSRView));
|
||||
device()->CreateShaderResourceView(dat->mTexture, nullptr, getter_AddRefs(dat->mSRView));
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
|
|||
nsAutoPtr<TextureD3D10BackendData> dat(new TextureD3D10BackendData());
|
||||
dat->mTexture = texture;
|
||||
|
||||
hr = device()->CreateShaderResourceView(dat->mTexture, NULL, getter_AddRefs(dat->mSRView));
|
||||
hr = device()->CreateShaderResourceView(dat->mTexture, nullptr, getter_AddRefs(dat->mSRView));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr) && dat->mSRView, nullptr);
|
||||
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
|
||||
|
@ -307,7 +307,7 @@ ImageLayerD3D10::RenderLayer()
|
|||
if (yuvImage->GetData()->mStereoMode != STEREO_MODE_MONO) {
|
||||
// Dst resource is optional
|
||||
GetNv3DVUtils()->SendNv3DVMetaData((unsigned int)yuvImage->GetData()->mYSize.width,
|
||||
(unsigned int)yuvImage->GetData()->mYSize.height, (HANDLE)(data->mYTexture), (HANDLE)(NULL));
|
||||
(unsigned int)yuvImage->GetData()->mYSize.height, (HANDLE)(data->mYTexture), (HANDLE)(nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,9 +385,9 @@ void ImageLayerD3D10::AllocateTexturesYCbCr(PlanarYCbCrImage *aImage)
|
|||
hr);
|
||||
return;
|
||||
}
|
||||
device()->CreateShaderResourceView(backendData->mYTexture, NULL, getter_AddRefs(backendData->mYView));
|
||||
device()->CreateShaderResourceView(backendData->mCbTexture, NULL, getter_AddRefs(backendData->mCbView));
|
||||
device()->CreateShaderResourceView(backendData->mCrTexture, NULL, getter_AddRefs(backendData->mCrView));
|
||||
device()->CreateShaderResourceView(backendData->mYTexture, nullptr, getter_AddRefs(backendData->mYView));
|
||||
device()->CreateShaderResourceView(backendData->mCbTexture, nullptr, getter_AddRefs(backendData->mCbView));
|
||||
device()->CreateShaderResourceView(backendData->mCrTexture, nullptr, getter_AddRefs(backendData->mCrView));
|
||||
|
||||
aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, backendData.forget());
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ RemoteDXGITextureImage::GetAsSurface()
|
|||
desc.Usage = D3D10_USAGE_STAGING;
|
||||
|
||||
nsRefPtr<ID3D10Texture2D> softTexture;
|
||||
HRESULT hr = device->CreateTexture2D(&desc, NULL, getter_AddRefs(softTexture));
|
||||
HRESULT hr = device->CreateTexture2D(&desc, nullptr, getter_AddRefs(softTexture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create 2D staging texture.");
|
||||
|
@ -514,7 +514,7 @@ RemoteDXGITextureImage::GetD3D10TextureBackendData(ID3D10Device *aDevice)
|
|||
|
||||
data->mTexture = texture;
|
||||
|
||||
aDevice->CreateShaderResourceView(texture, NULL, getter_AddRefs(data->mSRView));
|
||||
aDevice->CreateShaderResourceView(texture, nullptr, getter_AddRefs(data->mSRView));
|
||||
|
||||
SetBackendData(mozilla::layers::LAYERS_D3D10, data);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class ImageLayerD3D10 : public ImageLayer,
|
|||
{
|
||||
public:
|
||||
ImageLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ImageLayer(aManager, NULL)
|
||||
: ImageLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
|
@ -56,7 +56,7 @@ struct TextureD3D10BackendData : public ImageBackendData
|
|||
|
||||
class RemoteDXGITextureImage : public Image {
|
||||
public:
|
||||
RemoteDXGITextureImage() : Image(NULL, REMOTE_IMAGE_DXGI_TEXTURE) {}
|
||||
RemoteDXGITextureImage() : Image(nullptr, REMOTE_IMAGE_DXGI_TEXTURE) {}
|
||||
|
||||
already_AddRefed<gfxASurface> GetAsSurface();
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ LayerManagerD3D10::~LayerManagerD3D10()
|
|||
mDevice->GetPrivateData(sDeviceAttachments, &size, &attachments);
|
||||
// No LayerManagers left for this device. Clear out interfaces stored which
|
||||
// hold a reference to the device.
|
||||
mDevice->SetPrivateData(sDeviceAttachments, 0, NULL);
|
||||
mDevice->SetPrivateData(sDeviceAttachments, 0, nullptr);
|
||||
|
||||
delete attachments;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ LayerManagerD3D10::Initialize(bool force, HRESULT* aHresultPtr)
|
|||
* Do some post device creation setup
|
||||
*/
|
||||
if (mNv3DVUtils) {
|
||||
IUnknown* devUnknown = NULL;
|
||||
IUnknown* devUnknown = nullptr;
|
||||
if (mDevice) {
|
||||
mDevice->QueryInterface(IID_IUnknown, (void **)&devUnknown);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ LayerManagerD3D10::Initialize(bool force, HRESULT* aHresultPtr)
|
|||
sizeof(g_main),
|
||||
D3D10_EFFECT_SINGLE_THREADED,
|
||||
mDevice,
|
||||
NULL,
|
||||
nullptr,
|
||||
getter_AddRefs(mEffect));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
@ -463,7 +463,7 @@ LayerManagerD3D10::CreateOptimalSurface(const gfxIntSize &aSize,
|
|||
desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
|
||||
desc.MiscFlags = D3D10_RESOURCE_MISC_GDI_COMPATIBLE;
|
||||
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(texture));
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for CreateOptimalSurface!");
|
||||
|
@ -508,7 +508,7 @@ LayerManagerD3D10::CreateDrawTarget(const IntSize &aSize,
|
|||
CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, aSize.width, aSize.height, 1, 1);
|
||||
desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
|
||||
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(texture));
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for CreateOptimalSurface!");
|
||||
|
@ -599,7 +599,7 @@ LayerManagerD3D10::SetupPipeline()
|
|||
}
|
||||
|
||||
ID3D10RenderTargetView *view = mRTView;
|
||||
mDevice->OMSetRenderTargets(1, &view, NULL);
|
||||
mDevice->OMSetRenderTargets(1, &view, nullptr);
|
||||
|
||||
SetupInputAssembler();
|
||||
|
||||
|
@ -620,7 +620,7 @@ LayerManagerD3D10::UpdateRenderTarget()
|
|||
if (FAILED(hr)) {
|
||||
return;
|
||||
}
|
||||
mDevice->CreateRenderTargetView(backBuf, NULL, getter_AddRefs(mRTView));
|
||||
mDevice->CreateRenderTargetView(backBuf, nullptr, getter_AddRefs(mRTView));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -753,7 +753,7 @@ LayerManagerD3D10::PaintToTarget()
|
|||
|
||||
nsRefPtr<ID3D10Texture2D> readTexture;
|
||||
|
||||
HRESULT hr = device()->CreateTexture2D(&softDesc, NULL, getter_AddRefs(readTexture));
|
||||
HRESULT hr = device()->CreateTexture2D(&softDesc, nullptr, getter_AddRefs(readTexture));
|
||||
if (FAILED(hr)) {
|
||||
ReportFailure(NS_LITERAL_CSTRING("LayerManagerD3D10::PaintToTarget(): Failed to create texture"),
|
||||
hr);
|
||||
|
|
|
@ -178,7 +178,7 @@ private:
|
|||
nsAutoPtr<Nv3DVUtils> mNv3DVUtils;
|
||||
|
||||
/*
|
||||
* Context target, NULL when drawing directly to our swap chain.
|
||||
* Context target, nullptr when drawing directly to our swap chain.
|
||||
*/
|
||||
nsRefPtr<gfxContext> mTarget;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class ReadbackLayerD3D10 :
|
|||
{
|
||||
public:
|
||||
ReadbackLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ReadbackLayer(aManager, NULL),
|
||||
: ReadbackLayer(aManager, nullptr),
|
||||
LayerD3D10(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
|
|
|
@ -108,9 +108,9 @@ ReadbackManagerD3D10::ReadbackManagerD3D10()
|
|||
: mRefCnt(0)
|
||||
{
|
||||
::InitializeCriticalSection(&mTaskMutex);
|
||||
mShutdownEvent = ::CreateEventA(NULL, FALSE, FALSE, NULL);
|
||||
mTaskSemaphore = ::CreateSemaphoreA(NULL, 0, 1000000, NULL);
|
||||
mTaskThread = ::CreateThread(NULL, 0, StartTaskThread, this, 0, 0);
|
||||
mShutdownEvent = ::CreateEventA(nullptr, FALSE, FALSE, nullptr);
|
||||
mTaskSemaphore = ::CreateSemaphoreA(nullptr, 0, 1000000, nullptr);
|
||||
mTaskThread = ::CreateThread(nullptr, 0, StartTaskThread, this, 0, 0);
|
||||
}
|
||||
|
||||
ReadbackManagerD3D10::~ReadbackManagerD3D10()
|
||||
|
@ -144,7 +144,7 @@ ReadbackManagerD3D10::PostTask(ID3D10Texture2D *aTexture, void *aUpdate, const g
|
|||
mPendingReadbackTasks.AppendElement(task);
|
||||
::LeaveCriticalSection(&mTaskMutex);
|
||||
|
||||
::ReleaseSemaphore(mTaskSemaphore, 1, NULL);
|
||||
::ReleaseSemaphore(mTaskSemaphore, 1, nullptr);
|
||||
}
|
||||
|
||||
HRESULT
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
ThebesLayerD3D10::ThebesLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ThebesLayer(aManager, NULL)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
, mCurrentSurfaceMode(SURFACE_OPAQUE)
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
|||
D3D10_CPU_ACCESS_READ);
|
||||
|
||||
nsRefPtr<ID3D10Texture2D> readbackTexture;
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(readbackTexture));
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(readbackTexture));
|
||||
if (FAILED(hr)) {
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D10::Validate(): Failed to create texture"),
|
||||
hr);
|
||||
|
@ -333,12 +333,12 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
|||
// and probably not worth the win here as this will often be a single
|
||||
// rect.
|
||||
nsRefPtr<ID3D10RenderTargetView> oldRT;
|
||||
device()->OMGetRenderTargets(1, getter_AddRefs(oldRT), NULL);
|
||||
device()->OMGetRenderTargets(1, getter_AddRefs(oldRT), nullptr);
|
||||
|
||||
nsRefPtr<ID3D10RenderTargetView> viewBlack;
|
||||
nsRefPtr<ID3D10RenderTargetView> viewWhite;
|
||||
device()->CreateRenderTargetView(mTexture, NULL, getter_AddRefs(viewBlack));
|
||||
device()->CreateRenderTargetView(mTextureOnWhite, NULL, getter_AddRefs(viewWhite));
|
||||
device()->CreateRenderTargetView(mTexture, nullptr, getter_AddRefs(viewBlack));
|
||||
device()->CreateRenderTargetView(mTextureOnWhite, nullptr, getter_AddRefs(viewWhite));
|
||||
|
||||
D3D10_RECT oldScissor;
|
||||
UINT numRects = 1;
|
||||
|
@ -356,7 +356,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
|||
mD3DManager->SetViewport(nsIntSize(desc.Width, desc.Height));
|
||||
|
||||
ID3D10RenderTargetView *views[2] = { viewBlack, viewWhite };
|
||||
device()->OMSetRenderTargets(2, views, NULL);
|
||||
device()->OMSetRenderTargets(2, views, nullptr);
|
||||
|
||||
gfx3DMatrix transform;
|
||||
transform.Translate(gfxPoint3D(-aOffset.x, -aOffset.y, 0));
|
||||
|
@ -383,7 +383,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
|||
}
|
||||
|
||||
views[0] = oldRT;
|
||||
device()->OMSetRenderTargets(1, views, NULL);
|
||||
device()->OMSetRenderTargets(1, views, nullptr);
|
||||
mD3DManager->SetViewport(oldVP);
|
||||
device()->RSSetScissorRects(1, &oldScissor);
|
||||
}
|
||||
|
@ -464,14 +464,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode)
|
|||
HRESULT hr;
|
||||
|
||||
if (!mTexture) {
|
||||
hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(mTexture));
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTexture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTexture, NULL, getter_AddRefs(mSRView));
|
||||
hr = device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
|
@ -483,7 +483,7 @@ ThebesLayerD3D10::CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode)
|
|||
|
||||
if (!mD2DSurface || mD2DSurface->CairoStatus()) {
|
||||
NS_WARNING("Failed to create surface for ThebesLayerD3D10.");
|
||||
mD2DSurface = NULL;
|
||||
mD2DSurface = nullptr;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -492,14 +492,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode)
|
|||
}
|
||||
|
||||
if (aMode == SURFACE_COMPONENT_ALPHA && !mTextureOnWhite) {
|
||||
hr = device()->CreateTexture2D(&desc, NULL, getter_AddRefs(mTextureOnWhite));
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTextureOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTextureOnWhite, NULL, getter_AddRefs(mSRViewOnWhite));
|
||||
hr = device()->CreateShaderResourceView(mTextureOnWhite, nullptr, getter_AddRefs(mSRViewOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче