| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h" | 5 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h" |
| 6 | 6 |
| 7 #include <OpenGL/gl.h> | 7 #include <OpenGL/gl.h> |
| 8 #include <OpenGL/OpenGL.h> | 8 #include <OpenGL/OpenGL.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 shader_program_cache->UseBlitProgram() && | 137 shader_program_cache->UseBlitProgram() && |
| 138 shader_program_cache->UseSolidWhiteProgram()); | 138 shader_program_cache->UseSolidWhiteProgram()); |
| 139 } | 139 } |
| 140 glUseProgram(0u); | 140 glUseProgram(0u); |
| 141 } | 141 } |
| 142 if (!prepared) { | 142 if (!prepared) { |
| 143 LOG(ERROR) << "IOSurface failed to compile/link required shader programs."; | 143 LOG(ERROR) << "IOSurface failed to compile/link required shader programs."; |
| 144 return NULL; | 144 return NULL; |
| 145 } | 145 } |
| 146 | 146 |
| 147 scoped_refptr<DisplayLinkMac> display_link = DisplayLinkMac::Create(); | 147 scoped_refptr<DisplayLinkMac> display_link; |
| 148 if (!display_link) { | 148 if (!is_vsync_disabled) { |
| 149 LOG(ERROR) << "Failed to create display link for GL context."; | 149 display_link = DisplayLinkMac::Create(); |
| 150 return NULL; | 150 if (!display_link) { |
| 151 LOG(ERROR) << "Failed to create display link for GL context."; |
| 152 return NULL; |
| 153 } |
| 151 } | 154 } |
| 152 | 155 |
| 153 return new CompositingIOSurfaceContext( | 156 return new CompositingIOSurfaceContext( |
| 154 window_number, | 157 window_number, |
| 155 nsgl_context.release(), | 158 nsgl_context.release(), |
| 156 cgl_context_strong, | 159 cgl_context_strong, |
| 157 cgl_context, | 160 cgl_context, |
| 158 is_vsync_disabled, | 161 is_vsync_disabled, |
| 159 display_link, | 162 display_link, |
| 160 shader_program_cache.Pass()); | 163 shader_program_cache.Pass()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 CompositingIOSurfaceContext::WindowMap* | 236 CompositingIOSurfaceContext::WindowMap* |
| 234 CompositingIOSurfaceContext::window_map() { | 237 CompositingIOSurfaceContext::window_map() { |
| 235 return window_map_.Pointer(); | 238 return window_map_.Pointer(); |
| 236 } | 239 } |
| 237 | 240 |
| 238 // static | 241 // static |
| 239 base::LazyInstance<CompositingIOSurfaceContext::WindowMap> | 242 base::LazyInstance<CompositingIOSurfaceContext::WindowMap> |
| 240 CompositingIOSurfaceContext::window_map_; | 243 CompositingIOSurfaceContext::window_map_; |
| 241 | 244 |
| 242 } // namespace content | 245 } // namespace content |
| OLD | NEW |