mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 01:55:44 +00:00
Bug 877115 - Moz2Dify CanvasLayerD3D10 drawing shared surface into D3D10_MAPPED_TEXTURE2D. r=nical
This commit is contained in:
parent
26e7c572f6
commit
0d338d7e19
@ -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