mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 965096 - Backed out changeset 224e15123ae0 because of wrong bug number. r=me
This commit is contained in:
parent
eb64d872aa
commit
a22bfcb0ef
@ -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);
|
||||
|
@ -63,8 +63,7 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
useDoubleBuffering = (LayerManagerComposite::SupportsDirectTexturing() &&
|
||||
backend != LayersBackend::LAYERS_D3D9) ||
|
||||
useDoubleBuffering = LayerManagerComposite::SupportsDirectTexturing() ||
|
||||
backend == LayersBackend::LAYERS_BASIC;
|
||||
}
|
||||
|
||||
|
@ -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 =
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user