Bug 912766. Use the DIB texture client/host. r=mattwoodrow

This commit is contained in:
Nicholas Cameron
2013-09-24 13:14:12 +12:00
parent 7dda0ad7b7
commit d93bcff327
5 changed files with 27 additions and 14 deletions

View File

@@ -10,6 +10,7 @@
#include "mozilla/layers/TextureClient.h" // for DeprecatedTextureClient, etc
#include "mozilla/layers/TextureClientOGL.h"
#include "mozilla/mozalloc.h" // for operator delete, etc
#include "gfxASurface.h" // for gfxContentType
#ifdef XP_WIN
#include "mozilla/layers/TextureD3D9.h"
#include "mozilla/layers/TextureD3D11.h"
@@ -107,7 +108,8 @@ CompositableChild::Destroy()
}
TemporaryRef<DeprecatedTextureClient>
CompositableClient::CreateDeprecatedTextureClient(DeprecatedTextureClientType aDeprecatedTextureClientType)
CompositableClient::CreateDeprecatedTextureClient(DeprecatedTextureClientType aDeprecatedTextureClientType,
gfxASurface::gfxContentType aContentType)
{
MOZ_ASSERT(GetForwarder(), "Can't create a texture client if the compositable is not connected to the compositor.");
LayersBackend parentBackend = GetForwarder()->GetCompositorBackendType();
@@ -145,7 +147,11 @@ CompositableClient::CreateDeprecatedTextureClient(DeprecatedTextureClientType aD
}
if (parentBackend == LAYERS_D3D9 &&
!GetForwarder()->ForwardsToDifferentProcess()) {
result = new DeprecatedTextureClientD3D9(GetForwarder(), GetTextureInfo());
if (aContentType == gfxASurface::CONTENT_COLOR_ALPHA) {
result = new DeprecatedTextureClientDIB(GetForwarder(), GetTextureInfo());
} else {
result = new DeprecatedTextureClientD3D9(GetForwarder(), GetTextureInfo());
}
break;
}
#endif