OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/dri/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h" |
6 | 6 |
7 #include <EGL/egl.h> | 7 #include <EGL/egl.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "ui/gfx/ozone/surface_ozone_egl.h" | 10 #include "ui/ozone/factories/surface_ozone_egl.h" |
11 #include "ui/ozone/platform/dri/dri_vsync_provider.h" | 11 #include "ui/ozone/platform/dri/dri_vsync_provider.h" |
12 #include "ui/ozone/platform/dri/gbm_surface.h" | 12 #include "ui/ozone/platform/dri/gbm_surface.h" |
13 #include "ui/ozone/platform/dri/hardware_display_controller.h" | 13 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
14 #include "ui/ozone/platform/dri/scanout_surface.h" | 14 #include "ui/ozone/platform/dri/scanout_surface.h" |
15 #include "ui/ozone/platform/dri/screen_manager.h" | 15 #include "ui/ozone/platform/dri/screen_manager.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class GbmSurfaceAdapter : public gfx::SurfaceOzoneEGL { | 21 class GbmSurfaceAdapter : public ui::SurfaceOzoneEGL { |
22 public: | 22 public: |
23 GbmSurfaceAdapter(const base::WeakPtr<HardwareDisplayController>& controller); | 23 GbmSurfaceAdapter(const base::WeakPtr<HardwareDisplayController>& controller); |
24 virtual ~GbmSurfaceAdapter(); | 24 virtual ~GbmSurfaceAdapter(); |
25 | 25 |
26 // SurfaceOzoneEGL: | 26 // SurfaceOzoneEGL: |
27 virtual intptr_t GetNativeWindow() OVERRIDE; | 27 virtual intptr_t GetNativeWindow() OVERRIDE; |
28 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE; | 28 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE; |
29 virtual bool OnSwapBuffers() OVERRIDE; | 29 virtual bool OnSwapBuffers() OVERRIDE; |
30 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE; | 30 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE; |
31 | 31 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 set_gl_get_proc_address.Run(get_proc_address); | 137 set_gl_get_proc_address.Run(get_proc_address); |
138 add_gl_library.Run(egl_library); | 138 add_gl_library.Run(egl_library); |
139 add_gl_library.Run(gles_library); | 139 add_gl_library.Run(gles_library); |
140 | 140 |
141 return true; | 141 return true; |
142 } | 142 } |
143 | 143 |
144 scoped_ptr<gfx::SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( | 144 scoped_ptr<ui::SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( |
145 gfx::AcceleratedWidget w) { | 145 gfx::AcceleratedWidget w) { |
146 CHECK(state_ == INITIALIZED); | 146 CHECK(state_ == INITIALIZED); |
147 ResetCursor(w); | 147 ResetCursor(w); |
148 | 148 |
149 return scoped_ptr<gfx::SurfaceOzoneEGL>( | 149 return scoped_ptr<ui::SurfaceOzoneEGL>( |
150 new GbmSurfaceAdapter(screen_manager_->GetDisplayController(w))); | 150 new GbmSurfaceAdapter(screen_manager_->GetDisplayController(w))); |
151 } | 151 } |
152 | 152 |
153 } // namespace ui | 153 } // namespace ui |
OLD | NEW |