Backed out 12 changesets (bug 1200595) for b2g mochitest crashes in SharedBufferManagerParent CLOSED TREE

Backed out changeset cf8cf1a039dd (bug 1200595)
Backed out changeset 65da564f952c (bug 1200595)
Backed out changeset 7663208f1582 (bug 1200595)
Backed out changeset fc1fbb97c8eb (bug 1200595)
Backed out changeset 3ad5a4c457fe (bug 1200595)
Backed out changeset add3fe9afc0c (bug 1200595)
Backed out changeset 68aba6b39588 (bug 1200595)
Backed out changeset ab326c34f1cf (bug 1200595)
Backed out changeset ed34bc528a1b (bug 1200595)
Backed out changeset 0dc93424546c (bug 1200595)
Backed out changeset 8cc12f12f3d1 (bug 1200595)
Backed out changeset bb84403701b7 (bug 1200595)
This commit is contained in:
Wes Kocher
2015-11-24 10:07:02 -08:00
parent 84ef9bcd3c
commit 76bed94f9a
62 changed files with 3081 additions and 3212 deletions

View File

@@ -13,7 +13,6 @@
#include "gfxPlatform.h" // for gfxPlatform
#include "GLReadTexImageHelper.h"
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/layers/BufferTexture.h"
#include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/layers/CompositableForwarder.h"
#include "mozilla/layers/CompositorChild.h" // for CompositorChild
@@ -201,21 +200,21 @@ public:
}
protected:
already_AddRefed<TextureClient> Create(gfx::SurfaceFormat format) {
already_AddRefed<BufferTextureClient> Create(gfx::SurfaceFormat format) {
return TextureClient::CreateForRawBufferAccess(mAllocator, format,
mSize, mBackendType,
mBaseTexFlags);
}
public:
already_AddRefed<TextureClient> CreateB8G8R8AX8() {
already_AddRefed<BufferTextureClient> CreateB8G8R8AX8() {
gfx::SurfaceFormat format = mHasAlpha ? gfx::SurfaceFormat::B8G8R8A8
: gfx::SurfaceFormat::B8G8R8X8;
return Create(format);
}
already_AddRefed<TextureClient> CreateR8G8B8AX8() {
RefPtr<TextureClient> ret;
already_AddRefed<BufferTextureClient> CreateR8G8B8AX8() {
RefPtr<BufferTextureClient> ret;
bool areRGBAFormatsBroken = mLayersBackend == LayersBackend::LAYERS_BASIC;
if (!areRGBAFormatsBroken) {
@@ -243,7 +242,7 @@ TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator,
TexClientFactory factory(allocator, src->mHasAlpha, src->mSize, backendType,
baseFlags, layersBackend);
RefPtr<TextureClient> texClient;
RefPtr<BufferTextureClient> texClient;
{
gl::ScopedReadbackFB autoReadback(src);
@@ -289,18 +288,16 @@ TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator,
DebugOnly<bool> succeeded = autoLock.Succeeded();
MOZ_ASSERT(succeeded, "texture should have locked");
MappedTextureData mapped;
texClient->BorrowMappedData(mapped);
uint8_t* lockedBytes = texClient->GetLockedData();
// ReadPixels from the current FB into mapped.data.
// ReadPixels from the current FB into lockedBits.
auto width = src->mSize.width;
auto height = src->mSize.height;
{
ScopedPackAlignment autoAlign(gl, 4);
MOZ_ASSERT(mapped.stride/4 == mapped.size.width);
gl->raw_fReadPixels(0, 0, width, height, readFormat, readType, mapped.data);
gl->raw_fReadPixels(0, 0, width, height, readFormat, readType, lockedBytes);
}
// RB_SWAPPED doesn't work with D3D11. (bug 1051010)
@@ -313,7 +310,7 @@ TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator,
layersNeedsManualSwap)
{
size_t pixels = width * height;
uint8_t* itr = mapped.data;
uint8_t* itr = lockedBytes;
for (size_t i = 0; i < pixels; i++) {
SwapRB_R8G8B8A8(itr);
itr += 4;