| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/x11/ozone_platform_x11.h" | 5 #include "ui/ozone/platform/x11/ozone_platform_x11.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 void InitializeUI(const InitParams& params) override { | 87 void InitializeUI(const InitParams& params) override { |
| 88 InitializeCommon(params); | 88 InitializeCommon(params); |
| 89 window_manager_.reset(new X11WindowManagerOzone); | 89 window_manager_.reset(new X11WindowManagerOzone); |
| 90 overlay_manager_.reset(new StubOverlayManager()); | 90 overlay_manager_.reset(new StubOverlayManager()); |
| 91 input_controller_ = CreateStubInputController(); | 91 input_controller_ = CreateStubInputController(); |
| 92 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); | 92 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); |
| 93 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 93 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void InitializeUI() override { NOTREACHED(); } | |
| 97 | |
| 98 void InitializeGPU(const InitParams& params) override { | 96 void InitializeGPU(const InitParams& params) override { |
| 99 InitializeCommon(params); | 97 InitializeCommon(params); |
| 100 surface_factory_ozone_.reset(new X11SurfaceFactory()); | 98 surface_factory_ozone_.reset(new X11SurfaceFactory()); |
| 101 } | 99 } |
| 102 | 100 |
| 103 void InitializeGPU() override { NOTREACHED(); } | |
| 104 | |
| 105 base::MessageLoop::Type GetMessageLoopTypeForGpu() override { | 101 base::MessageLoop::Type GetMessageLoopTypeForGpu() override { |
| 106 // When Ozone X11 backend is running use an UI loop to grab Expose events. | 102 // When Ozone X11 backend is running use an UI loop to grab Expose events. |
| 107 // See GLSurfaceGLX and https://crbug.com/326995. | 103 // See GLSurfaceGLX and https://crbug.com/326995. |
| 108 return base::MessageLoop::TYPE_UI; | 104 return base::MessageLoop::TYPE_UI; |
| 109 } | 105 } |
| 110 | 106 |
| 111 private: | 107 private: |
| 112 // Performs initialization steps need by both UI and GPU. | 108 // Performs initialization steps need by both UI and GPU. |
| 113 void InitializeCommon(const InitParams& params) { | 109 void InitializeCommon(const InitParams& params) { |
| 114 // TODO(kylechar): Add DCHECK we only enter InitializeCommon() twice for | 110 // TODO(kylechar): Add DCHECK we only enter InitializeCommon() twice for |
| (...skipping 30 matching lines...) Expand all Loading... |
| 145 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); | 141 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); |
| 146 }; | 142 }; |
| 147 | 143 |
| 148 } // namespace | 144 } // namespace |
| 149 | 145 |
| 150 OzonePlatform* CreateOzonePlatformX11() { | 146 OzonePlatform* CreateOzonePlatformX11() { |
| 151 return new OzonePlatformX11; | 147 return new OzonePlatformX11; |
| 152 } | 148 } |
| 153 | 149 |
| 154 } // namespace ui | 150 } // namespace ui |
| OLD | NEW |