Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: components/exo/display.cc

Issue 2008153002: Add initial implementation of cc::Surfaces backend for exo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/display.h" 5 #include "components/exo/display.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
11 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
12 #include "base/trace_event/trace_event_argument.h" 13 #include "base/trace_event/trace_event_argument.h"
13 #include "components/exo/shared_memory.h" 14 #include "components/exo/shared_memory.h"
14 #include "components/exo/shell_surface.h" 15 #include "components/exo/shell_surface.h"
15 #include "components/exo/sub_surface.h" 16 #include "components/exo/sub_surface.h"
16 #include "components/exo/surface.h" 17 #include "components/exo/surface.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 19
19 #if defined(USE_OZONE) 20 #if defined(USE_OZONE)
20 #include <GLES2/gl2extchromium.h> 21 #include <GLES2/gl2extchromium.h>
21 #include "components/exo/buffer.h" 22 #include "components/exo/buffer.h"
22 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 23 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
23 #include "third_party/khronos/GLES2/gl2.h" 24 #include "third_party/khronos/GLES2/gl2.h"
24 #include "third_party/khronos/GLES2/gl2ext.h" 25 #include "third_party/khronos/GLES2/gl2ext.h"
25 #include "ui/aura/env.h" 26 #include "ui/aura/env.h"
26 #endif 27 #endif
27 28
28 namespace exo { 29 namespace exo {
29 30
31 const char kUseExoSurfaceLayer[] = "use-exo-surface-layer";
32
30 //////////////////////////////////////////////////////////////////////////////// 33 ////////////////////////////////////////////////////////////////////////////////
31 // Display, public: 34 // Display, public:
32 35
33 Display::Display() {} 36 Display::Display() {
37 Surface::SetUseSurfaceLayer(
38 base::CommandLine::ForCurrentProcess()->HasSwitch(kUseExoSurfaceLayer));
39 }
34 40
35 Display::~Display() {} 41 Display::~Display() {}
36 42
37 std::unique_ptr<Surface> Display::CreateSurface() { 43 std::unique_ptr<Surface> Display::CreateSurface() {
38 TRACE_EVENT0("exo", "Display::CreateSurface"); 44 TRACE_EVENT0("exo", "Display::CreateSurface");
39 45
40 return base::WrapUnique(new Surface); 46 return base::WrapUnique(new Surface);
41 } 47 }
42 48
43 std::unique_ptr<SharedMemory> Display::CreateSharedMemory( 49 std::unique_ptr<SharedMemory> Display::CreateSharedMemory(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 145
140 if (surface->HasSurfaceDelegate()) { 146 if (surface->HasSurfaceDelegate()) {
141 DLOG(ERROR) << "Surface has already been assigned a role"; 147 DLOG(ERROR) << "Surface has already been assigned a role";
142 return nullptr; 148 return nullptr;
143 } 149 }
144 150
145 return base::WrapUnique(new SubSurface(surface, parent)); 151 return base::WrapUnique(new SubSurface(surface, parent));
146 } 152 }
147 153
148 } // namespace exo 154 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698