| 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/compositor/io_surface_context_mac.h" | 5 #include "ui/accelerated_widget_mac/io_surface_context.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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "ui/base/ui_base_switches.h" | |
| 15 #include "ui/gl/gl_switches.h" | 14 #include "ui/gl/gl_switches.h" |
| 16 #include "ui/gl/gpu_switching_manager.h" | 15 #include "ui/gl/gpu_switching_manager.h" |
| 17 | 16 |
| 18 namespace content { | 17 namespace ui { |
| 19 | 18 |
| 20 // static | 19 // static |
| 21 scoped_refptr<IOSurfaceContext> | 20 scoped_refptr<IOSurfaceContext> |
| 22 IOSurfaceContext::Get(Type type) { | 21 IOSurfaceContext::Get(Type type) { |
| 23 TRACE_EVENT0("browser", "IOSurfaceContext::Get"); | 22 TRACE_EVENT0("browser", "IOSurfaceContext::Get"); |
| 24 | 23 |
| 25 // Return the context for this type, if it exists. | 24 // Return the context for this type, if it exists. |
| 26 TypeMap::iterator found = type_map()->find(type); | 25 TypeMap::iterator found = type_map()->find(type); |
| 27 if (found != type_map()->end()) { | 26 if (found != type_map()->end()) { |
| 28 DCHECK(!found->second->poisoned_); | 27 DCHECK(!found->second->poisoned_); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // static | 110 // static |
| 112 IOSurfaceContext::TypeMap* | 111 IOSurfaceContext::TypeMap* |
| 113 IOSurfaceContext::type_map() { | 112 IOSurfaceContext::type_map() { |
| 114 return type_map_.Pointer(); | 113 return type_map_.Pointer(); |
| 115 } | 114 } |
| 116 | 115 |
| 117 // static | 116 // static |
| 118 base::LazyInstance<IOSurfaceContext::TypeMap> | 117 base::LazyInstance<IOSurfaceContext::TypeMap> |
| 119 IOSurfaceContext::type_map_; | 118 IOSurfaceContext::type_map_; |
| 120 | 119 |
| 121 } // namespace content | 120 } // namespace ui |
| OLD | NEW |