Bug 1066280 - Fixes. - r=kamidphish,mattwoodrow

From 4e9f52ab105333e8b1120342e9583b2d833a4465 Mon Sep 17 00:00:00 2001
---
 dom/canvas/WebGLContext.cpp                | 10 +++++--
 gfx/gl/GLContext.cpp                       | 20 --------------
 gfx/gl/GLContext.h                         |  3 --
 gfx/gl/GLReadTexImageHelper.cpp            |  5 +++-
 gfx/gl/GLScreenBuffer.cpp                  | 13 +++++++--
 gfx/gl/GLUploadHelpers.cpp                 | 27 ++++++++++++++++++
 gfx/gl/SharedSurfaceGralloc.cpp            | 14 ++++------
 gfx/gl/SharedSurfaceGralloc.h              | 10 +++++--
 gfx/gl/SurfaceTypes.cpp                    |  2 ++
 gfx/gl/SurfaceTypes.h                      |  1 +
 gfx/layers/client/CanvasClient.cpp         | 44 ++++++++++++++++++------------
 gfx/layers/client/CanvasClient.h           |  8 +++---
 gfx/layers/client/ClientCanvasLayer.cpp    |  6 ++++
 gfx/layers/client/ClientCanvasLayer.h      |  2 +-
 gfx/layers/client/TextureClient.cpp        | 11 ++++----
 gfx/layers/client/TextureClient.h          |  6 ++--
 gfx/layers/composite/TextureHost.cpp       | 15 +++++-----
 gfx/layers/composite/TextureHost.h         | 10 +++----
 gfx/layers/d3d10/CanvasLayerD3D10.cpp      |  9 ++++--
 gfx/layers/d3d9/CanvasLayerD3D9.cpp        |  8 ++++--
 gfx/layers/ipc/LayersSurfaces.ipdlh        |  4 +--
 gfx/layers/moz.build                       |  4 ++-
 gfx/layers/opengl/GrallocTextureClient.cpp | 26 +++++++++++++++++-
 gfx/layers/opengl/GrallocTextureClient.h   |  3 ++
 24 files changed, 171 insertions(+), 90 deletions(-)
This commit is contained in:
jdashg
2014-10-07 21:11:54 -07:00
parent e48648f8ea
commit fd685b2322
24 changed files with 171 additions and 90 deletions

View File

@@ -12,6 +12,7 @@
#include "mozilla/layers/ISurfaceAllocator.h"
#include "mozilla/layers/ShadowLayerUtilsGralloc.h"
#include "gfx2DGlue.h"
#include "SharedSurfaceGralloc.h"
namespace mozilla {
namespace layers {
@@ -112,7 +113,7 @@ GrallocTextureClientOGL::WaitForBufferOwnership()
#if ANDROID_VERSION == 17
fence->waitForever(1000, "GrallocTextureClientOGL::Lock");
// 1000 is what Android uses. It is warning timeout ms.
// This timeous is removed since ANDROID_VERSION 18.
// This timeous is removed since ANDROID_VERSION 18.
#else
fence->waitForever("GrallocTextureClientOGL::Lock");
#endif
@@ -346,6 +347,29 @@ GrallocTextureClientOGL::GetBufferSize() const
return 0;
}
/*static*/ TemporaryRef<TextureClient>
GrallocTextureClientOGL::FromShSurf(gl::SharedSurface* abstractSurf,
TextureFlags flags)
{
auto surf = gl::SharedSurface_Gralloc::Cast(abstractSurf);
RefPtr<TextureClient> ret = surf->GetTextureClient();
TextureFlags mask = TextureFlags::NEEDS_Y_FLIP |
TextureFlags::RB_SWAPPED |
TextureFlags::NON_PREMULTIPLIED;
TextureFlags required = flags & mask;
TextureFlags present = ret->GetFlags() & mask;
if (present != required) {
printf_stderr("Present flags: 0x%x. Required: 0x%x.\n",
(uint32_t)present,
(uint32_t)required);
MOZ_CRASH("Flag requirement mismatch.");
}
return ret.forget();
}
} // namesapace layers
} // namesapace mozilla