tell our grcontext to abandon its backend
BUG=skia: Review URL: https://codereview.chromium.org/692803003
This commit is contained in:
parent
902d4d18de
commit
789e327ad9
@ -259,8 +259,12 @@ public:
|
|||||||
|
|
||||||
virtual void tearDownBackend(SampleWindow *win) {
|
virtual void tearDownBackend(SampleWindow *win) {
|
||||||
#if SK_SUPPORT_GPU
|
#if SK_SUPPORT_GPU
|
||||||
SkSafeUnref(fCurContext);
|
if (fCurContext) {
|
||||||
fCurContext = NULL;
|
// in case we have outstanding refs to this guy (lua?)
|
||||||
|
fCurContext->abandonContext();
|
||||||
|
fCurContext->unref();
|
||||||
|
fCurContext = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SkSafeUnref(fCurIntf);
|
SkSafeUnref(fCurIntf);
|
||||||
fCurIntf = NULL;
|
fCurIntf = NULL;
|
||||||
|
@ -386,6 +386,7 @@ CGLContextObj createGLContext(int msaaSampleCount) {
|
|||||||
andGetInfo:(SkOSWindow::AttachmentInfo*) info {
|
andGetInfo:(SkOSWindow::AttachmentInfo*) info {
|
||||||
if (nil == fGLContext) {
|
if (nil == fGLContext) {
|
||||||
CGLContextObj ctx = createGLContext(sampleCount);
|
CGLContextObj ctx = createGLContext(sampleCount);
|
||||||
|
SkASSERT(ctx);
|
||||||
fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:ctx];
|
fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:ctx];
|
||||||
CGLReleaseContext(ctx);
|
CGLReleaseContext(ctx);
|
||||||
if (NULL == fGLContext) {
|
if (NULL == fGLContext) {
|
||||||
|
Loading…
Reference in New Issue
Block a user