OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/exo/display.h" |
| 6 |
| 7 #include "base/trace_event/trace_event.h" |
| 8 #include "base/trace_event/trace_event_argument.h" |
| 9 #include "components/exo/shared_memory.h" |
| 10 #include "components/exo/shell_surface.h" |
| 11 #include "components/exo/surface.h" |
| 12 |
| 13 namespace exo { |
| 14 |
| 15 //////////////////////////////////////////////////////////////////////////////// |
| 16 // Display, public: |
| 17 |
| 18 Display::Display() {} |
| 19 |
| 20 Display::~Display() {} |
| 21 |
| 22 scoped_ptr<Surface> Display::CreateSurface() { |
| 23 TRACE_EVENT0("exo", "Display::CreateSurface"); |
| 24 |
| 25 return make_scoped_ptr(new Surface); |
| 26 } |
| 27 |
| 28 scoped_ptr<SharedMemory> Display::CreateSharedMemory( |
| 29 const base::SharedMemoryHandle& handle, |
| 30 size_t size) { |
| 31 TRACE_EVENT1("exo", "Display::CreateSharedMemory", "size", size); |
| 32 |
| 33 if (!base::SharedMemory::IsHandleValid(handle)) |
| 34 return nullptr; |
| 35 |
| 36 return make_scoped_ptr(new SharedMemory(handle)); |
| 37 } |
| 38 |
| 39 scoped_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { |
| 40 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", |
| 41 surface->AsTracedValue()); |
| 42 |
| 43 return make_scoped_ptr(new ShellSurface(surface)); |
| 44 } |
| 45 |
| 46 } // namespace exo |
OLD | NEW |