зеркало из https://github.com/mozilla/gecko-dev.git
Bug 877115 - Moz2Dify CanvasLayerD3D9 drawing shared surface into D3DLOCKED_RECT. r=nical
This commit is contained in:
Родитель
83a5bad4dc
Коммит
0cfaf40c48
|
@ -102,26 +102,19 @@ CanvasLayerD3D9::UpdateSurface()
|
|||
D3DLOCKED_RECT rect = textureLock.GetLockRect();
|
||||
|
||||
DataSourceSurface* frameData = shareSurf->GetData();
|
||||
// Scope for gfxContext, so it's destroyed early.
|
||||
// Scope for DrawTarget, so it's destroyed early.
|
||||
{
|
||||
RefPtr<DrawTarget> mapDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
|
||||
(uint8_t*)rect.pBits,
|
||||
shareSurf->Size(),
|
||||
rect.Pitch,
|
||||
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();
|
||||
RefPtr<DrawTarget> rectDt = Factory::CreateDrawTargetForData(BACKEND_CAIRO,
|
||||
(uint8_t*)rect.pBits,
|
||||
frameData->GetSize(),
|
||||
rect.Pitch,
|
||||
FORMAT_B8G8R8A8);
|
||||
|
||||
mapDt->Flush();
|
||||
Rect drawRect(0, 0, frameData->GetSize().width, frameData->GetSize().height);
|
||||
rectDt->DrawSurface(frameData, drawRect, drawRect,
|
||||
DrawSurfaceOptions(), DrawOptions(1.0F, OP_SOURCE));
|
||||
rectDt->Flush();
|
||||
}
|
||||
} else {
|
||||
RECT r;
|
||||
|
|
Загрузка…
Ссылка в новой задаче