Bug 965096 - Backed out changeset 224e15123ae0 because of wrong bug number. r=me

This commit is contained in:
Nicolas Silva 2014-02-07 14:24:30 +01:00
parent eb64d872aa
commit a22bfcb0ef
4 changed files with 10 additions and 25 deletions

View File

@ -207,7 +207,8 @@ CompositableClient::CreateTextureClientForDrawing(SurfaceFormat aFormat,
if (parentBackend == LayersBackend::LAYERS_D3D9 &&
!GetForwarder()->ForwardsToDifferentProcess() &&
!(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
if (!gfxWindowsPlatform::GetPlatform()->GetD3D9Device()) {
// non-DIB textures don't work with alpha, see notes in TextureD3D9.
if (ContentForFormat(aFormat) != gfxContentType::COLOR) {
result = new DIBTextureClientD3D9(aFormat, aTextureFlags);
} else {
result = new CairoTextureClientD3D9(aFormat, aTextureFlags);

View File

@ -63,8 +63,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
} else
#endif
{
useDoubleBuffering = (LayerManagerComposite::SupportsDirectTexturing() &&
backend != LayersBackend::LAYERS_D3D9) ||
useDoubleBuffering = LayerManagerComposite::SupportsDirectTexturing() ||
backend == LayersBackend::LAYERS_BASIC;
}

View File

@ -1258,7 +1258,6 @@ CairoTextureClientD3D9::CairoTextureClientD3D9(gfx::SurfaceFormat aFormat, Textu
, mFormat(aFormat)
, mIsLocked(false)
, mNeedsClear(false)
, mLockRect(false)
{
MOZ_COUNT_CTOR(CairoTextureClientD3D9);
}
@ -1292,11 +1291,6 @@ CairoTextureClientD3D9::Unlock()
mDrawTarget = nullptr;
}
if (mLockRect) {
mD3D9Surface->UnlockRect();
mLockRect = false;
}
if (mSurface) {
mSurface = nullptr;
}
@ -1339,19 +1333,11 @@ CairoTextureClientD3D9::GetAsDrawTarget()
}
}
if (ContentForFormat(mFormat) == gfxContentType::COLOR_ALPHA) {
D3DLOCKED_RECT rect;
mD3D9Surface->LockRect(&rect, nullptr, 0);
mSurface = new gfxImageSurface((uint8_t*)rect.pBits, ThebesIntSize(mSize),
rect.Pitch, gfxImageFormat::ARGB32);
mLockRect = true;
} else {
mSurface = new gfxWindowsSurface(mD3D9Surface);
if (!mSurface || mSurface->CairoStatus()) {
NS_WARNING("Could not create surface for d3d9 surface");
mSurface = nullptr;
return nullptr;
}
mSurface = new gfxWindowsSurface(mD3D9Surface);
if (!mSurface || mSurface->CairoStatus()) {
NS_WARNING("Could not create surface for d3d9 surface");
mSurface = nullptr;
return nullptr;
}
mDrawTarget =

View File

@ -181,7 +181,7 @@ protected:
};
/**
* Can only be drawn into through Cairo and need a D3D9 context on the client side.
* Can only be drawn into through Cairo, and only support opaque surfaces.
* The corresponding TextureHost is TextureHostD3D9.
*/
class CairoTextureClientD3D9 : public TextureClient
@ -228,12 +228,11 @@ private:
gfx::SurfaceFormat mFormat;
bool mIsLocked;
bool mNeedsClear;
bool mLockRect;
};
/**
* Can only be drawn into through Cairo.
* Prefer CairoTextureClientD3D9 when possible.
* Supports opaque surfaces. Prefer CairoTextureClientD3D9 when possible.
* The coresponding TextureHost is DIBTextureHostD3D9.
*/
class DIBTextureClientD3D9 : public TextureClient