Backed out changesets bfd0864f189d and dba042cbc381 (bug 877115) for Windows bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-01-13 10:46:09 -05:00
parent a72d947bb3
commit d8e43ac26b
2 changed files with 30 additions and 15 deletions

View File

@ -166,17 +166,25 @@ CanvasLayerD3D10::UpdateSurface()
}
DataSourceSurface* frameData = shareSurf->GetData();
// Scope for DrawTarget, so it's destroyed before Unmap.
// Scope for gfxContext, so it's destroyed before Unmap.
{
RefPtr<DrawTarget> mapDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
(uint8_t*)map.pData,
frameData->GetSize(),
shareSurf->Size(),
map.RowPitch,
SurfaceFormat::B8G8R8A8);
Rect drawRect(0, 0, frameData->GetSize().width, frameData->GetSize().height);
mapDt->DrawSurface(frameData, drawRect, drawRect,
DrawSurfaceOptions(), DrawOptions(1.0F, OP_SOURCE));
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();
mapDt->Flush();
}

View File

@ -102,19 +102,26 @@ CanvasLayerD3D9::UpdateSurface()
D3DLOCKED_RECT rect = textureLock.GetLockRect();
DataSourceSurface* frameData = shareSurf->GetData();
// Scope for DrawTarget, so it's destroyed early.
// Scope for gfxContext, so it's destroyed early.
{
RefPtr<DrawTarget> rectDt = Factory::CreateDrawTargetForData(BACKEND_CAIRO,
(uint8_t*)rect.pBits,
frameData->GetSize(),
rect.Pitch,
FORMAT_B8G8R8A8);
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();
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;