Bug 881169 - Fix SharedSurface_Gralloc::Create crash due to null allocator. r=vlad

When skiaGL enabled, pass ISurfaceAllocator to gralloc backend for gl streaming
This commit is contained in:
Peter Chang 2013-06-11 08:21:48 -04:00
parent 2852502e28
commit fcb189d8ac

View File

@ -107,6 +107,10 @@
#include "gfxWindowsPlatform.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
// windows.h (included by chromium code) defines this, in its infinite wisdom
#undef DrawText
@ -783,6 +787,13 @@ CanvasRenderingContext2D::EnsureTarget()
SurfaceCaps caps = SurfaceCaps::ForRGBA();
caps.preserve = true;
#ifdef MOZ_WIDGET_GONK
layers::ShadowLayerForwarder *forwarder = layerManager->AsShadowForwarder();
if (forwarder) {
caps.surfaceAllocator = static_cast<layers::ISurfaceAllocator*>(forwarder);
}
#endif
mGLContext = mozilla::gl::GLContextProvider::CreateOffscreen(gfxIntSize(size.width,
size.height),
caps,