Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm ('k') | src/gpu/gl/mesa/SkMesaGLContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_MAC) 9 #if defined(SK_BUILD_FOR_MAC)
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (!gl->validate()) { 70 if (!gl->validate()) {
71 SkDebugf("Context could not validate GL interface.\n"); 71 SkDebugf("Context could not validate GL interface.\n");
72 this->destroyGLContext(); 72 this->destroyGLContext();
73 return; 73 return;
74 } 74 }
75 75
76 fGLLibrary = dlopen( 76 fGLLibrary = dlopen(
77 "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL. dylib", 77 "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL. dylib",
78 RTLD_LAZY); 78 RTLD_LAZY);
79 79
80 this->init(gl.detach()); 80 this->init(gl.release());
81 } 81 }
82 82
83 MacGLContext::~MacGLContext() { 83 MacGLContext::~MacGLContext() {
84 this->teardown(); 84 this->teardown();
85 this->destroyGLContext(); 85 this->destroyGLContext();
86 } 86 }
87 87
88 void MacGLContext::destroyGLContext() { 88 void MacGLContext::destroyGLContext() {
89 if (fContext) { 89 if (fContext) {
90 CGLReleaseContext(fContext); 90 CGLReleaseContext(fContext);
(...skipping 29 matching lines...) Expand all
120 } 120 }
121 MacGLContext* ctx = new MacGLContext; 121 MacGLContext* ctx = new MacGLContext;
122 if (!ctx->isValid()) { 122 if (!ctx->isValid()) {
123 delete ctx; 123 delete ctx;
124 return nullptr; 124 return nullptr;
125 } 125 }
126 return ctx; 126 return ctx;
127 } 127 }
128 128
129 #endif//defined(SK_BUILD_FOR_MAC) 129 #endif//defined(SK_BUILD_FOR_MAC)
OLDNEW
« no previous file with comments | « src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm ('k') | src/gpu/gl/mesa/SkMesaGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698