mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Issue #2357 - Paused WebM videos w/alpha are 100% transparent if HA is disabled.
Mozilla found a bug in their initial implementation, causing paused WebM videos with alpha to become totally transparent if hardware acceleration is disabled. Straight port of the Firefox 54 fix. Ref: BZ 1332952
This commit is contained in:
parent
c0ba3a8d2e
commit
9982ceb94f
2 changed files with 27 additions and 1 deletions
|
|
@ -106,7 +106,32 @@ SharedRGBImage::GetTextureClient(KnowsCompositor* aForwarder)
|
|||
already_AddRefed<gfx::SourceSurface>
|
||||
SharedRGBImage::GetAsSourceSurface()
|
||||
{
|
||||
return nullptr;
|
||||
NS_ASSERTION(NS_IsMainThread(), "Must be main thread");
|
||||
|
||||
if (mSourceSurface) {
|
||||
RefPtr<gfx::SourceSurface> surface(mSourceSurface);
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
RefPtr<gfx::SourceSurface> surface;
|
||||
{
|
||||
// We are 'borrowing' the DrawTarget and retaining a permanent reference to
|
||||
// the underlying data (via the surface). It is in this instance since we
|
||||
// know that the TextureClient is always wrapping a BufferTextureData and
|
||||
// therefore it won't go away underneath us.
|
||||
BufferTextureData* decoded_buffer =
|
||||
mTextureClient->GetInternalData()->AsBufferTextureData();
|
||||
RefPtr<gfx::DrawTarget> drawTarget = decoded_buffer->BorrowDrawTarget();
|
||||
|
||||
if (!drawTarget) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
surface = drawTarget->Snapshot();
|
||||
}
|
||||
|
||||
mSourceSurface = surface;
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ private:
|
|||
gfx::IntSize mSize;
|
||||
RefPtr<ImageClient> mCompositable;
|
||||
RefPtr<TextureClient> mTextureClient;
|
||||
nsCountedRef<nsMainThreadSourceSurfaceRef> mSourceSurface;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue