OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/shared_memory.h" | 5 #include "components/exo/shared_memory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
11 #include "components/exo/buffer.h" | 12 #include "components/exo/buffer.h" |
12 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 13 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
13 #include "third_party/khronos/GLES2/gl2.h" | 14 #include "third_party/khronos/GLES2/gl2.h" |
14 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
15 #include "ui/compositor/compositor.h" | 16 #include "ui/compositor/compositor.h" |
16 #include "ui/gfx/buffer_format_util.h" | 17 #include "ui/gfx/buffer_format_util.h" |
17 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer = | 69 scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer = |
69 aura::Env::GetInstance() | 70 aura::Env::GetInstance() |
70 ->context_factory() | 71 ->context_factory() |
71 ->GetGpuMemoryBufferManager() | 72 ->GetGpuMemoryBufferManager() |
72 ->CreateGpuMemoryBufferFromHandle(handle, size, format); | 73 ->CreateGpuMemoryBufferFromHandle(handle, size, format); |
73 if (!gpu_memory_buffer) { | 74 if (!gpu_memory_buffer) { |
74 LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle"; | 75 LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle"; |
75 return nullptr; | 76 return nullptr; |
76 } | 77 } |
77 | 78 |
78 return make_scoped_ptr(new Buffer(gpu_memory_buffer.Pass(), GL_TEXTURE_2D)); | 79 return make_scoped_ptr( |
| 80 new Buffer(std::move(gpu_memory_buffer), GL_TEXTURE_2D)); |
79 } | 81 } |
80 | 82 |
81 } // namespace exo | 83 } // namespace exo |
OLD | NEW |