mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1297820 - Check if we have a nsIWidget before using NS_NATIVE_OPENGL_CONTEXT. r=jgilbert
MozReview-Commit-ID: 5qmYkOoPMSo --HG-- extra : rebase_source : 71a71cca96c6a20244886a0a7579009683c9b709
This commit is contained in:
parent
fc82e10522
commit
c638189eee
@ -109,7 +109,8 @@ CompositorOGL::CreateContext()
|
||||
RefPtr<GLContext> context;
|
||||
|
||||
// Used by mock widget to create an offscreen context
|
||||
void* widgetOpenGLContext = mWidget->RealWidget()->GetNativeData(NS_NATIVE_OPENGL_CONTEXT);
|
||||
nsIWidget* widget = mWidget->RealWidget();
|
||||
void* widgetOpenGLContext = widget ? widget->GetNativeData(NS_NATIVE_OPENGL_CONTEXT) : nullptr;
|
||||
if (widgetOpenGLContext) {
|
||||
GLContext* alreadyRefed = reinterpret_cast<GLContext*>(widgetOpenGLContext);
|
||||
return already_AddRefed<GLContext>(alreadyRefed);
|
||||
@ -144,7 +145,8 @@ CompositorOGL::CreateContext()
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
mWidget->RealWidget()->SetNativeData(
|
||||
MOZ_ASSERT(widget);
|
||||
widget->SetNativeData(
|
||||
NS_NATIVE_OPENGL_CONTEXT, reinterpret_cast<uintptr_t>(context.get()));
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user