| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/gl/gl_image_io_surface.h" | 5 #include "ui/gl/gl_image_io_surface.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return false; | 210 return false; |
| 211 CALayer* layer = found->second; | 211 CALayer* layer = found->second; |
| 212 | 212 |
| 213 // Also note that transactions are not disabled. The caller must ensure that | 213 // Also note that transactions are not disabled. The caller must ensure that |
| 214 // all changes to the CALayer tree happen atomically. | 214 // all changes to the CALayer tree happen atomically. |
| 215 [layer setContents:static_cast<id>(io_surface_.get())]; | 215 [layer setContents:static_cast<id>(io_surface_.get())]; |
| 216 [layer setFrame:bounds_rect.ToCGRect()]; | 216 [layer setFrame:bounds_rect.ToCGRect()]; |
| 217 return true; | 217 return true; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void GLImageIOSurface::DumpMemory(base::trace_event::ProcessMemoryDump* pmd, |
| 221 uint64_t process_tracing_id, |
| 222 const std::string& dump_name) { |
| 223 // TODO(ericrk): Implement GLImage DumpMemory. crbug.com/514914 |
| 224 } |
| 225 |
| 220 // static | 226 // static |
| 221 void GLImageIOSurface::SetLayerForWidget( | 227 void GLImageIOSurface::SetLayerForWidget( |
| 222 gfx::AcceleratedWidget widget, CALayer* layer) { | 228 gfx::AcceleratedWidget widget, CALayer* layer) { |
| 223 if (layer) | 229 if (layer) |
| 224 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer)); | 230 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer)); |
| 225 else | 231 else |
| 226 g_widget_to_layer_map.Pointer()->erase(widget); | 232 g_widget_to_layer_map.Pointer()->erase(widget); |
| 227 } | 233 } |
| 228 | 234 |
| 229 } // namespace gfx | 235 } // namespace gfx |
| OLD | NEW |