2011-08-09 12:38:26 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
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/. */
|
2011-08-09 12:38:26 -07:00
|
|
|
|
|
|
|
#include <d3d10_1.h>
|
|
|
|
#include <dxgi.h>
|
|
|
|
|
2013-12-20 08:46:30 -08:00
|
|
|
#include "mozilla/gfx/Point.h"
|
2013-04-25 15:25:33 -07:00
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
2013-04-24 11:42:40 -07:00
|
|
|
#include "mozilla/layers/PLayerTransaction.h"
|
2011-08-09 12:38:26 -07:00
|
|
|
#include "ShadowLayers.h"
|
|
|
|
|
2012-10-25 13:12:59 -07:00
|
|
|
using namespace mozilla::gl;
|
|
|
|
|
2011-08-09 12:38:26 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
ShadowLayerForwarder::PlatformSyncBeforeUpdate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/*static*/ bool
|
2013-04-25 15:25:33 -07:00
|
|
|
LayerManagerComposite::SupportsDirectTexturing()
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-08-09 12:38:26 -07:00
|
|
|
/*static*/ void
|
2013-04-25 15:25:33 -07:00
|
|
|
LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
|
2011-08-09 12:38:26 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
GetDescriptor(ID3D10Texture2D* aTexture, SurfaceDescriptorD3D10* aDescr)
|
|
|
|
{
|
|
|
|
NS_ABORT_IF_FALSE(aTexture && aDescr, "Params must be nonnull");
|
|
|
|
|
|
|
|
HRESULT hr;
|
2012-07-30 07:20:58 -07:00
|
|
|
IDXGIResource* dr = nullptr;
|
2011-08-09 12:38:26 -07:00
|
|
|
hr = aTexture->QueryInterface(__uuidof(IDXGIResource), (void**)&dr);
|
|
|
|
if (!SUCCEEDED(hr) || !dr)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
hr = dr->GetSharedHandle(reinterpret_cast<HANDLE*>(&aDescr->handle()));
|
|
|
|
return !!SUCCEEDED(hr);
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<ID3D10Texture2D>
|
|
|
|
OpenForeign(ID3D10Device* aDevice, const SurfaceDescriptorD3D10& aDescr)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
2012-07-30 07:20:58 -07:00
|
|
|
ID3D10Texture2D* tex = nullptr;
|
2011-08-09 12:38:26 -07:00
|
|
|
hr = aDevice->OpenSharedResource(reinterpret_cast<HANDLE>(aDescr.handle()),
|
|
|
|
__uuidof(ID3D10Texture2D),
|
|
|
|
(void**)&tex);
|
|
|
|
if (!SUCCEEDED(hr) || !tex)
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2011-08-09 12:38:26 -07:00
|
|
|
|
|
|
|
return nsRefPtr<ID3D10Texture2D>(tex).forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|