Chromium Code Reviews| 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 "ui/ozone/platform/cast/ozone_platform_cast.h" | 5 #include "ui/ozone/platform/cast/ozone_platform_cast.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "chromecast/public/cast_egl_platform.h" | 9 #include "chromecast/public/cast_egl_platform.h" |
| 10 #include "chromecast/public/cast_egl_platform_shlib.h" | 10 #include "chromecast/public/cast_egl_platform_shlib.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 } | 73 } |
| 74 base::ScopedFD OpenClientNativePixmapDevice() const override { | 74 base::ScopedFD OpenClientNativePixmapDevice() const override { |
| 75 return base::ScopedFD(); | 75 return base::ScopedFD(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void InitializeUI() override { | 78 void InitializeUI() override { |
| 79 overlay_manager_.reset(new OverlayManagerCast()); | 79 overlay_manager_.reset(new OverlayManagerCast()); |
| 80 cursor_factory_.reset(new CursorFactoryOzone()); | 80 cursor_factory_.reset(new CursorFactoryOzone()); |
| 81 input_controller_ = CreateStubInputController(); | 81 input_controller_ = CreateStubInputController(); |
| 82 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 82 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
| 83 | |
| 84 // Enable dummy software rendering support if GPU process disabled | |
| 85 if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-gpu")) | |
| 86 surface_factory_.reset(new SurfaceFactoryCast()); | |
| 83 } | 87 } |
| 84 void InitializeGPU() override { | 88 void InitializeGPU() override { |
|
slan
2015/12/09 21:22:06
I assume that InitializeGPU won't be called when -
halliwell
2015/12/09 21:39:02
Not necessary. InitializeUI and InitializeGPU are
| |
| 85 surface_factory_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); | 89 surface_factory_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); |
| 86 g_gpu_platform_support.Get() = | 90 g_gpu_platform_support.Get() = |
| 87 make_scoped_ptr(new GpuPlatformSupportCast(surface_factory_.get())); | 91 make_scoped_ptr(new GpuPlatformSupportCast(surface_factory_.get())); |
| 88 } | 92 } |
| 89 | 93 |
| 90 private: | 94 private: |
| 91 scoped_ptr<CastEglPlatform> egl_platform_; | 95 scoped_ptr<CastEglPlatform> egl_platform_; |
| 92 scoped_ptr<SurfaceFactoryCast> surface_factory_; | 96 scoped_ptr<SurfaceFactoryCast> surface_factory_; |
| 93 scoped_ptr<CursorFactoryOzone> cursor_factory_; | 97 scoped_ptr<CursorFactoryOzone> cursor_factory_; |
| 94 scoped_ptr<InputController> input_controller_; | 98 scoped_ptr<InputController> input_controller_; |
| 95 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 99 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
| 96 scoped_ptr<OverlayManagerOzone> overlay_manager_; | 100 scoped_ptr<OverlayManagerOzone> overlay_manager_; |
| 97 | 101 |
| 98 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCast); | 102 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCast); |
| 99 }; | 103 }; |
| 100 | 104 |
| 101 } // namespace | 105 } // namespace |
| 102 | 106 |
| 103 OzonePlatform* CreateOzonePlatformCast() { | 107 OzonePlatform* CreateOzonePlatformCast() { |
| 104 const std::vector<std::string>& argv = | 108 const std::vector<std::string>& argv = |
| 105 base::CommandLine::ForCurrentProcess()->argv(); | 109 base::CommandLine::ForCurrentProcess()->argv(); |
| 106 scoped_ptr<chromecast::CastEglPlatform> platform( | 110 scoped_ptr<chromecast::CastEglPlatform> platform( |
| 107 chromecast::CastEglPlatformShlib::Create(argv)); | 111 chromecast::CastEglPlatformShlib::Create(argv)); |
| 108 return new OzonePlatformCast(platform.Pass()); | 112 return new OzonePlatformCast(platform.Pass()); |
| 109 } | 113 } |
| 110 | 114 |
| 111 } // namespace ui | 115 } // namespace ui |
| OLD | NEW |