Backed out changeset a52fb149b9ee (bug 1072501) for talos e10s failures resulting in crashes with UpdateFromSurface in the signature CLOSED TREE

--HG--
extra : rebase_source : 9d5e20d8dad0357d00602feb0e42dfd605307616
This commit is contained in:
Wes Kocher 2015-12-02 11:59:07 -08:00
Родитель 9c0fbd9079
Коммит b4fe562f90
2 изменённых файлов: 7 добавлений и 16 удалений

Просмотреть файл

@ -128,10 +128,7 @@ DIBTextureData::UpdateFromSurface(gfx::SourceSurface* aSurface)
}
DataSourceSurface::MappedSurface sourceMap;
if (!srcSurf->Map(gfx::DataSourceSurface::READ, &sourceMap)) {
gfxCriticalError() << "Failed to map source surface for UpdateFromSurface.";
return false;
}
srcSurf->Map(DataSourceSurface::READ, &sourceMap);
for (int y = 0; y < srcSurf->GetSize().height; y++) {
memcpy(imgSurf->Data() + imgSurf->Stride() * y,
@ -233,9 +230,10 @@ ShmemDIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
}
uint8_t* data = (uint8_t*)::MapViewOfFile(fileMapping, FILE_MAP_WRITE | FILE_MAP_READ,
0, 0, mapSize);
0, 0, aSize.width * aSize.height
* BytesPerPixel(aFormat));
memset(data, 0x80, mapSize);
memset(data, 0x80, aSize.width * aSize.height * BytesPerPixel(aFormat));
::UnmapViewOfFile(fileMapping);
@ -389,14 +387,6 @@ TextureHostFileMapping::~TextureHostFileMapping()
::CloseHandle(mFileMapping);
}
UserDataKey kFileMappingKey;
static void UnmapFileData(void* aData)
{
MOZ_ASSERT(aData);
::UnmapViewOfFile(aData);
}
void
TextureHostFileMapping::UpdatedInternal(const nsIntRegion* aRegion)
{
@ -415,14 +405,14 @@ TextureHostFileMapping::UpdatedInternal(const nsIntRegion* aRegion)
if (data) {
RefPtr<DataSourceSurface> surf = Factory::CreateWrappingDataSourceSurface(data, mSize.width * BytesPerPixel(mFormat), mSize, mFormat);
surf->AddUserData(&kFileMappingKey, data, UnmapFileData);
if (!mTextureSource->Update(surf, const_cast<nsIntRegion*>(aRegion))) {
mTextureSource = nullptr;
}
} else {
mTextureSource = nullptr;
}
::UnmapViewOfFile(data);
}
}

Просмотреть файл

@ -732,6 +732,7 @@ TextureClient::CreateForDrawing(CompositableForwarder* aAllocator,
}
if (!data && aFormat == SurfaceFormat::B8G8R8X8 &&
aAllocator->IsSameProcess() &&
moz2DBackend == gfx::BackendType::CAIRO &&
NS_IsMainThread()) {
data = DIBTextureData::Create(aSize, aFormat, aAllocator);