mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877115 - Moz2Dify CanvasLayerD3D10 drawing shared surface into D3D10_MAPPED_TEXTURE2D. r=nical
This commit is contained in:
parent
07bfb2b3d0
commit
56d3e44c60
@ -166,25 +166,17 @@ CanvasLayerD3D10::UpdateSurface()
|
||||
}
|
||||
|
||||
DataSourceSurface* frameData = shareSurf->GetData();
|
||||
// Scope for gfxContext, so it's destroyed before Unmap.
|
||||
// Scope for DrawTarget, so it's destroyed before Unmap.
|
||||
{
|
||||
RefPtr<DrawTarget> mapDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
|
||||
(uint8_t*)map.pData,
|
||||
shareSurf->Size(),
|
||||
frameData->GetSize(),
|
||||
map.RowPitch,
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
|
||||
nsRefPtr<gfxImageSurface> thebesFrameData =
|
||||
new gfxImageSurface(frameData->GetData(),
|
||||
ThebesIntSize(frameData->GetSize()),
|
||||
frameData->Stride(),
|
||||
SurfaceFormatToImageFormat(frameData->GetFormat()));
|
||||
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(mapDt);
|
||||
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
|
||||
ctx->SetSource(thebesFrameData);
|
||||
ctx->Paint();
|
||||
|
||||
Rect drawRect(0, 0, frameData->GetSize().width, frameData->GetSize().height);
|
||||
mapDt->DrawSurface(frameData, drawRect, drawRect,
|
||||
DrawSurfaceOptions(), DrawOptions(1.0F, CompositionOp::OP_SOURCE));
|
||||
mapDt->Flush();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user