Bug 904890 - Part 1: Implement ISharedImage for D3D9SurfaceImage. r=nical

* * *
[mq]: fix-things
This commit is contained in:
Matt Woodrow
2014-04-07 15:09:08 +12:00
parent 9fe727a5ec
commit b0168aed2f
2 changed files with 33 additions and 3 deletions

View File

@@ -6,10 +6,20 @@
#include "D3D9SurfaceImage.h"
#include "gfxImageSurface.h"
#include "gfx2DGlue.h"
#include "mozilla/layers/TextureD3D9.h"
#include "mozilla/gfx/Types.h"
namespace mozilla {
namespace layers {
D3D9SurfaceImage::D3D9SurfaceImage()
: Image(nullptr, ImageFormat::D3D9_RGB32_TEXTURE)
, mSize(0, 0)
{}
D3D9SurfaceImage::~D3D9SurfaceImage() {}
HRESULT
D3D9SurfaceImage::SetData(const Data& aData)
{
@@ -172,6 +182,19 @@ D3D9SurfaceImage::DeprecatedGetAsSurface()
return surface.forget();
}
TextureClient*
D3D9SurfaceImage::GetTextureClient(CompositableClient* aClient)
{
EnsureSynchronized();
if (!mTextureClient) {
RefPtr<SharedTextureClientD3D9> textureClient =
new SharedTextureClientD3D9(gfx::SurfaceFormat::B8G8R8X8, TEXTURE_FLAGS_DEFAULT);
textureClient->InitWith(mTexture, mShareHandle, mDesc);
mTextureClient = textureClient;
}
return mTextureClient;
}
TemporaryRef<gfx::SourceSurface>
D3D9SurfaceImage::GetAsSourceSurface()
{