OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void MacGLContext::onPlatformSwapBuffers() const { | 102 void MacGLContext::onPlatformSwapBuffers() const { |
103 CGLFlushDrawable(fContext); | 103 CGLFlushDrawable(fContext); |
104 } | 104 } |
105 | 105 |
106 GrGLFuncPtr MacGLContext::onPlatformGetProcAddress(const char* procName) const { | 106 GrGLFuncPtr MacGLContext::onPlatformGetProcAddress(const char* procName) const { |
107 return reinterpret_cast<GrGLFuncPtr>(dlsym(fGLLibrary, procName)); | 107 return reinterpret_cast<GrGLFuncPtr>(dlsym(fGLLibrary, procName)); |
108 } | 108 } |
109 | 109 |
110 } // anonymous namespace | 110 } // anonymous namespace |
111 | 111 |
112 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { | 112 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s
hareContext) { |
| 113 SkASSERT(!shareContext); |
| 114 if (shareContext) { |
| 115 return nullptr; |
| 116 } |
| 117 |
113 if (kGLES_GrGLStandard == forcedGpuAPI) { | 118 if (kGLES_GrGLStandard == forcedGpuAPI) { |
114 return nullptr; | 119 return nullptr; |
115 } | 120 } |
116 MacGLContext* ctx = new MacGLContext; | 121 MacGLContext* ctx = new MacGLContext; |
117 if (!ctx->isValid()) { | 122 if (!ctx->isValid()) { |
118 delete ctx; | 123 delete ctx; |
119 return nullptr; | 124 return nullptr; |
120 } | 125 } |
121 return ctx; | 126 return ctx; |
122 } | 127 } |
123 | 128 |
124 #endif//defined(SK_BUILD_FOR_MAC) | 129 #endif//defined(SK_BUILD_FOR_MAC) |
OLD | NEW |