Bug 630346 - Merge LayerManagerOGL::CleanupResources into LayerManagerOGL::Destroy r=karlt

--HG--
extra : rebase_source : ef7c3c9855f3a3e22b8a8529d922587eaf71ba43
This commit is contained in:
Marco Castelluccio 2012-09-24 11:23:39 +12:00
parent cc2ccf530a
commit ec6cdae848
2 changed files with 8 additions and 19 deletions

View File

@ -308,28 +308,17 @@ LayerManagerOGL::~LayerManagerOGL()
void
LayerManagerOGL::Destroy()
{
if (!mDestroyed) {
if (mRoot) {
RootLayer()->Destroy();
}
mRoot = nullptr;
CleanupResources();
mDestroyed = true;
}
}
void
LayerManagerOGL::CleanupResources()
{
if (!mGLContext)
if (mDestroyed)
return;
if (mRoot) {
RootLayer()->CleanupResources();
RootLayer()->Destroy();
mRoot = nullptr;
}
if (!mGLContext)
return;
nsRefPtr<GLContext> ctx = mGLContext->GetSharedContext();
if (!ctx) {
ctx = mGLContext;
@ -362,6 +351,8 @@ LayerManagerOGL::CleanupResources()
}
mGLContext = nullptr;
mDestroyed = true;
}
already_AddRefed<mozilla::gl::GLContext>

View File

@ -59,8 +59,6 @@ public:
bool aIsRenderingToEGLSurface = false);
virtual ~LayerManagerOGL();
void CleanupResources();
void Destroy();