window_service: converts all code to be in ws namespace
This is the last step after moving all the code. Sorry for the ginormous review. It would have been tedious to split up. BUG=876924 TEST=covered by tests TBR=tsepez@chromium.org Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I237c4377115ad12fefb95a1bcf2eabe1cbef3414 Reviewed-on: https://chromium-review.googlesource.com/1195809 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#587338}
This commit is contained in:
ash
accelerators
app_list
ash_service.ccash_service.hcomponents
shortcut_viewer
content
cursor_unittest.ccdisplay
frame
host
ime
keyboard
laser
lock_screen_action
shell.ccshell.hshell
shell_delegate.hshell_delegate_mash.ccshell_delegate_mash.hshell_init_params.hsystem
ime
overview
power
test
test_shell_delegate.cctest_shell_delegate.htouch
wm
non_client_frame_controller.ccnon_client_frame_controller_unittest.cc
tablet_mode
top_level_window_factory.ccwindow_finder.ccwindow_util.ccws
chrome/browser
browser_process_platform_part_chromeos.ccbrowser_process_platform_part_chromeos.hchrome_service.cc
chromeos
extensions
lock_screen_apps
system
system_logs
metrics
ui
ash
webui
content
browser
compositor
gpu_browser_compositor_output_surface.ccgpu_browser_compositor_output_surface.hgpu_output_surface_mac.ccgpu_output_surface_mac.hgpu_process_transport_factory.ccgpu_process_transport_factory.hgpu_surfaceless_browser_compositor_output_surface.ccgpu_surfaceless_browser_compositor_output_surface.hoffscreen_browser_compositor_output_surface.ccoffscreen_browser_compositor_output_surface.hviz_process_transport_factory.ccviz_process_transport_factory.h
gpu
renderer_host
renderer
media
media_recorder
mus
mus_embedded_frame.ccmus_embedded_frame.hrenderer_window_tree_client.ccrenderer_window_tree_client.h
pepper
render_thread_impl.ccrender_thread_impl.hrenderer_blink_platform_impl.ccwebgraphicscontext3d_provider_impl.ccwebgraphicscontext3d_provider_impl.htest
docs/design
media/video
services/ws
client_change.ccclient_change.hclient_change_tracker.ccclient_change_tracker.hclient_root.ccclient_root.h
common
drag_drop_delegate.ccdrag_drop_delegate.hdrag_drop_delegate_unittest.ccembedding.ccembedding.hembedding_unittest.ccevent_injector.ccevent_injector.hevent_test_utils.ccevent_test_utils.hfocus_handler.ccfocus_handler.hfocus_handler_unittest.ccgpu_host
arc_client.ccarc_client.hgpu_client.ccgpu_client.hgpu_host.ccgpu_host.hgpu_host_delegate.hgpu_host_unittest.cctest_gpu_host.cctest_gpu_host.h
gpu_interface_provider.hhost_context_factory.cchost_context_factory.hids.hime
injected_event_handler.ccinjected_event_handler.hinjected_event_handler_unittest.ccinput_devices
pointer_watcher.ccpointer_watcher.hpublic
cpp
gpu
client_gpu_memory_buffer_manager.ccclient_gpu_memory_buffer_manager.hcommand_buffer_metrics.cccommand_buffer_metrics.hcontext_provider_command_buffer.cccontext_provider_command_buffer.hgpu.ccgpu.h
input_devices
input_device_client.ccinput_device_client.hinput_device_client_test_api.ccinput_device_client_test_api.hinput_device_controller.ccinput_device_controller.hinput_device_controller_client.ccinput_device_controller_client.h
raster_thread_helper.ccraster_thread_helper.htests
mojom
remote_view_host
remoting_event_injector.ccremoting_event_injector.hscreen_provider.ccscreen_provider.hscreen_provider_unittest.ccserver_window.ccserver_window.hserver_window_test_helper.ccserver_window_test_helper.hserver_window_unittest.cctest_change_tracker.cctest_change_tracker.htest_screen_provider_observer.cctest_screen_provider_observer.htest_window_service_delegate.cctest_window_service_delegate.htest_window_tree_client.cctest_window_tree_client.htest_ws
test_drag_drop_client.cctest_drag_drop_client.htest_gpu_interface_provider.cctest_gpu_interface_provider.htest_ws.cc
topmost_window_observer.cctopmost_window_observer.huser_activity_monitor.ccuser_activity_monitor.huser_activity_monitor_unittest.ccwindow_delegate_impl.ccwindow_delegate_impl.hwindow_delegate_impl_unittest.ccwindow_properties.ccwindow_properties.hwindow_server_service_test_base.ccwindow_server_service_test_base.hwindow_server_test_impl.ccwindow_server_test_impl.hwindow_service.ccwindow_service.hwindow_service_delegate.ccwindow_service_delegate.hwindow_service_observer.hwindow_service_observer_unittest.ccwindow_service_test_setup.ccwindow_service_test_setup.hwindow_service_unittest.ccwindow_tree.ccwindow_tree.hwindow_tree_binding.ccwindow_tree_binding.hwindow_tree_client_unittest.ccwindow_tree_factory.ccwindow_tree_factory.hwindow_tree_test_helper.ccwindow_tree_test_helper.hwindow_tree_unittest.ccthird_party/blink
public
platform
renderer
ui
@@ -55,7 +55,7 @@ void HandlePrintViewHierarchy() {
|
|||||||
views::PrintViewHierarchy(widget->GetRootView());
|
views::PrintViewHierarchy(widget->GetRootView());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintWindowHierarchy(ui::ws2::WindowService* window_service,
|
void PrintWindowHierarchy(ws::WindowService* window_service,
|
||||||
const aura::Window* active_window,
|
const aura::Window* active_window,
|
||||||
const aura::Window* focused_window,
|
const aura::Window* focused_window,
|
||||||
aura::Window* window,
|
aura::Window* window,
|
||||||
@@ -77,7 +77,7 @@ void PrintWindowHierarchy(ui::ws2::WindowService* window_service,
|
|||||||
*out << " [snapped]";
|
*out << " [snapped]";
|
||||||
if (!subpixel_position_offset.IsZero())
|
if (!subpixel_position_offset.IsZero())
|
||||||
*out << " subpixel offset=" + subpixel_position_offset.ToString();
|
*out << " subpixel offset=" + subpixel_position_offset.ToString();
|
||||||
if (window_service && ui::ws2::WindowService::HasRemoteClient(window))
|
if (window_service && ws::WindowService::HasRemoteClient(window))
|
||||||
*out << " remote_id=" << window_service->GetIdForDebugging(window);
|
*out << " remote_id=" << window_service->GetIdForDebugging(window);
|
||||||
*out << '\n';
|
*out << '\n';
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ void HandlePrintWindowHierarchy() {
|
|||||||
aura::Window* active_window = wm::GetActiveWindow();
|
aura::Window* active_window = wm::GetActiveWindow();
|
||||||
aura::Window* focused_window = wm::GetFocusedWindow();
|
aura::Window* focused_window = wm::GetFocusedWindow();
|
||||||
aura::Window::Windows roots = Shell::Get()->GetAllRootWindows();
|
aura::Window::Windows roots = Shell::Get()->GetAllRootWindows();
|
||||||
ui::ws2::WindowService* window_service =
|
ws::WindowService* window_service =
|
||||||
Shell::Get()->window_service_owner()->window_service();
|
Shell::Get()->window_service_owner()->window_service();
|
||||||
for (size_t i = 0; i < roots.size(); ++i) {
|
for (size_t i = 0; i < roots.size(); ++i) {
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
|
@@ -45,8 +45,7 @@ int64_t GetDisplayIdToShowAppListOn() {
|
|||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
AppListControllerImpl::AppListControllerImpl(
|
AppListControllerImpl::AppListControllerImpl(ws::WindowService* window_service)
|
||||||
ui::ws2::WindowService* window_service)
|
|
||||||
: window_service_(window_service),
|
: window_service_(window_service),
|
||||||
presenter_(std::make_unique<AppListPresenterDelegateImpl>(this)),
|
presenter_(std::make_unique<AppListPresenterDelegateImpl>(this)),
|
||||||
is_home_launcher_enabled_(app_list::features::IsHomeLauncherEnabled()),
|
is_home_launcher_enabled_(app_list::features::IsHomeLauncherEnabled()),
|
||||||
@@ -705,7 +704,7 @@ void AppListControllerImpl::ShowWallpaperContextMenu(
|
|||||||
Shell::Get()->ShowContextMenu(onscreen_location, source_type);
|
Shell::Get()->ShowContextMenu(onscreen_location, source_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::WindowService* AppListControllerImpl::GetWindowService() {
|
ws::WindowService* AppListControllerImpl::GetWindowService() {
|
||||||
return window_service_;
|
return window_service_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,18 +28,18 @@
|
|||||||
#include "mojo/public/cpp/bindings/interface_ptr_set.h"
|
#include "mojo/public/cpp/bindings/interface_ptr_set.h"
|
||||||
#include "ui/keyboard/keyboard_controller_observer.h"
|
#include "ui/keyboard/keyboard_controller_observer.h"
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class MouseWheelEvent;
|
|
||||||
|
|
||||||
namespace ws2 {
|
|
||||||
class WindowService;
|
|
||||||
} // namespace ws2
|
|
||||||
} // namespace ui
|
|
||||||
|
|
||||||
namespace app_list {
|
namespace app_list {
|
||||||
class AnswerCardContentsRegistry;
|
class AnswerCardContentsRegistry;
|
||||||
} // namespace app_list
|
} // namespace app_list
|
||||||
|
|
||||||
|
namespace ui {
|
||||||
|
class MouseWheelEvent;
|
||||||
|
} // namespace ui
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class WindowService;
|
||||||
|
} // namespace ws
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
class HomeLauncherGestureHandler;
|
class HomeLauncherGestureHandler;
|
||||||
@@ -60,7 +60,7 @@ class ASH_EXPORT AppListControllerImpl
|
|||||||
public:
|
public:
|
||||||
using AppListItemMetadataPtr = mojom::AppListItemMetadataPtr;
|
using AppListItemMetadataPtr = mojom::AppListItemMetadataPtr;
|
||||||
using SearchResultMetadataPtr = mojom::SearchResultMetadataPtr;
|
using SearchResultMetadataPtr = mojom::SearchResultMetadataPtr;
|
||||||
explicit AppListControllerImpl(ui::ws2::WindowService* window_service);
|
explicit AppListControllerImpl(ws::WindowService* window_service);
|
||||||
~AppListControllerImpl() override;
|
~AppListControllerImpl() override;
|
||||||
|
|
||||||
// Binds the mojom::AppListController interface request to this object.
|
// Binds the mojom::AppListController interface request to this object.
|
||||||
@@ -174,7 +174,7 @@ class ASH_EXPORT AppListControllerImpl
|
|||||||
int event_flags) override;
|
int event_flags) override;
|
||||||
void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
||||||
ui::MenuSourceType source_type) override;
|
ui::MenuSourceType source_type) override;
|
||||||
ui::ws2::WindowService* GetWindowService() override;
|
ws::WindowService* GetWindowService() override;
|
||||||
|
|
||||||
void OnVisibilityChanged(bool visible);
|
void OnVisibilityChanged(bool visible);
|
||||||
void OnTargetVisibilityChanged(bool visible);
|
void OnTargetVisibilityChanged(bool visible);
|
||||||
@@ -231,7 +231,7 @@ class ASH_EXPORT AppListControllerImpl
|
|||||||
// Update the visibility of Assistant functionality.
|
// Update the visibility of Assistant functionality.
|
||||||
void UpdateAssistantVisibility();
|
void UpdateAssistantVisibility();
|
||||||
|
|
||||||
ui::ws2::WindowService* window_service_;
|
ws::WindowService* window_service_;
|
||||||
|
|
||||||
base::string16 last_raw_query_;
|
base::string16 last_raw_query_;
|
||||||
|
|
||||||
|
@@ -16,11 +16,9 @@
|
|||||||
#include "ui/base/ui_base_types.h"
|
#include "ui/base/ui_base_types.h"
|
||||||
#include "ui/gfx/geometry/point.h"
|
#include "ui/gfx/geometry/point.h"
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
namespace ws2 {
|
|
||||||
class WindowService;
|
class WindowService;
|
||||||
}
|
} // namespace ws
|
||||||
} // namespace ui
|
|
||||||
|
|
||||||
namespace app_list {
|
namespace app_list {
|
||||||
|
|
||||||
@@ -111,7 +109,7 @@ class ASH_PUBLIC_EXPORT AppListViewDelegate {
|
|||||||
virtual void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
virtual void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
||||||
ui::MenuSourceType source_type) = 0;
|
ui::MenuSourceType source_type) = 0;
|
||||||
|
|
||||||
virtual ui::ws2::WindowService* GetWindowService() = 0;
|
virtual ws::WindowService* GetWindowService() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace app_list
|
} // namespace app_list
|
||||||
|
@@ -88,7 +88,7 @@ void AppListTestViewDelegate::ShowWallpaperContextMenu(
|
|||||||
++show_wallpaper_context_menu_count_;
|
++show_wallpaper_context_menu_count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::WindowService* AppListTestViewDelegate::GetWindowService() {
|
ws::WindowService* AppListTestViewDelegate::GetWindowService() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,7 +76,7 @@ class AppListTestViewDelegate : public AppListViewDelegate,
|
|||||||
int event_flags) override {}
|
int event_flags) override {}
|
||||||
void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
|
||||||
ui::MenuSourceType source_type) override;
|
ui::MenuSourceType source_type) override;
|
||||||
ui::ws2::WindowService* GetWindowService() override;
|
ws::WindowService* GetWindowService() override;
|
||||||
|
|
||||||
// Do a bulk replacement of the items in the model.
|
// Do a bulk replacement of the items in the model.
|
||||||
void ReplaceTestModel(int item_count);
|
void ReplaceTestModel(int item_count);
|
||||||
|
@@ -42,7 +42,7 @@ struct CardData {
|
|||||||
|
|
||||||
// Get answer card data by token.
|
// Get answer card data by token.
|
||||||
CardData GetCardDataByToken(
|
CardData GetCardDataByToken(
|
||||||
ui::ws2::WindowService* window_service,
|
ws::WindowService* window_service,
|
||||||
const base::Optional<base::UnguessableToken>& token) {
|
const base::Optional<base::UnguessableToken>& token) {
|
||||||
// Bail for invalid token.
|
// Bail for invalid token.
|
||||||
if (!token.has_value() || token->is_empty())
|
if (!token.has_value() || token->is_empty())
|
||||||
@@ -60,8 +60,8 @@ CardData GetCardDataByToken(
|
|||||||
// Use ServerRemoteViewHost to embed the answer card contents provided in the
|
// Use ServerRemoteViewHost to embed the answer card contents provided in the
|
||||||
// browser process in Mash.
|
// browser process in Mash.
|
||||||
if (features::IsUsingWindowService()) {
|
if (features::IsUsingWindowService()) {
|
||||||
ui::ws2::ServerRemoteViewHost* view =
|
ws::ServerRemoteViewHost* view =
|
||||||
new ui::ws2::ServerRemoteViewHost(window_service);
|
new ws::ServerRemoteViewHost(window_service);
|
||||||
view->EmbedUsingToken(token.value(),
|
view->EmbedUsingToken(token.value(),
|
||||||
ws::mojom::kEmbedFlagEmbedderControlsVisibility,
|
ws::mojom::kEmbedFlagEmbedderControlsVisibility,
|
||||||
base::DoNothing());
|
base::DoNothing());
|
||||||
|
@@ -118,7 +118,7 @@ void AshService::InitForMash() {
|
|||||||
discardable_shared_memory_manager_ =
|
discardable_shared_memory_manager_ =
|
||||||
std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
|
std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
|
||||||
|
|
||||||
gpu_host_ = std::make_unique<ui::gpu_host::DefaultGpuHost>(
|
gpu_host_ = std::make_unique<ws::gpu_host::DefaultGpuHost>(
|
||||||
this, context()->connector(), discardable_shared_memory_manager_.get());
|
this, context()->connector(), discardable_shared_memory_manager_.get());
|
||||||
|
|
||||||
host_frame_sink_manager_ = std::make_unique<viz::HostFrameSinkManager>();
|
host_frame_sink_manager_ = std::make_unique<viz::HostFrameSinkManager>();
|
||||||
@@ -128,10 +128,10 @@ void AshService::InitForMash() {
|
|||||||
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
||||||
thread_options.priority = base::ThreadPriority::NORMAL;
|
thread_options.priority = base::ThreadPriority::NORMAL;
|
||||||
CHECK(io_thread_->StartWithOptions(thread_options));
|
CHECK(io_thread_->StartWithOptions(thread_options));
|
||||||
gpu_ = ui::Gpu::Create(context()->connector(), ws::mojom::kServiceName,
|
gpu_ = ws::Gpu::Create(context()->connector(), ws::mojom::kServiceName,
|
||||||
io_thread_->task_runner());
|
io_thread_->task_runner());
|
||||||
|
|
||||||
context_factory_ = std::make_unique<ui::ws2::HostContextFactory>(
|
context_factory_ = std::make_unique<ws::HostContextFactory>(
|
||||||
gpu_.get(), host_frame_sink_manager_.get());
|
gpu_.get(), host_frame_sink_manager_.get());
|
||||||
|
|
||||||
env_ = aura::Env::CreateInstanceToHostViz(context()->connector());
|
env_ = aura::Env::CreateInstanceToHostViz(context()->connector());
|
||||||
@@ -207,9 +207,9 @@ void AshService::CreateService(
|
|||||||
DCHECK_EQ(name, ws::mojom::kServiceName);
|
DCHECK_EQ(name, ws::mojom::kServiceName);
|
||||||
Shell::Get()->window_service_owner()->BindWindowService(std::move(service));
|
Shell::Get()->window_service_owner()->BindWindowService(std::move(service));
|
||||||
if (base::FeatureList::IsEnabled(features::kMash)) {
|
if (base::FeatureList::IsEnabled(features::kMash)) {
|
||||||
ui::ws2::WindowService* window_service =
|
ws::WindowService* window_service =
|
||||||
Shell::Get()->window_service_owner()->window_service();
|
Shell::Get()->window_service_owner()->window_service();
|
||||||
input_device_controller_ = std::make_unique<ui::InputDeviceController>();
|
input_device_controller_ = std::make_unique<ws::InputDeviceController>();
|
||||||
input_device_controller_->AddInterface(window_service->registry());
|
input_device_controller_->AddInterface(window_service->registry());
|
||||||
}
|
}
|
||||||
pid_receiver->SetPID(base::GetCurrentProcId());
|
pid_receiver->SetPID(base::GetCurrentProcId());
|
||||||
|
@@ -36,17 +36,6 @@ namespace service_manager {
|
|||||||
struct EmbeddedServiceInfo;
|
struct EmbeddedServiceInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class Gpu;
|
|
||||||
class InputDeviceController;
|
|
||||||
namespace gpu_host {
|
|
||||||
class DefaultGpuHost;
|
|
||||||
}
|
|
||||||
namespace ws2 {
|
|
||||||
class HostContextFactory;
|
|
||||||
}
|
|
||||||
} // namespace ui
|
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
class ViewsDelegate;
|
class ViewsDelegate;
|
||||||
}
|
}
|
||||||
@@ -58,6 +47,16 @@ class HostFrameSinkManager;
|
|||||||
namespace wm {
|
namespace wm {
|
||||||
class WMState;
|
class WMState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class Gpu;
|
||||||
|
class HostContextFactory;
|
||||||
|
class InputDeviceController;
|
||||||
|
namespace gpu_host {
|
||||||
|
class DefaultGpuHost;
|
||||||
|
} // namespace gpu_host
|
||||||
|
} // namespace ws
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
class NetworkConnectDelegateMus;
|
class NetworkConnectDelegateMus;
|
||||||
@@ -67,7 +66,7 @@ class NetworkConnectDelegateMus;
|
|||||||
// UI-Service/WindowService when ash runs out of process.
|
// UI-Service/WindowService when ash runs out of process.
|
||||||
class ASH_EXPORT AshService : public service_manager::Service,
|
class ASH_EXPORT AshService : public service_manager::Service,
|
||||||
public service_manager::mojom::ServiceFactory,
|
public service_manager::mojom::ServiceFactory,
|
||||||
public ui::gpu_host::GpuHostDelegate {
|
public ws::gpu_host::GpuHostDelegate {
|
||||||
public:
|
public:
|
||||||
AshService();
|
AshService();
|
||||||
~AshService() override;
|
~AshService() override;
|
||||||
@@ -109,14 +108,14 @@ class ASH_EXPORT AshService : public service_manager::Service,
|
|||||||
std::unique_ptr<discardable_memory::DiscardableSharedMemoryManager>
|
std::unique_ptr<discardable_memory::DiscardableSharedMemoryManager>
|
||||||
discardable_shared_memory_manager_;
|
discardable_shared_memory_manager_;
|
||||||
|
|
||||||
std::unique_ptr<ui::gpu_host::DefaultGpuHost> gpu_host_;
|
std::unique_ptr<ws::gpu_host::DefaultGpuHost> gpu_host_;
|
||||||
|
|
||||||
std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_;
|
std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_;
|
||||||
|
|
||||||
// IO thread for GPU and discardable shared memory IPC.
|
// IO thread for GPU and discardable shared memory IPC.
|
||||||
std::unique_ptr<base::Thread> io_thread_;
|
std::unique_ptr<base::Thread> io_thread_;
|
||||||
std::unique_ptr<ui::Gpu> gpu_;
|
std::unique_ptr<ws::Gpu> gpu_;
|
||||||
std::unique_ptr<ui::ws2::HostContextFactory> context_factory_;
|
std::unique_ptr<ws::HostContextFactory> context_factory_;
|
||||||
|
|
||||||
std::unique_ptr<aura::Env> env_;
|
std::unique_ptr<aura::Env> env_;
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ class ASH_EXPORT AshService : public service_manager::Service,
|
|||||||
std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider>
|
std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider>
|
||||||
statistics_provider_;
|
statistics_provider_;
|
||||||
|
|
||||||
std::unique_ptr<ui::InputDeviceController> input_device_controller_;
|
std::unique_ptr<ws::InputDeviceController> input_device_controller_;
|
||||||
|
|
||||||
// Whether this class initialized NetworkHandler and needs to clean it up.
|
// Whether this class initialized NetworkHandler and needs to clean it up.
|
||||||
bool network_handler_initialized_ = false;
|
bool network_handler_initialized_ = false;
|
||||||
|
@@ -35,7 +35,7 @@ class KeyboardShortcutViewTest : public ash::AshTestBase {
|
|||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
ash::AshTestBase::SetUp();
|
ash::AshTestBase::SetUp();
|
||||||
// Simulate the complete listing of input devices, required by the viewer.
|
// Simulate the complete listing of input devices, required by the viewer.
|
||||||
ui::InputDeviceClientTestApi().OnDeviceListsComplete();
|
ws::InputDeviceClientTestApi().OnDeviceListsComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -15,12 +15,12 @@ namespace ash {
|
|||||||
// An implementation of GpuInterfaceProvider that forwards to the Gpu
|
// An implementation of GpuInterfaceProvider that forwards to the Gpu
|
||||||
// implementation in content.
|
// implementation in content.
|
||||||
class ASH_WITH_CONTENT_EXPORT ContentGpuInterfaceProvider
|
class ASH_WITH_CONTENT_EXPORT ContentGpuInterfaceProvider
|
||||||
: public ui::ws2::GpuInterfaceProvider {
|
: public ws::GpuInterfaceProvider {
|
||||||
public:
|
public:
|
||||||
ContentGpuInterfaceProvider();
|
ContentGpuInterfaceProvider();
|
||||||
~ContentGpuInterfaceProvider() override;
|
~ContentGpuInterfaceProvider() override;
|
||||||
|
|
||||||
// ui::ws2::GpuInterfaceProvider:
|
// ws::GpuInterfaceProvider:
|
||||||
void RegisterGpuInterfaces(
|
void RegisterGpuInterfaces(
|
||||||
service_manager::BinderRegistry* registry) override;
|
service_manager::BinderRegistry* registry) override;
|
||||||
void RegisterOzoneGpuInterfaces(
|
void RegisterOzoneGpuInterfaces(
|
||||||
|
@@ -55,7 +55,7 @@ TEST_F(CursorTest, TopLevel) {
|
|||||||
TEST_F(CursorTest, Embedded) {
|
TEST_F(CursorTest, Embedded) {
|
||||||
// Create a window to hold an embedding and set its cursor.
|
// Create a window to hold an embedding and set its cursor.
|
||||||
aura::Window* embed_root = GetWindowTreeTestHelper()->NewWindow();
|
aura::Window* embed_root = GetWindowTreeTestHelper()->NewWindow();
|
||||||
ui::ws2::TestWindowTreeClient test_client;
|
ws::TestWindowTreeClient test_client;
|
||||||
GetWindowTreeTestHelper()->Embed(embed_root, nullptr, &test_client, 0);
|
GetWindowTreeTestHelper()->Embed(embed_root, nullptr, &test_client, 0);
|
||||||
const ui::CursorData help_cursor(ui::CursorType::kHelp);
|
const ui::CursorData help_cursor(ui::CursorType::kHelp);
|
||||||
GetWindowTreeTestHelper()->SetCursor(embed_root, help_cursor);
|
GetWindowTreeTestHelper()->SetCursor(embed_root, help_cursor);
|
||||||
|
@@ -39,7 +39,7 @@ void InitExternalTouchDevices(int64_t display_id) {
|
|||||||
ui::TouchscreenDevice touchdevice(
|
ui::TouchscreenDevice touchdevice(
|
||||||
123, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
123, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
std::string("test external touch device"), gfx::Size(1000, 1000), 1);
|
std::string("test external touch device"), gfx::Size(1000, 1000), 1);
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchdevice});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchdevice});
|
||||||
|
|
||||||
std::vector<ui::TouchDeviceTransform> transforms;
|
std::vector<ui::TouchDeviceTransform> transforms;
|
||||||
ui::TouchDeviceTransform touch_device_transform;
|
ui::TouchDeviceTransform touch_device_transform;
|
||||||
@@ -633,7 +633,7 @@ TEST_F(CrosDisplayConfigTest, CustomTouchCalibrationNonTouchDisplay) {
|
|||||||
? display_id_list[1]
|
? display_id_list[1]
|
||||||
: display_id_list[0];
|
: display_id_list[0];
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
||||||
std::string id = base::Int64ToString(display_id);
|
std::string id = base::Int64ToString(display_id);
|
||||||
|
|
||||||
// Since no external touch devices are present, the calibration should fail.
|
// Since no external touch devices are present, the calibration should fail.
|
||||||
|
@@ -52,7 +52,7 @@ class TouchCalibratorControllerTest : public AshTestBase {
|
|||||||
// Reset all touch device and touch association.
|
// Reset all touch device and touch association.
|
||||||
test::TouchDeviceManagerTestApi(touch_device_manager())
|
test::TouchDeviceManagerTestApi(touch_device_manager())
|
||||||
.ResetTouchDeviceManager();
|
.ResetTouchDeviceManager();
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
||||||
test::TouchTransformControllerTestApi(
|
test::TouchTransformControllerTestApi(
|
||||||
Shell::Get()->touch_transformer_controller())
|
Shell::Get()->touch_transformer_controller())
|
||||||
.touch_transform_setter()
|
.touch_transform_setter()
|
||||||
@@ -169,7 +169,7 @@ class TouchCalibratorControllerTest : public AshTestBase {
|
|||||||
ui::TouchscreenDevice InitTouchDevice(
|
ui::TouchscreenDevice InitTouchDevice(
|
||||||
int64_t display_id,
|
int64_t display_id,
|
||||||
const ui::TouchscreenDevice& touchdevice) {
|
const ui::TouchscreenDevice& touchdevice) {
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchdevice});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchdevice});
|
||||||
|
|
||||||
std::vector<ui::TouchDeviceTransform> transforms;
|
std::vector<ui::TouchDeviceTransform> transforms;
|
||||||
ui::TouchDeviceTransform touch_device_transform;
|
ui::TouchDeviceTransform touch_device_transform;
|
||||||
@@ -403,7 +403,7 @@ TEST_F(TouchCalibratorControllerTest, HighDPIMonitorsCalibration) {
|
|||||||
kExternalTouchId, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
kExternalTouchId, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
std::string("external touch device"), gfx::Size(1000, 1000), 1);
|
std::string("external touch device"), gfx::Size(1000, 1000), 1);
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(
|
||||||
{internal_touchdevice, external_touchdevice});
|
{internal_touchdevice, external_touchdevice});
|
||||||
|
|
||||||
// Associate both touch devices to the internal display.
|
// Associate both touch devices to the internal display.
|
||||||
@@ -495,7 +495,7 @@ TEST_F(TouchCalibratorControllerTest, RotatedHighDPIMonitorsCalibration) {
|
|||||||
kExternalTouchId, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
kExternalTouchId, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
std::string("external touch device"), gfx::Size(1000, 1000), 1);
|
std::string("external touch device"), gfx::Size(1000, 1000), 1);
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(
|
||||||
{internal_touchdevice, external_touchdevice});
|
{internal_touchdevice, external_touchdevice});
|
||||||
|
|
||||||
// Associate both touch devices to the internal display.
|
// Associate both touch devices to the internal display.
|
||||||
|
@@ -667,7 +667,7 @@ void WindowTreeHostManager::OnDisplayMetricsChanged(
|
|||||||
// Shell creates |window_service_owner_| from Shell::Init(), but this
|
// Shell creates |window_service_owner_| from Shell::Init(), but this
|
||||||
// function may be called before |window_service_owner_| is created. It's safe
|
// function may be called before |window_service_owner_| is created. It's safe
|
||||||
// to ignore the call in this case as no clients have connected yet.
|
// to ignore the call in this case as no clients have connected yet.
|
||||||
ui::ws2::WindowService* window_service =
|
ws::WindowService* window_service =
|
||||||
Shell::Get()->window_service_owner()
|
Shell::Get()->window_service_owner()
|
||||||
? Shell::Get()->window_service_owner()->window_service()
|
? Shell::Get()->window_service_owner()->window_service()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
@@ -136,7 +136,7 @@ void DetachedTitleAreaRendererForClient::Detach() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DetachedTitleAreaRendererForClient::CanActivate() const {
|
bool DetachedTitleAreaRendererForClient::CanActivate() const {
|
||||||
return widget_->GetNativeView()->GetProperty(ui::ws2::kCanFocus);
|
return widget_->GetNativeView()->GetProperty(ws::kCanFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
views::Widget* DetachedTitleAreaRendererForClient::GetWidget() {
|
views::Widget* DetachedTitleAreaRendererForClient::GetWidget() {
|
||||||
|
@@ -182,7 +182,7 @@ void AshWindowTreeHostPlatform::InitInputMethodIfNecessary() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) {
|
void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) {
|
||||||
ui::InputDeviceControllerClient* input_device_controller_client =
|
ws::InputDeviceControllerClient* input_device_controller_client =
|
||||||
Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
||||||
if (!input_device_controller_client)
|
if (!input_device_controller_client)
|
||||||
return; // Happens in tests.
|
return; // Happens in tests.
|
||||||
|
@@ -26,9 +26,9 @@ ImeFocusHandler::~ImeFocusHandler() {
|
|||||||
void ImeFocusHandler::OnWindowFocused(aura::Window* gained_focus,
|
void ImeFocusHandler::OnWindowFocused(aura::Window* gained_focus,
|
||||||
aura::Window* lost_focus) {
|
aura::Window* lost_focus) {
|
||||||
const bool client_window_gaining_focus =
|
const bool client_window_gaining_focus =
|
||||||
ui::ws2::WindowService::HasRemoteClient(gained_focus);
|
ws::WindowService::HasRemoteClient(gained_focus);
|
||||||
const bool client_window_losing_focus =
|
const bool client_window_losing_focus =
|
||||||
ui::ws2::WindowService::HasRemoteClient(lost_focus);
|
ws::WindowService::HasRemoteClient(lost_focus);
|
||||||
|
|
||||||
// Focus moves to a ClientWindow from an ash window.
|
// Focus moves to a ClientWindow from an ash window.
|
||||||
if (client_window_gaining_focus && !client_window_losing_focus)
|
if (client_window_gaining_focus && !client_window_losing_focus)
|
||||||
|
@@ -52,8 +52,8 @@ class VirtualKeyboardControllerTest : public AshTestBase {
|
|||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
AshTestBase::SetUp();
|
AshTestBase::SetUp();
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices({});
|
ws::InputDeviceClientTestApi().SetKeyboardDevices({});
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
||||||
}
|
}
|
||||||
|
|
||||||
display::Display GetPrimaryDisplay() {
|
display::Display GetPrimaryDisplay() {
|
||||||
@@ -92,7 +92,7 @@ class MockEventBlocker : public ScopedDisableInternalMouseAndKeyboard {
|
|||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -237,8 +237,8 @@ class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest,
|
|||||||
AshTestBase::SetUp();
|
AshTestBase::SetUp();
|
||||||
// Set the current list of devices to empty so that they don't interfere
|
// Set the current list of devices to empty so that they don't interfere
|
||||||
// with the test.
|
// with the test.
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices({});
|
ws::InputDeviceClientTestApi().SetKeyboardDevices({});
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
||||||
Shell::Get()->system_tray_notifier()->AddVirtualKeyboardObserver(this);
|
Shell::Get()->system_tray_notifier()->AddVirtualKeyboardObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,17 +278,17 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
|
|||||||
screens.push_back(
|
screens.push_back(
|
||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0));
|
"Touchscreen", gfx::Size(1024, 768), 0));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
// Remove the internal keyboard. Virtual keyboard should now show.
|
// Remove the internal keyboard. Virtual keyboard should now show.
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices({});
|
ws::InputDeviceClientTestApi().SetKeyboardDevices({});
|
||||||
EXPECT_TRUE(keyboard::IsKeyboardEnabled());
|
EXPECT_TRUE(keyboard::IsKeyboardEnabled());
|
||||||
// Replug in the internal keyboard. Virtual keyboard should hide.
|
// Replug in the internal keyboard. Virtual keyboard should hide.
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
EXPECT_FALSE(keyboard::IsKeyboardEnabled());
|
EXPECT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,10 +298,10 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) {
|
|||||||
devices.push_back(
|
devices.push_back(
|
||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
"Touchscreen", gfx::Size(800, 600), 0));
|
"Touchscreen", gfx::Size(800, 600), 0));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(devices);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(devices);
|
||||||
EXPECT_TRUE(keyboard::IsKeyboardEnabled());
|
EXPECT_TRUE(keyboard::IsKeyboardEnabled());
|
||||||
// Remove touchscreen. Keyboard should hide.
|
// Remove touchscreen. Keyboard should hide.
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({});
|
||||||
EXPECT_FALSE(keyboard::IsKeyboardEnabled());
|
EXPECT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,11 +310,11 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
|
|||||||
screens.push_back(ui::TouchscreenDevice(
|
screens.push_back(ui::TouchscreenDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Touchscreen",
|
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Touchscreen",
|
||||||
gfx::Size(1024, 768), 0, false /* has_stylus */));
|
gfx::Size(1024, 768), 0, false /* has_stylus */));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
ASSERT_TRUE(notified());
|
ASSERT_TRUE(notified());
|
||||||
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
|
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
|
||||||
@@ -333,7 +333,7 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
|
|||||||
// Remove external keyboard. Should be notified that the keyboard is not
|
// Remove external keyboard. Should be notified that the keyboard is not
|
||||||
// suppressed.
|
// suppressed.
|
||||||
ResetObserver();
|
ResetObserver();
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices({});
|
ws::InputDeviceClientTestApi().SetKeyboardDevices({});
|
||||||
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
||||||
ASSERT_TRUE(notified());
|
ASSERT_TRUE(notified());
|
||||||
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
|
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
|
||||||
@@ -348,7 +348,7 @@ TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) {
|
|||||||
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
||||||
keyboards.push_back(ui::InputDevice(
|
keyboards.push_back(ui::InputDevice(
|
||||||
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboards);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboards);
|
||||||
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,11 +358,11 @@ TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringTabletMode) {
|
|||||||
screens.push_back(
|
screens.push_back(
|
||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0));
|
"Touchscreen", gfx::Size(1024, 768), 0));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
// Toggle tablet mode on.
|
// Toggle tablet mode on.
|
||||||
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
|
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
|
||||||
@@ -378,13 +378,13 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
|
|||||||
screens.push_back(
|
screens.push_back(
|
||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0));
|
"Touchscreen", gfx::Size(1024, 768), 0));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard"));
|
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
// Toggle tablet mode on.
|
// Toggle tablet mode on.
|
||||||
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
|
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
|
||||||
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
||||||
@@ -406,7 +406,7 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
|
|||||||
// suppressed.
|
// suppressed.
|
||||||
ResetObserver();
|
ResetObserver();
|
||||||
keyboard_devices.pop_back();
|
keyboard_devices.pop_back();
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
||||||
ASSERT_TRUE(notified());
|
ASSERT_TRUE(notified());
|
||||||
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
|
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
|
||||||
@@ -439,11 +439,11 @@ TEST_F(VirtualKeyboardControllerAlwaysEnabledTest, DoesNotSuppressKeyboard) {
|
|||||||
screens.push_back(
|
screens.push_back(
|
||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0));
|
"Touchscreen", gfx::Size(1024, 768), 0));
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(screens);
|
||||||
std::vector<ui::InputDevice> keyboard_devices;
|
std::vector<ui::InputDevice> keyboard_devices;
|
||||||
keyboard_devices.push_back(ui::InputDevice(
|
keyboard_devices.push_back(ui::InputDevice(
|
||||||
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(keyboard_devices);
|
||||||
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -159,8 +159,8 @@ TEST_F(LaserPointerControllerTest, LaserPointerPrediction) {
|
|||||||
TEST_F(LaserPointerControllerTest, LaserPointerWorksWithRemoteApp) {
|
TEST_F(LaserPointerControllerTest, LaserPointerWorksWithRemoteApp) {
|
||||||
std::unique_ptr<aura::Window> window =
|
std::unique_ptr<aura::Window> window =
|
||||||
CreateTestWindow(gfx::Rect(50, 50, 100, 100));
|
CreateTestWindow(gfx::Rect(50, 50, 100, 100));
|
||||||
ui::ws2::ServerWindow* server_window =
|
ws::ServerWindow* server_window =
|
||||||
ui::ws2::ServerWindow::GetMayBeNull(window.get());
|
ws::ServerWindow::GetMayBeNull(window.get());
|
||||||
ASSERT_TRUE(server_window);
|
ASSERT_TRUE(server_window);
|
||||||
// Setting the client area triggers slightly different logic.
|
// Setting the client area triggers slightly different logic.
|
||||||
server_window->SetClientArea(gfx::Insets(10), std::vector<gfx::Rect>());
|
server_window->SetClientArea(gfx::Insets(10), std::vector<gfx::Rect>());
|
||||||
|
@@ -203,7 +203,7 @@ class LockScreenNoteDisplayStateHandlerTest : public AshTestBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhenScreenOn) {
|
TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhenScreenOn) {
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhenScreenOn) {
|
|||||||
TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhenScreenOff) {
|
TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhenScreenOff) {
|
||||||
TurnScreenOffForUserInactivity();
|
TurnScreenOffForUserInactivity();
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest,
|
|||||||
EXPECT_FALSE(power_manager_client_->backlights_forced_off());
|
EXPECT_FALSE(power_manager_client_->backlights_forced_off());
|
||||||
EXPECT_TRUE(power_manager_observer_->brightness_changes().empty());
|
EXPECT_TRUE(power_manager_observer_->brightness_changes().empty());
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest,
|
|||||||
TEST_F(LockScreenNoteDisplayStateHandlerTest, TurnScreenOnWhenAppLaunchFails) {
|
TEST_F(LockScreenNoteDisplayStateHandlerTest, TurnScreenOnWhenAppLaunchFails) {
|
||||||
TurnScreenOffForUserInactivity();
|
TurnScreenOffForUserInactivity();
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhileScreenForcedOff) {
|
|||||||
power_manager_observer_->brightness_changes());
|
power_manager_observer_->brightness_changes());
|
||||||
power_manager_observer_->ClearBrightnessChanges();
|
power_manager_observer_->ClearBrightnessChanges();
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest, EjectWhileScreenForcedOff) {
|
|||||||
TEST_F(LockScreenNoteDisplayStateHandlerTest, DisplayNotTurnedOffIndefinitely) {
|
TEST_F(LockScreenNoteDisplayStateHandlerTest, DisplayNotTurnedOffIndefinitely) {
|
||||||
TurnScreenOffForUserInactivity();
|
TurnScreenOffForUserInactivity();
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest,
|
|||||||
EXPECT_EQ(1u,
|
EXPECT_EQ(1u,
|
||||||
power_manager_client_->pending_screen_brightness_changes().size());
|
power_manager_client_->pending_screen_brightness_changes().size());
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
@@ -439,7 +439,7 @@ TEST_F(LockScreenNoteDisplayStateHandlerTest, ScreenA11yAlerts) {
|
|||||||
EXPECT_EQ(mojom::AccessibilityAlert::SCREEN_OFF,
|
EXPECT_EQ(mojom::AccessibilityAlert::SCREEN_OFF,
|
||||||
a11y_client.last_a11y_alert());
|
a11y_client.last_a11y_alert());
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi devices_test_api;
|
ws::InputDeviceClientTestApi devices_test_api;
|
||||||
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
devices_test_api.NotifyObserversStylusStateChanged(ui::StylusState::REMOVED);
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
|
@@ -389,7 +389,7 @@ bool Shell::IsSystemModalWindowOpen() {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
bool Shell::HasRemoteClient(aura::Window* window) {
|
bool Shell::HasRemoteClient(aura::Window* window) {
|
||||||
return ui::ws2::WindowService::HasRemoteClient(window);
|
return ws::WindowService::HasRemoteClient(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -982,7 +982,7 @@ void Shell::Init(
|
|||||||
ui::ContextFactory* context_factory,
|
ui::ContextFactory* context_factory,
|
||||||
ui::ContextFactoryPrivate* context_factory_private,
|
ui::ContextFactoryPrivate* context_factory_private,
|
||||||
std::unique_ptr<base::Value> initial_display_prefs,
|
std::unique_ptr<base::Value> initial_display_prefs,
|
||||||
std::unique_ptr<ui::ws2::GpuInterfaceProvider> gpu_interface_provider) {
|
std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider) {
|
||||||
if (::features::IsSingleProcessMash()) {
|
if (::features::IsSingleProcessMash()) {
|
||||||
// In SingleProcessMash mode ScreenMus is not created, which means Ash needs
|
// In SingleProcessMash mode ScreenMus is not created, which means Ash needs
|
||||||
// to set the WindowManagerFrameValues.
|
// to set the WindowManagerFrameValues.
|
||||||
|
16
ash/shell.h
16
ash/shell.h
@@ -64,9 +64,6 @@ class ContextFactory;
|
|||||||
class ContextFactoryPrivate;
|
class ContextFactoryPrivate;
|
||||||
class UserActivityDetector;
|
class UserActivityDetector;
|
||||||
class UserActivityPowerManagerNotifier;
|
class UserActivityPowerManagerNotifier;
|
||||||
namespace ws2 {
|
|
||||||
class GpuInterfaceProvider;
|
|
||||||
}
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
@@ -89,6 +86,10 @@ class VisibilityController;
|
|||||||
class WindowModalityController;
|
class WindowModalityController;
|
||||||
} // namespace wm
|
} // namespace wm
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class GpuInterfaceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
class AcceleratorController;
|
class AcceleratorController;
|
||||||
@@ -672,11 +673,10 @@ class ASH_EXPORT Shell : public SessionObserver,
|
|||||||
service_manager::Connector* connector);
|
service_manager::Connector* connector);
|
||||||
~Shell() override;
|
~Shell() override;
|
||||||
|
|
||||||
void Init(
|
void Init(ui::ContextFactory* context_factory,
|
||||||
ui::ContextFactory* context_factory,
|
ui::ContextFactoryPrivate* context_factory_private,
|
||||||
ui::ContextFactoryPrivate* context_factory_private,
|
std::unique_ptr<base::Value> initial_display_prefs,
|
||||||
std::unique_ptr<base::Value> initial_display_prefs,
|
std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider);
|
||||||
std::unique_ptr<ui::ws2::GpuInterfaceProvider> gpu_interface_provider);
|
|
||||||
|
|
||||||
// Initializes the display manager and related components.
|
// Initializes the display manager and related components.
|
||||||
void InitializeDisplayManager();
|
void InitializeDisplayManager();
|
||||||
|
@@ -313,7 +313,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
|
|||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::WindowService* GetWindowService() override {
|
ws::WindowService* GetWindowService() override {
|
||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ std::unique_ptr<service_manager::Service> CreateTapVisualizer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<service_manager::Service> CreateTestImeDriver() {
|
std::unique_ptr<service_manager::Service> CreateTestImeDriver() {
|
||||||
return std::make_unique<ui::test::TestIMEApplication>();
|
return std::make_unique<ws::test::TestIMEApplication>();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShellContentUtilityClient : public content::ContentUtilityClient {
|
class ShellContentUtilityClient : public content::ContentUtilityClient {
|
||||||
|
@@ -34,7 +34,7 @@ AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() {
|
|||||||
return new DefaultAccessibilityDelegate;
|
return new DefaultAccessibilityDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient*
|
ws::InputDeviceControllerClient*
|
||||||
ShellDelegateImpl::GetInputDeviceControllerClient() {
|
ShellDelegateImpl::GetInputDeviceControllerClient() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ class ShellDelegateImpl : public ShellDelegate {
|
|||||||
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
||||||
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
||||||
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl);
|
DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl);
|
||||||
|
@@ -20,7 +20,7 @@ namespace keyboard {
|
|||||||
class KeyboardUI;
|
class KeyboardUI;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class InputDeviceControllerClient;
|
class InputDeviceControllerClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class ASH_EXPORT ShellDelegate {
|
|||||||
virtual void OpenKeyboardShortcutHelpPage() const {}
|
virtual void OpenKeyboardShortcutHelpPage() const {}
|
||||||
|
|
||||||
// Creator of Shell owns this; it's assumed this outlives Shell.
|
// Creator of Shell owns this; it's assumed this outlives Shell.
|
||||||
virtual ui::InputDeviceControllerClient* GetInputDeviceControllerClient() = 0;
|
virtual ws::InputDeviceControllerClient* GetInputDeviceControllerClient() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ash
|
} // namespace ash
|
||||||
|
@@ -66,14 +66,14 @@ AccessibilityDelegate* ShellDelegateMash::CreateAccessibilityDelegate() {
|
|||||||
return new DefaultAccessibilityDelegate;
|
return new DefaultAccessibilityDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient*
|
ws::InputDeviceControllerClient*
|
||||||
ShellDelegateMash::GetInputDeviceControllerClient() {
|
ShellDelegateMash::GetInputDeviceControllerClient() {
|
||||||
if (!Shell::Get()->connector())
|
if (!Shell::Get()->connector())
|
||||||
return nullptr; // Happens in tests.
|
return nullptr; // Happens in tests.
|
||||||
|
|
||||||
if (!input_device_controller_client_) {
|
if (!input_device_controller_client_) {
|
||||||
input_device_controller_client_ =
|
input_device_controller_client_ =
|
||||||
std::make_unique<ui::InputDeviceControllerClient>(
|
std::make_unique<ws::InputDeviceControllerClient>(
|
||||||
Shell::Get()->connector());
|
Shell::Get()->connector());
|
||||||
}
|
}
|
||||||
return input_device_controller_client_.get();
|
return input_device_controller_client_.get();
|
||||||
|
@@ -22,10 +22,10 @@ class ShellDelegateMash : public ShellDelegate {
|
|||||||
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
||||||
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
||||||
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<ui::InputDeviceControllerClient>
|
std::unique_ptr<ws::InputDeviceControllerClient>
|
||||||
input_device_controller_client_;
|
input_device_controller_client_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ShellDelegateMash);
|
DISALLOW_COPY_AND_ASSIGN(ShellDelegateMash);
|
||||||
|
@@ -20,9 +20,10 @@ class Connector;
|
|||||||
namespace ui {
|
namespace ui {
|
||||||
class ContextFactory;
|
class ContextFactory;
|
||||||
class ContextFactoryPrivate;
|
class ContextFactoryPrivate;
|
||||||
namespace ws2 {
|
|
||||||
class GpuInterfaceProvider;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class GpuInterfaceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
@@ -43,7 +44,7 @@ struct ASH_EXPORT ShellInitParams {
|
|||||||
|
|
||||||
// Allows gpu interfaces to be injected while avoiding direct content
|
// Allows gpu interfaces to be injected while avoiding direct content
|
||||||
// dependencies.
|
// dependencies.
|
||||||
std::unique_ptr<ui::ws2::GpuInterfaceProvider> gpu_interface_provider;
|
std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider;
|
||||||
|
|
||||||
// Connector used by Shell to establish connections.
|
// Connector used by Shell to establish connections.
|
||||||
service_manager::Connector* connector = nullptr;
|
service_manager::Connector* connector = nullptr;
|
||||||
|
@@ -105,7 +105,7 @@ void TrayIMETest::SuppressKeyboard() {
|
|||||||
std::vector<ui::TouchscreenDevice> screens;
|
std::vector<ui::TouchscreenDevice> screens;
|
||||||
screens.emplace_back(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
screens.emplace_back(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0);
|
"Touchscreen", gfx::Size(1024, 768), 0);
|
||||||
ui::InputDeviceClientTestApi input_device_client_test_api;
|
ws::InputDeviceClientTestApi input_device_client_test_api;
|
||||||
input_device_client_test_api.SetTouchscreenDevices(screens);
|
input_device_client_test_api.SetTouchscreenDevices(screens);
|
||||||
|
|
||||||
std::vector<ui::InputDevice> keyboards;
|
std::vector<ui::InputDevice> keyboards;
|
||||||
@@ -116,9 +116,9 @@ void TrayIMETest::SuppressKeyboard() {
|
|||||||
|
|
||||||
void TrayIMETest::RestoreKeyboard() {
|
void TrayIMETest::RestoreKeyboard() {
|
||||||
DCHECK(keyboard_suppressed_);
|
DCHECK(keyboard_suppressed_);
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(
|
||||||
touchscreen_devices_to_restore_);
|
touchscreen_devices_to_restore_);
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices(
|
ws::InputDeviceClientTestApi().SetKeyboardDevices(
|
||||||
keyboard_devices_to_restore_);
|
keyboard_devices_to_restore_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -79,7 +79,7 @@ class OverviewButtonTrayTest : public AshTestBase {
|
|||||||
|
|
||||||
AshTestBase::SetUp();
|
AshTestBase::SetUp();
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().SetKeyboardDevices({ui::InputDevice(
|
ws::InputDeviceClientTestApi().SetKeyboardDevices({ui::InputDevice(
|
||||||
3, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")});
|
3, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
}
|
}
|
||||||
|
@@ -229,7 +229,7 @@ TEST_F(BacklightsForcedOffSetterTest,
|
|||||||
ui::TouchscreenDevice internal_touchdevice(
|
ui::TouchscreenDevice internal_touchdevice(
|
||||||
234, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
234, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
std::string("test internal touch device"), gfx::Size(1000, 1000), 1);
|
std::string("test internal touch device"), gfx::Size(1000, 1000), 1);
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices(
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices(
|
||||||
{external_touchdevice, internal_touchdevice});
|
{external_touchdevice, internal_touchdevice});
|
||||||
|
|
||||||
std::vector<ui::TouchDeviceTransform> transforms;
|
std::vector<ui::TouchDeviceTransform> transforms;
|
||||||
@@ -275,7 +275,7 @@ TEST_F(BacklightsForcedOffSetterTest, TouchscreensDisableOnBrightnessChange) {
|
|||||||
ui::TouchscreenDevice internal_touchdevice(
|
ui::TouchscreenDevice internal_touchdevice(
|
||||||
234, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
234, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
std::string("test internal touch device"), gfx::Size(1000, 1000), 1);
|
std::string("test internal touch device"), gfx::Size(1000, 1000), 1);
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({internal_touchdevice});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({internal_touchdevice});
|
||||||
|
|
||||||
// Add internal touch device to the list.
|
// Add internal touch device to the list.
|
||||||
std::vector<ui::TouchDeviceTransform> transforms;
|
std::vector<ui::TouchDeviceTransform> transforms;
|
||||||
|
@@ -195,7 +195,7 @@ TEST_F(PeripheralBatteryNotifierTest, DISABLED_StylusNotification) {
|
|||||||
1 /* touch_points */, true /* has_stylus */);
|
1 /* touch_points */, true /* has_stylus */);
|
||||||
stylus.sys_path = base::FilePath(kTestStylusBatteryPath);
|
stylus.sys_path = base::FilePath(kTestStylusBatteryPath);
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({stylus});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({stylus});
|
||||||
|
|
||||||
message_center::MessageCenter* message_center =
|
message_center::MessageCenter* message_center =
|
||||||
message_center::MessageCenter::Get();
|
message_center::MessageCenter::Get();
|
||||||
|
@@ -524,17 +524,17 @@ display::Display AshTestBase::GetSecondaryDisplay() {
|
|||||||
return ash_test_helper_->GetSecondaryDisplay();
|
return ash_test_helper_->GetSecondaryDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::WindowTreeTestHelper* AshTestBase::GetWindowTreeTestHelper() {
|
ws::WindowTreeTestHelper* AshTestBase::GetWindowTreeTestHelper() {
|
||||||
CreateWindowTreeIfNecessary();
|
CreateWindowTreeIfNecessary();
|
||||||
return window_tree_test_helper_.get();
|
return window_tree_test_helper_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::TestWindowTreeClient* AshTestBase::GetTestWindowTreeClient() {
|
ws::TestWindowTreeClient* AshTestBase::GetTestWindowTreeClient() {
|
||||||
CreateWindowTreeIfNecessary();
|
CreateWindowTreeIfNecessary();
|
||||||
return window_tree_client_.get();
|
return window_tree_client_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::ws2::WindowTree* AshTestBase::GetWindowTree() {
|
ws::WindowTree* AshTestBase::GetWindowTree() {
|
||||||
CreateWindowTreeIfNecessary();
|
CreateWindowTreeIfNecessary();
|
||||||
return window_tree_.get();
|
return window_tree_.get();
|
||||||
}
|
}
|
||||||
@@ -544,13 +544,13 @@ void AshTestBase::CreateWindowTreeIfNecessary() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Lazily create a single client.
|
// Lazily create a single client.
|
||||||
window_tree_client_ = std::make_unique<ui::ws2::TestWindowTreeClient>();
|
window_tree_client_ = std::make_unique<ws::TestWindowTreeClient>();
|
||||||
window_tree_ =
|
window_tree_ =
|
||||||
Shell::Get()->window_service_owner()->window_service()->CreateWindowTree(
|
Shell::Get()->window_service_owner()->window_service()->CreateWindowTree(
|
||||||
window_tree_client_.get());
|
window_tree_client_.get());
|
||||||
window_tree_->InitFromFactory();
|
window_tree_->InitFromFactory();
|
||||||
window_tree_test_helper_ =
|
window_tree_test_helper_ =
|
||||||
std::make_unique<ui::ws2::WindowTreeTestHelper>(window_tree_.get());
|
std::make_unique<ws::WindowTreeTestHelper>(window_tree_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ash
|
} // namespace ash
|
||||||
|
@@ -41,18 +41,19 @@ namespace ui {
|
|||||||
namespace test {
|
namespace test {
|
||||||
class EventGenerator;
|
class EventGenerator;
|
||||||
}
|
}
|
||||||
namespace ws2 {
|
} // namespace ui
|
||||||
class TestWindowTreeClient;
|
|
||||||
class WindowTree;
|
|
||||||
class WindowTreeTestHelper;
|
|
||||||
} // namespace ws2
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
class Widget;
|
class Widget;
|
||||||
class WidgetDelegate;
|
class WidgetDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class TestWindowTreeClient;
|
||||||
|
class WindowTree;
|
||||||
|
class WindowTreeTestHelper;
|
||||||
|
} // namespace ws
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
class AppListTestHelper;
|
class AppListTestHelper;
|
||||||
@@ -240,9 +241,9 @@ class AshTestBase : public testing::Test {
|
|||||||
display::Display GetSecondaryDisplay();
|
display::Display GetSecondaryDisplay();
|
||||||
|
|
||||||
// Returns the WindowTreeTestHelper, creating if necessary.
|
// Returns the WindowTreeTestHelper, creating if necessary.
|
||||||
ui::ws2::WindowTreeTestHelper* GetWindowTreeTestHelper();
|
ws::WindowTreeTestHelper* GetWindowTreeTestHelper();
|
||||||
ui::ws2::TestWindowTreeClient* GetTestWindowTreeClient();
|
ws::TestWindowTreeClient* GetTestWindowTreeClient();
|
||||||
ui::ws2::WindowTree* GetWindowTree();
|
ws::WindowTree* GetWindowTree();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateWindowTreeIfNecessary();
|
void CreateWindowTreeIfNecessary();
|
||||||
@@ -258,9 +259,9 @@ class AshTestBase : public testing::Test {
|
|||||||
std::unique_ptr<AshTestHelper> ash_test_helper_;
|
std::unique_ptr<AshTestHelper> ash_test_helper_;
|
||||||
std::unique_ptr<ui::test::EventGenerator> event_generator_;
|
std::unique_ptr<ui::test::EventGenerator> event_generator_;
|
||||||
|
|
||||||
std::unique_ptr<ui::ws2::TestWindowTreeClient> window_tree_client_;
|
std::unique_ptr<ws::TestWindowTreeClient> window_tree_client_;
|
||||||
std::unique_ptr<ui::ws2::WindowTree> window_tree_;
|
std::unique_ptr<ws::WindowTree> window_tree_;
|
||||||
std::unique_ptr<ui::ws2::WindowTreeTestHelper> window_tree_test_helper_;
|
std::unique_ptr<ws::WindowTreeTestHelper> window_tree_test_helper_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AshTestBase);
|
DISALLOW_COPY_AND_ASSIGN(AshTestBase);
|
||||||
};
|
};
|
||||||
|
@@ -34,7 +34,7 @@ AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() {
|
|||||||
return new DefaultAccessibilityDelegate;
|
return new DefaultAccessibilityDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient*
|
ws::InputDeviceControllerClient*
|
||||||
TestShellDelegate::GetInputDeviceControllerClient() {
|
TestShellDelegate::GetInputDeviceControllerClient() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ class TestShellDelegate : public ShellDelegate {
|
|||||||
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
|
||||||
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() override;
|
||||||
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestShellDelegate);
|
DISALLOW_COPY_AND_ASSIGN(TestShellDelegate);
|
||||||
|
@@ -41,7 +41,7 @@ void OnSetTouchpadEnabledDone(bool enabled, bool succeeded) {
|
|||||||
cursor_manager->HideCursor();
|
cursor_manager->HideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() {
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() {
|
||||||
return Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
return Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -407,7 +407,7 @@ bool NonClientFrameController::CanMinimize() const {
|
|||||||
|
|
||||||
bool NonClientFrameController::CanActivate() const {
|
bool NonClientFrameController::CanActivate() const {
|
||||||
// kCanFocus is used for both focus and activation.
|
// kCanFocus is used for both focus and activation.
|
||||||
return window_ && window_->GetProperty(ui::ws2::kCanFocus) &&
|
return window_ && window_->GetProperty(ws::kCanFocus) &&
|
||||||
views::WidgetDelegate::CanActivate();
|
views::WidgetDelegate::CanActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -204,7 +204,7 @@ TEST_F(NonClientFrameControllerTest, CallsRequestClose) {
|
|||||||
auto* changes = GetTestWindowTreeClient()->tracker()->changes();
|
auto* changes = GetTestWindowTreeClient()->tracker()->changes();
|
||||||
ASSERT_FALSE(changes->empty());
|
ASSERT_FALSE(changes->empty());
|
||||||
// The remote client should have a request to close the window.
|
// The remote client should have a request to close the window.
|
||||||
EXPECT_EQ("RequestClose", ui::ws2::ChangeToDescription(changes->back()));
|
EXPECT_EQ("RequestClose", ws::ChangeToDescription(changes->back()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(NonClientFrameControllerTest, WindowTitle) {
|
TEST_F(NonClientFrameControllerTest, WindowTitle) {
|
||||||
|
@@ -14,7 +14,7 @@ namespace ash {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() {
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() {
|
||||||
return Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
return Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -698,7 +698,7 @@ TEST_F(TabletModeControllerTest, ForceTabletModeTest) {
|
|||||||
EXPECT_TRUE(AreEventsBlocked());
|
EXPECT_TRUE(AreEventsBlocked());
|
||||||
|
|
||||||
// Tests that attaching a external mouse will not change the mode.
|
// Tests that attaching a external mouse will not change the mode.
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
ws::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
||||||
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
EXPECT_TRUE(IsTabletModeStarted());
|
EXPECT_TRUE(IsTabletModeStarted());
|
||||||
@@ -787,7 +787,7 @@ TEST_F(TabletModeControllerTest, CannotEnterTabletModeWithExternalMouse) {
|
|||||||
// Set the current list of devices to empty so that they don't interfere
|
// Set the current list of devices to empty so that they don't interfere
|
||||||
// with the test.
|
// with the test.
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({});
|
ws::InputDeviceClientTestApi().SetMouseDevices({});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
OpenLidToAngle(300.0f);
|
OpenLidToAngle(300.0f);
|
||||||
@@ -797,7 +797,7 @@ TEST_F(TabletModeControllerTest, CannotEnterTabletModeWithExternalMouse) {
|
|||||||
EXPECT_FALSE(IsTabletModeStarted());
|
EXPECT_FALSE(IsTabletModeStarted());
|
||||||
|
|
||||||
// Attach a external mouse.
|
// Attach a external mouse.
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
ws::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
||||||
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
EXPECT_FALSE(IsTabletModeStarted());
|
EXPECT_FALSE(IsTabletModeStarted());
|
||||||
@@ -813,7 +813,7 @@ TEST_F(TabletModeControllerTest, LeaveTabletModeWhenExternalMouseConnected) {
|
|||||||
// Set the current list of devices to empty so that they don't interfere
|
// Set the current list of devices to empty so that they don't interfere
|
||||||
// with the test.
|
// with the test.
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({});
|
ws::InputDeviceClientTestApi().SetMouseDevices({});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
// Start in tablet mode.
|
// Start in tablet mode.
|
||||||
@@ -823,14 +823,14 @@ TEST_F(TabletModeControllerTest, LeaveTabletModeWhenExternalMouseConnected) {
|
|||||||
|
|
||||||
// Attach external mouse and keyboard. Verify that tablet mode has ended, but
|
// Attach external mouse and keyboard. Verify that tablet mode has ended, but
|
||||||
// events are still blocked because the keyboard is still facing the bottom.
|
// events are still blocked because the keyboard is still facing the bottom.
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
ws::InputDeviceClientTestApi().SetMouseDevices({ui::InputDevice(
|
||||||
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "mouse")});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
EXPECT_FALSE(IsTabletModeStarted());
|
EXPECT_FALSE(IsTabletModeStarted());
|
||||||
EXPECT_TRUE(AreEventsBlocked());
|
EXPECT_TRUE(AreEventsBlocked());
|
||||||
|
|
||||||
// Verify that after unplugging the mouse, tablet mode will resume.
|
// Verify that after unplugging the mouse, tablet mode will resume.
|
||||||
ui::InputDeviceClientTestApi().SetMouseDevices({});
|
ws::InputDeviceClientTestApi().SetMouseDevices({});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
EXPECT_TRUE(IsTabletModeStarted());
|
EXPECT_TRUE(IsTabletModeStarted());
|
||||||
EXPECT_TRUE(AreEventsBlocked());
|
EXPECT_TRUE(AreEventsBlocked());
|
||||||
|
@@ -172,8 +172,7 @@ aura::Window* CreateAndParentTopLevelWindowInRoot(
|
|||||||
|
|
||||||
// WindowDelegateImpl() deletes itself when the associated window is
|
// WindowDelegateImpl() deletes itself when the associated window is
|
||||||
// destroyed.
|
// destroyed.
|
||||||
ui::ws2::WindowDelegateImpl* window_delegate =
|
ws::WindowDelegateImpl* window_delegate = new ws::WindowDelegateImpl();
|
||||||
new ui::ws2::WindowDelegateImpl();
|
|
||||||
aura::Window* window = window_factory::NewWindow(window_delegate).release();
|
aura::Window* window = window_factory::NewWindow(window_delegate).release();
|
||||||
window_delegate->set_window(window);
|
window_delegate->set_window(window);
|
||||||
aura::SetWindowType(window, window_type);
|
aura::SetWindowType(window, window_type);
|
||||||
@@ -227,7 +226,7 @@ aura::Window* CreateAndParentTopLevelWindow(
|
|||||||
bool can_focus = mojo::ConvertTo<bool>(focusable_iter->second);
|
bool can_focus = mojo::ConvertTo<bool>(focusable_iter->second);
|
||||||
NonClientFrameController* non_client_frame_controller =
|
NonClientFrameController* non_client_frame_controller =
|
||||||
NonClientFrameController::Get(window);
|
NonClientFrameController::Get(window);
|
||||||
window->SetProperty(ui::ws2::kCanFocus, can_focus);
|
window->SetProperty(ws::kCanFocus, can_focus);
|
||||||
if (non_client_frame_controller)
|
if (non_client_frame_controller)
|
||||||
non_client_frame_controller->set_can_activate(can_focus);
|
non_client_frame_controller->set_can_activate(can_focus);
|
||||||
// No need to persist this value.
|
// No need to persist this value.
|
||||||
|
@@ -17,7 +17,7 @@ bool IsTopLevelWindow(aura::Window* window) {
|
|||||||
// ui::LAYER_TEXTURED is for non-mash environment. For Mash, browser windows
|
// ui::LAYER_TEXTURED is for non-mash environment. For Mash, browser windows
|
||||||
// are not with LAYER_TEXTURED but have a remote client.
|
// are not with LAYER_TEXTURED but have a remote client.
|
||||||
return window->layer()->type() == ui::LAYER_TEXTURED ||
|
return window->layer()->type() == ui::LAYER_TEXTURED ||
|
||||||
ui::ws2::WindowService::HasRemoteClient(window);
|
ws::WindowService::HasRemoteClient(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the toplevel window at |screen_point| among the descendants of |window|.
|
// Get the toplevel window at |screen_point| among the descendants of |window|.
|
||||||
|
@@ -64,7 +64,7 @@ bool MoveWindowToRoot(aura::Window* window, aura::Window* root) {
|
|||||||
// Asks the remote client that owns |window| to close it. Returns true if there
|
// Asks the remote client that owns |window| to close it. Returns true if there
|
||||||
// was a remote client for |window|, false otherwise.
|
// was a remote client for |window|, false otherwise.
|
||||||
bool AskRemoteClientToCloseWindow(aura::Window* window) {
|
bool AskRemoteClientToCloseWindow(aura::Window* window) {
|
||||||
ui::ws2::WindowService* window_service =
|
ws::WindowService* window_service =
|
||||||
Shell::Get()->window_service_owner()->window_service();
|
Shell::Get()->window_service_owner()->window_service();
|
||||||
return window_service && window_service->RequestClose(window);
|
return window_service && window_service->RequestClose(window);
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
AshGpuInterfaceProvider::AshGpuInterfaceProvider(
|
AshGpuInterfaceProvider::AshGpuInterfaceProvider(
|
||||||
ui::gpu_host::GpuHost* gpu_host,
|
ws::gpu_host::GpuHost* gpu_host,
|
||||||
discardable_memory::DiscardableSharedMemoryManager*
|
discardable_memory::DiscardableSharedMemoryManager*
|
||||||
discardable_shared_memory_manager)
|
discardable_shared_memory_manager)
|
||||||
: gpu_host_(gpu_host),
|
: gpu_host_(gpu_host),
|
||||||
|
@@ -14,23 +14,23 @@ namespace discardable_memory {
|
|||||||
class DiscardableSharedMemoryManager;
|
class DiscardableSharedMemoryManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
namespace gpu_host {
|
namespace gpu_host {
|
||||||
class GpuHost;
|
class GpuHost;
|
||||||
}
|
}
|
||||||
} // namespace ui
|
} // namespace ws
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
// Implementation of GpuInterfaceProvider used when Ash runs out of process.
|
// Implementation of GpuInterfaceProvider used when Ash runs out of process.
|
||||||
class AshGpuInterfaceProvider : public ui::ws2::GpuInterfaceProvider {
|
class AshGpuInterfaceProvider : public ws::GpuInterfaceProvider {
|
||||||
public:
|
public:
|
||||||
AshGpuInterfaceProvider(ui::gpu_host::GpuHost* gpu_host,
|
AshGpuInterfaceProvider(ws::gpu_host::GpuHost* gpu_host,
|
||||||
discardable_memory::DiscardableSharedMemoryManager*
|
discardable_memory::DiscardableSharedMemoryManager*
|
||||||
discardable_shared_memory_manager);
|
discardable_shared_memory_manager);
|
||||||
~AshGpuInterfaceProvider() override;
|
~AshGpuInterfaceProvider() override;
|
||||||
|
|
||||||
// ui::ws2::GpuInterfaceProvider:
|
// ws::GpuInterfaceProvider:
|
||||||
void RegisterGpuInterfaces(
|
void RegisterGpuInterfaces(
|
||||||
service_manager::BinderRegistry* registry) override;
|
service_manager::BinderRegistry* registry) override;
|
||||||
void RegisterOzoneGpuInterfaces(
|
void RegisterOzoneGpuInterfaces(
|
||||||
@@ -42,7 +42,7 @@ class AshGpuInterfaceProvider : public ui::ws2::GpuInterfaceProvider {
|
|||||||
discardable_memory::mojom::DiscardableSharedMemoryManagerRequest request);
|
discardable_memory::mojom::DiscardableSharedMemoryManagerRequest request);
|
||||||
void BindGpuRequest(ws::mojom::GpuRequest request);
|
void BindGpuRequest(ws::mojom::GpuRequest request);
|
||||||
|
|
||||||
ui::gpu_host::GpuHost* gpu_host_;
|
ws::gpu_host::GpuHost* gpu_host_;
|
||||||
discardable_memory::DiscardableSharedMemoryManager*
|
discardable_memory::DiscardableSharedMemoryManager*
|
||||||
discardable_shared_memory_manager_;
|
discardable_shared_memory_manager_;
|
||||||
|
|
||||||
|
@@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
class WindowServiceDelegateImpl : public ui::ws2::WindowServiceDelegate {
|
class WindowServiceDelegateImpl : public ws::WindowServiceDelegate {
|
||||||
public:
|
public:
|
||||||
WindowServiceDelegateImpl();
|
WindowServiceDelegateImpl();
|
||||||
~WindowServiceDelegateImpl() override;
|
~WindowServiceDelegateImpl() override;
|
||||||
|
|
||||||
// ui::ws2::WindowServiceDelegate:
|
// ws::WindowServiceDelegate:
|
||||||
std::unique_ptr<aura::Window> NewTopLevel(
|
std::unique_ptr<aura::Window> NewTopLevel(
|
||||||
aura::PropertyConverter* property_converter,
|
aura::PropertyConverter* property_converter,
|
||||||
const base::flat_map<std::string, std::vector<uint8_t>>& properties)
|
const base::flat_map<std::string, std::vector<uint8_t>>& properties)
|
||||||
|
@@ -49,7 +49,7 @@ class WindowServiceDelegateImplTest : public AshTestBase {
|
|||||||
WindowServiceDelegateImplTest() = default;
|
WindowServiceDelegateImplTest() = default;
|
||||||
~WindowServiceDelegateImplTest() override = default;
|
~WindowServiceDelegateImplTest() override = default;
|
||||||
|
|
||||||
ui::Id GetTopLevelWindowId() {
|
ws::Id GetTopLevelWindowId() {
|
||||||
return GetWindowTreeTestHelper()->TransportIdForWindow(top_level_.get());
|
return GetWindowTreeTestHelper()->TransportIdForWindow(top_level_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class WindowServiceDelegateImplTest : public AshTestBase {
|
|||||||
->wm_toplevel_window_event_handler();
|
->wm_toplevel_window_event_handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ui::ws2::Change>* GetWindowTreeClientChanges() {
|
std::vector<ws::Change>* GetWindowTreeClientChanges() {
|
||||||
return GetTestWindowTreeClient()->tracker()->changes();
|
return GetTestWindowTreeClient()->tracker()->changes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,14 +20,14 @@
|
|||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
WindowServiceOwner::WindowServiceOwner(
|
WindowServiceOwner::WindowServiceOwner(
|
||||||
std::unique_ptr<ui::ws2::GpuInterfaceProvider> gpu_interface_provider)
|
std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider)
|
||||||
: window_service_delegate_(std::make_unique<WindowServiceDelegateImpl>()),
|
: window_service_delegate_(std::make_unique<WindowServiceDelegateImpl>()),
|
||||||
owned_window_service_(std::make_unique<ui::ws2::WindowService>(
|
owned_window_service_(
|
||||||
window_service_delegate_.get(),
|
std::make_unique<ws::WindowService>(window_service_delegate_.get(),
|
||||||
std::move(gpu_interface_provider),
|
std::move(gpu_interface_provider),
|
||||||
Shell::Get()->focus_controller(),
|
Shell::Get()->focus_controller(),
|
||||||
!::features::IsMultiProcessMash(),
|
!::features::IsMultiProcessMash(),
|
||||||
Shell::Get()->aura_env())),
|
Shell::Get()->aura_env())),
|
||||||
window_service_(owned_window_service_.get()) {
|
window_service_(owned_window_service_.get()) {
|
||||||
window_service_->SetFrameDecorationValues(
|
window_service_->SetFrameDecorationValues(
|
||||||
NonClientFrameController::GetPreferredClientAreaInsets(),
|
NonClientFrameController::GetPreferredClientAreaInsets(),
|
||||||
|
@@ -16,12 +16,10 @@ namespace service_manager {
|
|||||||
class ServiceContext;
|
class ServiceContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
namespace ws2 {
|
|
||||||
class GpuInterfaceProvider;
|
class GpuInterfaceProvider;
|
||||||
class WindowService;
|
class WindowService;
|
||||||
} // namespace ws2
|
} // namespace ws
|
||||||
} // namespace ui
|
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
|
|
||||||
@@ -33,14 +31,14 @@ class WindowServiceDelegateImpl;
|
|||||||
class ASH_EXPORT WindowServiceOwner {
|
class ASH_EXPORT WindowServiceOwner {
|
||||||
public:
|
public:
|
||||||
explicit WindowServiceOwner(
|
explicit WindowServiceOwner(
|
||||||
std::unique_ptr<ui::ws2::GpuInterfaceProvider> gpu_interface_provider);
|
std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider);
|
||||||
~WindowServiceOwner();
|
~WindowServiceOwner();
|
||||||
|
|
||||||
// Called from the ServiceManager when a request is made for the
|
// Called from the ServiceManager when a request is made for the
|
||||||
// WindowService.
|
// WindowService.
|
||||||
void BindWindowService(service_manager::mojom::ServiceRequest request);
|
void BindWindowService(service_manager::mojom::ServiceRequest request);
|
||||||
|
|
||||||
ui::ws2::WindowService* window_service() { return window_service_; }
|
ws::WindowService* window_service() { return window_service_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class AshTestHelper;
|
friend class AshTestHelper;
|
||||||
@@ -54,8 +52,8 @@ class ASH_EXPORT WindowServiceOwner {
|
|||||||
// it to |owned_window_service_| and |window_service_|. When
|
// it to |owned_window_service_| and |window_service_|. When
|
||||||
// BindWindowService() is called |owned_window_service_| is passed to
|
// BindWindowService() is called |owned_window_service_| is passed to
|
||||||
// |service_context_|.
|
// |service_context_|.
|
||||||
std::unique_ptr<ui::ws2::WindowService> owned_window_service_;
|
std::unique_ptr<ws::WindowService> owned_window_service_;
|
||||||
ui::ws2::WindowService* window_service_;
|
ws::WindowService* window_service_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WindowServiceOwner);
|
DISALLOW_COPY_AND_ASSIGN(WindowServiceOwner);
|
||||||
};
|
};
|
||||||
|
@@ -206,14 +206,14 @@ void BrowserProcessPlatformPart::DestroySystemClock() {
|
|||||||
system_clock_.reset();
|
system_clock_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient*
|
ws::InputDeviceControllerClient*
|
||||||
BrowserProcessPlatformPart::GetInputDeviceControllerClient() {
|
BrowserProcessPlatformPart::GetInputDeviceControllerClient() {
|
||||||
if (!input_device_controller_client_) {
|
if (!input_device_controller_client_) {
|
||||||
const std::string service_name = !features::IsMultiProcessMash()
|
const std::string service_name = !features::IsMultiProcessMash()
|
||||||
? chromeos::kChromeServiceName
|
? chromeos::kChromeServiceName
|
||||||
: ws::mojom::kServiceName;
|
: ws::mojom::kServiceName;
|
||||||
input_device_controller_client_ =
|
input_device_controller_client_ =
|
||||||
std::make_unique<ui::InputDeviceControllerClient>(
|
std::make_unique<ws::InputDeviceControllerClient>(
|
||||||
content::ServiceManagerConnection::GetForProcess()->GetConnector(),
|
content::ServiceManagerConnection::GetForProcess()->GetConnector(),
|
||||||
service_name);
|
service_name);
|
||||||
}
|
}
|
||||||
|
@@ -14,14 +14,13 @@
|
|||||||
#include "chrome/browser/browser_process_platform_part_base.h"
|
#include "chrome/browser/browser_process_platform_part_base.h"
|
||||||
|
|
||||||
namespace chromeos {
|
namespace chromeos {
|
||||||
|
class AccountManagerFactory;
|
||||||
class ChromeSessionManager;
|
class ChromeSessionManager;
|
||||||
class ChromeUserManager;
|
class ChromeUserManager;
|
||||||
class DiscoverManager;
|
class DiscoverManager;
|
||||||
class ProfileHelper;
|
class ProfileHelper;
|
||||||
class TimeZoneResolver;
|
class TimeZoneResolver;
|
||||||
} // namespace chromeos
|
|
||||||
|
|
||||||
namespace chromeos {
|
|
||||||
namespace system {
|
namespace system {
|
||||||
class AutomaticRebootManager;
|
class AutomaticRebootManager;
|
||||||
class DeviceDisablingManager;
|
class DeviceDisablingManager;
|
||||||
@@ -29,21 +28,20 @@ class DeviceDisablingManagerDefaultDelegate;
|
|||||||
class SystemClock;
|
class SystemClock;
|
||||||
class TimeZoneResolverManager;
|
class TimeZoneResolverManager;
|
||||||
} // namespace system
|
} // namespace system
|
||||||
class AccountManagerFactory;
|
|
||||||
} // namespace chromeos
|
} // namespace chromeos
|
||||||
|
|
||||||
|
namespace component_updater {
|
||||||
|
class CrOSComponentManager;
|
||||||
|
}
|
||||||
|
|
||||||
namespace policy {
|
namespace policy {
|
||||||
class BrowserPolicyConnectorChromeOS;
|
class BrowserPolicyConnectorChromeOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class InputDeviceControllerClient;
|
class InputDeviceControllerClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace component_updater {
|
|
||||||
class CrOSComponentManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ScopedKeepAlive;
|
class ScopedKeepAlive;
|
||||||
|
|
||||||
class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
|
class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
|
||||||
@@ -118,7 +116,7 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
|
|||||||
chromeos::system::SystemClock* GetSystemClock();
|
chromeos::system::SystemClock* GetSystemClock();
|
||||||
void DestroySystemClock();
|
void DestroySystemClock();
|
||||||
|
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient();
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient();
|
||||||
|
|
||||||
chromeos::AccountManagerFactory* GetAccountManagerFactory();
|
chromeos::AccountManagerFactory* GetAccountManagerFactory();
|
||||||
|
|
||||||
@@ -154,7 +152,7 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
|
|||||||
std::unique_ptr<chromeos::AccountManagerFactory> account_manager_factory_;
|
std::unique_ptr<chromeos::AccountManagerFactory> account_manager_factory_;
|
||||||
|
|
||||||
#if defined(USE_OZONE)
|
#if defined(USE_OZONE)
|
||||||
std::unique_ptr<ui::InputDeviceControllerClient>
|
std::unique_ptr<ws::InputDeviceControllerClient>
|
||||||
input_device_controller_client_;
|
input_device_controller_client_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -111,7 +111,7 @@ class ChromeService::IOThreadContext : public service_manager::Service {
|
|||||||
#if defined(OS_CHROMEOS)
|
#if defined(OS_CHROMEOS)
|
||||||
chromeos::Launchable launchable_;
|
chromeos::Launchable launchable_;
|
||||||
#if defined(USE_OZONE)
|
#if defined(USE_OZONE)
|
||||||
ui::InputDeviceController input_device_controller_;
|
ws::InputDeviceController input_device_controller_;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusUnsupported) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusSupported) {
|
IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusSupported) {
|
||||||
ui::InputDeviceClientTestApi test_api;
|
ws::InputDeviceClientTestApi test_api;
|
||||||
ui::TouchscreenDevice touchscreen(1,
|
ui::TouchscreenDevice touchscreen(1,
|
||||||
ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0);
|
"Touchscreen", gfx::Size(1024, 768), 0);
|
||||||
@@ -181,7 +181,7 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusSupported) {
|
|||||||
// TODO(https://crbug.com/814675): Excluded from Mash because pointer events
|
// TODO(https://crbug.com/814675): Excluded from Mash because pointer events
|
||||||
// aren't seen.
|
// aren't seen.
|
||||||
IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusSeen) {
|
IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, StylusSeen) {
|
||||||
ui::InputDeviceClientTestApi test_api;
|
ws::InputDeviceClientTestApi test_api;
|
||||||
ui::TouchscreenDevice touchscreen(1,
|
ui::TouchscreenDevice touchscreen(1,
|
||||||
ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
||||||
"Touchscreen", gfx::Size(1024, 768), 0);
|
"Touchscreen", gfx::Size(1024, 768), 0);
|
||||||
|
@@ -493,7 +493,7 @@ class LockScreenAppStateTest : public BrowserWithTestWindowTest {
|
|||||||
void SetStylusEnabled() {
|
void SetStylusEnabled() {
|
||||||
base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
||||||
ash::switches::kAshForceEnableStylusTools);
|
ash::switches::kAshForceEnableStylusTools);
|
||||||
ui::InputDeviceClientTestApi()
|
ws::InputDeviceClientTestApi()
|
||||||
.NotifyObserversTouchscreenDeviceConfigurationChanged();
|
.NotifyObserversTouchscreenDeviceConfigurationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class InputDeviceSettingsImplOzone : public InputDeviceSettings {
|
|||||||
void SetTouchscreensEnabled(bool enabled) override;
|
void SetTouchscreensEnabled(bool enabled) override;
|
||||||
|
|
||||||
// Cached InputDeviceControllerClient. It is owned by BrowserProcess.
|
// Cached InputDeviceControllerClient. It is owned by BrowserProcess.
|
||||||
ui::InputDeviceControllerClient* input_device_controller_client_;
|
ws::InputDeviceControllerClient* input_device_controller_client_;
|
||||||
|
|
||||||
// Respective device setting objects.
|
// Respective device setting objects.
|
||||||
TouchpadSettings current_touchpad_settings_;
|
TouchpadSettings current_touchpad_settings_;
|
||||||
|
@@ -160,7 +160,7 @@ void OnStatusLogCollected(
|
|||||||
|
|
||||||
// Collect touch event logs.
|
// Collect touch event logs.
|
||||||
const base::FilePath kBaseLogPath(kTouchEventLogDir);
|
const base::FilePath kBaseLogPath(kTouchEventLogDir);
|
||||||
ui::InputDeviceControllerClient* input_device_controller_client =
|
ws::InputDeviceControllerClient* input_device_controller_client =
|
||||||
g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
||||||
input_device_controller_client->GetTouchEventLog(
|
input_device_controller_client->GetTouchEventLog(
|
||||||
kBaseLogPath, base::BindOnce(&OnEventLogCollected, std::move(response),
|
kBaseLogPath, base::BindOnce(&OnEventLogCollected, std::move(response),
|
||||||
@@ -197,7 +197,7 @@ void TouchLogSource::Fetch(SysLogsSourceCallback callback) {
|
|||||||
CollectTouchHudDebugLog(response.get());
|
CollectTouchHudDebugLog(response.get());
|
||||||
|
|
||||||
// Collect touch device status logs.
|
// Collect touch device status logs.
|
||||||
ui::InputDeviceControllerClient* input_device_controller_client =
|
ws::InputDeviceControllerClient* input_device_controller_client =
|
||||||
g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
||||||
input_device_controller_client->GetTouchDeviceStatus(base::BindOnce(
|
input_device_controller_client->GetTouchDeviceStatus(base::BindOnce(
|
||||||
&OnStatusLogCollected, std::move(response), std::move(callback)));
|
&OnStatusLogCollected, std::move(response), std::move(callback)));
|
||||||
|
@@ -33,7 +33,7 @@ class ChromeBrowserMainExtraPartsMetricsTest : public testing::Test {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
#if defined(USE_OZONE) || defined(USE_X11)
|
#if defined(USE_OZONE) || defined(USE_X11)
|
||||||
ui::InputDeviceClientTestApi input_device_client_test_api_;
|
ws::InputDeviceClientTestApi input_device_client_test_api_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -116,7 +116,7 @@ ChromeShellDelegate::CreateScreenshotDelegate() {
|
|||||||
return std::make_unique<ChromeScreenshotGrabber>();
|
return std::make_unique<ChromeScreenshotGrabber>();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceControllerClient*
|
ws::InputDeviceControllerClient*
|
||||||
ChromeShellDelegate::GetInputDeviceControllerClient() {
|
ChromeShellDelegate::GetInputDeviceControllerClient() {
|
||||||
return g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
return g_browser_process->platform_part()->GetInputDeviceControllerClient();
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ class ChromeShellDelegate : public ash::ShellDelegate {
|
|||||||
std::unique_ptr<ash::ScreenshotDelegate> CreateScreenshotDelegate() override;
|
std::unique_ptr<ash::ScreenshotDelegate> CreateScreenshotDelegate() override;
|
||||||
ash::AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
ash::AccessibilityDelegate* CreateAccessibilityDelegate() override;
|
||||||
void OpenKeyboardShortcutHelpPage() const override;
|
void OpenKeyboardShortcutHelpPage() const override;
|
||||||
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
ws::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate);
|
DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate);
|
||||||
|
@@ -90,7 +90,7 @@ class OobeDisplayChooserTest : public ash::AshTestBase {
|
|||||||
display_chooser_->set_cros_display_config_ptr_for_test(
|
display_chooser_->set_cros_display_config_ptr_for_test(
|
||||||
cros_display_config_->CreateInterfacePtrAndBind());
|
cros_display_config_->CreateInterfacePtrAndBind());
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi().OnDeviceListsComplete();
|
ws::InputDeviceClientTestApi().OnDeviceListsComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
OobeDisplayChooser* display_chooser() { return display_chooser_.get(); }
|
OobeDisplayChooser* display_chooser() { return display_chooser_.get(); }
|
||||||
@@ -124,7 +124,7 @@ TEST_F(OobeDisplayChooserTest, PreferTouchAsPrimary) {
|
|||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
"Touchscreen", gfx::Size(800, 600), 1);
|
"Touchscreen", gfx::Size(800, 600), 1);
|
||||||
touchscreen.vendor_id = kWhitelistedId;
|
touchscreen.vendor_id = kWhitelistedId;
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
// Associate touchscreen device with display
|
// Associate touchscreen device with display
|
||||||
@@ -140,7 +140,7 @@ TEST_F(OobeDisplayChooserTest, PreferTouchAsPrimary) {
|
|||||||
// ws::mojom::InputDeviceObserverMojo. In unit tests InputDeviceClient is not
|
// ws::mojom::InputDeviceObserverMojo. In unit tests InputDeviceClient is not
|
||||||
// wired to the window server (the window server isn't running).
|
// wired to the window server (the window server isn't running).
|
||||||
touchscreen.target_display_id = display_info[1].id();
|
touchscreen.target_display_id = display_info[1].id();
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen}, true);
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen}, true);
|
||||||
|
|
||||||
EXPECT_EQ(1, GetPrimaryDisplay());
|
EXPECT_EQ(1, GetPrimaryDisplay());
|
||||||
display_chooser()->TryToPlaceUiOnTouchDisplay();
|
display_chooser()->TryToPlaceUiOnTouchDisplay();
|
||||||
@@ -167,7 +167,7 @@ TEST_F(OobeDisplayChooserTest, DontSwitchFromTouch) {
|
|||||||
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
||||||
"Touchscreen", gfx::Size(800, 600), 1);
|
"Touchscreen", gfx::Size(800, 600), 1);
|
||||||
touchscreen.vendor_id = kWhitelistedId;
|
touchscreen.vendor_id = kWhitelistedId;
|
||||||
ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
|
ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
|
||||||
base::RunLoop().RunUntilIdle();
|
base::RunLoop().RunUntilIdle();
|
||||||
|
|
||||||
// Associate touchscreen device with display
|
// Associate touchscreen device with display
|
||||||
|
@@ -141,7 +141,7 @@ class KeyboardHandlerTest : public testing::Test {
|
|||||||
return has_apple_command_key;
|
return has_apple_command_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::InputDeviceClientTestApi input_device_client_test_api_;
|
ws::InputDeviceClientTestApi input_device_client_test_api_;
|
||||||
content::TestWebUI web_ui_;
|
content::TestWebUI web_ui_;
|
||||||
TestKeyboardHandler handler_;
|
TestKeyboardHandler handler_;
|
||||||
KeyboardHandler::TestAPI handler_test_api_;
|
KeyboardHandler::TestAPI handler_test_api_;
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
|
GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
overlay_candidate_validator)
|
overlay_candidate_validator)
|
||||||
@@ -147,7 +147,7 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
|
uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
|
||||||
auto* gl = static_cast<ui::ContextProviderCommandBuffer*>(context_provider());
|
auto* gl = static_cast<ws::ContextProviderCommandBuffer*>(context_provider());
|
||||||
return gl->GetCopyTextureInternalFormat();
|
return gl->GetCopyTextureInternalFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,8 +192,8 @@ void GpuBrowserCompositorOutputSurface::OnUpdateVSyncParameters(
|
|||||||
|
|
||||||
gpu::CommandBufferProxyImpl*
|
gpu::CommandBufferProxyImpl*
|
||||||
GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
|
GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
|
||||||
ui::ContextProviderCommandBuffer* provider_command_buffer =
|
ws::ContextProviderCommandBuffer* provider_command_buffer =
|
||||||
static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
|
static_cast<ws::ContextProviderCommandBuffer*>(context_provider_.get());
|
||||||
gpu::CommandBufferProxyImpl* command_buffer_proxy =
|
gpu::CommandBufferProxyImpl* command_buffer_proxy =
|
||||||
provider_command_buffer->GetCommandBufferProxy();
|
provider_command_buffer->GetCommandBufferProxy();
|
||||||
DCHECK(command_buffer_proxy);
|
DCHECK(command_buffer_proxy);
|
||||||
|
@@ -27,7 +27,7 @@ class CommandBufferProxyImpl;
|
|||||||
struct SwapBuffersCompleteParams;
|
struct SwapBuffersCompleteParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class ContextProviderCommandBuffer;
|
class ContextProviderCommandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ class GpuBrowserCompositorOutputSurface
|
|||||||
: public BrowserCompositorOutputSurface {
|
: public BrowserCompositorOutputSurface {
|
||||||
public:
|
public:
|
||||||
GpuBrowserCompositorOutputSurface(
|
GpuBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
overlay_candidate_validator);
|
overlay_candidate_validator);
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
GpuOutputSurfaceMac::GpuOutputSurfaceMac(
|
GpuOutputSurfaceMac::GpuOutputSurfaceMac(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
|
@@ -15,7 +15,7 @@ class GpuOutputSurfaceMac
|
|||||||
: public GpuSurfacelessBrowserCompositorOutputSurface {
|
: public GpuSurfacelessBrowserCompositorOutputSurface {
|
||||||
public:
|
public:
|
||||||
GpuOutputSurfaceMac(
|
GpuOutputSurfaceMac(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
|
@@ -374,7 +374,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
|||||||
#else
|
#else
|
||||||
bool use_vulkan = false;
|
bool use_vulkan = false;
|
||||||
#endif
|
#endif
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider;
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider;
|
||||||
|
|
||||||
if (!use_gpu_compositing || use_vulkan) {
|
if (!use_gpu_compositing || use_vulkan) {
|
||||||
// If not using GL compositing, don't keep the old shared worker context.
|
// If not using GL compositing, don't keep the old shared worker context.
|
||||||
@@ -400,7 +400,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
|||||||
gpu_channel_host, gpu::kNullSurfaceHandle, need_alpha_channel,
|
gpu_channel_host, gpu::kNullSurfaceHandle, need_alpha_channel,
|
||||||
false /* support_stencil */, support_locking, support_gles2_interface,
|
false /* support_stencil */, support_locking, support_gles2_interface,
|
||||||
support_raster_interface, support_grcontext,
|
support_raster_interface, support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_WORKER);
|
ws::command_buffer_metrics::ContextType::BROWSER_WORKER);
|
||||||
auto result = shared_worker_context_provider_->BindToCurrentThread();
|
auto result = shared_worker_context_provider_->BindToCurrentThread();
|
||||||
if (result != gpu::ContextResult::kSuccess) {
|
if (result != gpu::ContextResult::kSuccess) {
|
||||||
shared_worker_context_provider_ = nullptr;
|
shared_worker_context_provider_ = nullptr;
|
||||||
@@ -427,7 +427,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
|||||||
std::move(gpu_channel_host), surface_handle, need_alpha_channel,
|
std::move(gpu_channel_host), surface_handle, need_alpha_channel,
|
||||||
support_stencil, support_locking, support_gles2_interface,
|
support_stencil, support_locking, support_gles2_interface,
|
||||||
support_raster_interface, support_grcontext,
|
support_raster_interface, support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_COMPOSITOR);
|
ws::command_buffer_metrics::ContextType::BROWSER_COMPOSITOR);
|
||||||
// On Mac, GpuCommandBufferMsg_SwapBuffersCompleted must be handled in
|
// On Mac, GpuCommandBufferMsg_SwapBuffersCompleted must be handled in
|
||||||
// a nested run loop during resize.
|
// a nested run loop during resize.
|
||||||
context_provider->SetDefaultTaskRunner(resize_task_runner_);
|
context_provider->SetDefaultTaskRunner(resize_task_runner_);
|
||||||
@@ -941,7 +941,7 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
|
|||||||
std::move(gpu_channel_host), gpu::kNullSurfaceHandle, need_alpha_channel,
|
std::move(gpu_channel_host), gpu::kNullSurfaceHandle, need_alpha_channel,
|
||||||
false, support_locking, support_gles2_interface, support_raster_interface,
|
false, support_locking, support_gles2_interface, support_raster_interface,
|
||||||
support_grcontext,
|
support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_MAIN_THREAD);
|
ws::command_buffer_metrics::ContextType::BROWSER_MAIN_THREAD);
|
||||||
shared_main_thread_contexts_->AddObserver(this);
|
shared_main_thread_contexts_->AddObserver(this);
|
||||||
auto result = shared_main_thread_contexts_->BindToCurrentThread();
|
auto result = shared_main_thread_contexts_->BindToCurrentThread();
|
||||||
if (result != gpu::ContextResult::kSuccess) {
|
if (result != gpu::ContextResult::kSuccess) {
|
||||||
@@ -1027,7 +1027,7 @@ void GpuProcessTransportFactory::OnContextLost() {
|
|||||||
callback_factory_.GetWeakPtr()));
|
callback_factory_.GetWeakPtr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>
|
scoped_refptr<ws::ContextProviderCommandBuffer>
|
||||||
GpuProcessTransportFactory::CreateContextCommon(
|
GpuProcessTransportFactory::CreateContextCommon(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
@@ -1037,7 +1037,7 @@ GpuProcessTransportFactory::CreateContextCommon(
|
|||||||
bool support_gles2_interface,
|
bool support_gles2_interface,
|
||||||
bool support_raster_interface,
|
bool support_raster_interface,
|
||||||
bool support_grcontext,
|
bool support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType type) {
|
ws::command_buffer_metrics::ContextType type) {
|
||||||
DCHECK(gpu_channel_host);
|
DCHECK(gpu_channel_host);
|
||||||
DCHECK(!is_gpu_compositing_disabled_);
|
DCHECK(!is_gpu_compositing_disabled_);
|
||||||
|
|
||||||
@@ -1074,7 +1074,7 @@ GpuProcessTransportFactory::CreateContextCommon(
|
|||||||
constexpr bool automatic_flushes = false;
|
constexpr bool automatic_flushes = false;
|
||||||
|
|
||||||
GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
|
GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
|
||||||
return base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
return base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), GetGpuMemoryBufferManager(), stream_id,
|
std::move(gpu_channel_host), GetGpuMemoryBufferManager(), stream_id,
|
||||||
stream_priority, surface_handle, url, automatic_flushes, support_locking,
|
stream_priority, surface_handle, url, automatic_flushes, support_locking,
|
||||||
support_grcontext, gpu::SharedMemoryLimits(), attributes, type);
|
support_grcontext, gpu::SharedMemoryLimits(), attributes, type);
|
||||||
|
@@ -40,10 +40,6 @@ class GpuChannelEstablishFactory;
|
|||||||
class VulkanImplementation;
|
class VulkanImplementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class ContextProviderCommandBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace viz {
|
namespace viz {
|
||||||
class CompositingModeReporterImpl;
|
class CompositingModeReporterImpl;
|
||||||
class OutputDeviceBacking;
|
class OutputDeviceBacking;
|
||||||
@@ -53,6 +49,10 @@ class VulkanInProcessContextProvider;
|
|||||||
class RasterContextProvider;
|
class RasterContextProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class ContextProviderCommandBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
class GpuProcessTransportFactory : public ui::ContextFactory,
|
class GpuProcessTransportFactory : public ui::ContextFactory,
|
||||||
@@ -136,7 +136,7 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
|
|||||||
// viz::ContextLostObserver implementation.
|
// viz::ContextLostObserver implementation.
|
||||||
void OnContextLost() override;
|
void OnContextLost() override;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> CreateContextCommon(
|
scoped_refptr<ws::ContextProviderCommandBuffer> CreateContextCommon(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
bool need_alpha_channel,
|
bool need_alpha_channel,
|
||||||
@@ -145,7 +145,7 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
|
|||||||
bool support_gles2_interface,
|
bool support_gles2_interface,
|
||||||
bool support_raster_interface,
|
bool support_raster_interface,
|
||||||
bool support_grcontext,
|
bool support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType type);
|
ws::command_buffer_metrics::ContextType type);
|
||||||
|
|
||||||
viz::FrameSinkIdAllocator frame_sink_id_allocator_;
|
viz::FrameSinkIdAllocator frame_sink_id_allocator_;
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
|
|||||||
PerCompositorDataMap per_compositor_data_;
|
PerCompositorDataMap per_compositor_data_;
|
||||||
|
|
||||||
const viz::RendererSettings renderer_settings_;
|
const viz::RendererSettings renderer_settings_;
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> shared_main_thread_contexts_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> shared_main_thread_contexts_;
|
||||||
base::ObserverList<ui::ContextFactoryObserver>::Unchecked observer_list_;
|
base::ObserverList<ui::ContextFactoryObserver>::Unchecked observer_list_;
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> resize_task_runner_;
|
scoped_refptr<base::SingleThreadTaskRunner> resize_task_runner_;
|
||||||
std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
|
std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
|
||||||
|
@@ -20,7 +20,7 @@ namespace content {
|
|||||||
|
|
||||||
GpuSurfacelessBrowserCompositorOutputSurface::
|
GpuSurfacelessBrowserCompositorOutputSurface::
|
||||||
GpuSurfacelessBrowserCompositorOutputSurface(
|
GpuSurfacelessBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
|
@@ -25,7 +25,7 @@ class GpuSurfacelessBrowserCompositorOutputSurface
|
|||||||
: public GpuBrowserCompositorOutputSurface {
|
: public GpuBrowserCompositorOutputSurface {
|
||||||
public:
|
public:
|
||||||
GpuSurfacelessBrowserCompositorOutputSurface(
|
GpuSurfacelessBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
gpu::SurfaceHandle surface_handle,
|
gpu::SurfaceHandle surface_handle,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
|
@@ -30,7 +30,7 @@ static viz::ResourceFormat kFboTextureFormat = viz::RGBA_8888;
|
|||||||
|
|
||||||
OffscreenBrowserCompositorOutputSurface::
|
OffscreenBrowserCompositorOutputSurface::
|
||||||
OffscreenBrowserCompositorOutputSurface(
|
OffscreenBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
overlay_candidate_validator)
|
overlay_candidate_validator)
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#include "ui/latency/latency_info.h"
|
#include "ui/latency/latency_info.h"
|
||||||
#include "ui/latency/latency_tracker.h"
|
#include "ui/latency/latency_tracker.h"
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class ContextProviderCommandBuffer;
|
class ContextProviderCommandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class OffscreenBrowserCompositorOutputSurface
|
|||||||
: public BrowserCompositorOutputSurface {
|
: public BrowserCompositorOutputSurface {
|
||||||
public:
|
public:
|
||||||
OffscreenBrowserCompositorOutputSurface(
|
OffscreenBrowserCompositorOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context,
|
||||||
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
|
||||||
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
|
||||||
overlay_candidate_validator);
|
overlay_candidate_validator);
|
||||||
|
@@ -46,14 +46,14 @@ namespace {
|
|||||||
// child process client id.
|
// child process client id.
|
||||||
constexpr uint32_t kBrowserClientId = 0u;
|
constexpr uint32_t kBrowserClientId = 0u;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> CreateContextProviderImpl(
|
scoped_refptr<ws::ContextProviderCommandBuffer> CreateContextProviderImpl(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
||||||
bool support_locking,
|
bool support_locking,
|
||||||
bool support_gles2_interface,
|
bool support_gles2_interface,
|
||||||
bool support_raster_interface,
|
bool support_raster_interface,
|
||||||
bool support_grcontext,
|
bool support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType type) {
|
ws::command_buffer_metrics::ContextType type) {
|
||||||
constexpr bool kAutomaticFlushes = false;
|
constexpr bool kAutomaticFlushes = false;
|
||||||
|
|
||||||
gpu::ContextCreationAttribs attributes;
|
gpu::ContextCreationAttribs attributes;
|
||||||
@@ -69,7 +69,7 @@ scoped_refptr<ui::ContextProviderCommandBuffer> CreateContextProviderImpl(
|
|||||||
attributes.enable_raster_interface = support_raster_interface;
|
attributes.enable_raster_interface = support_raster_interface;
|
||||||
|
|
||||||
GURL url("chrome://gpu/VizProcessTransportFactory::CreateContextProvider");
|
GURL url("chrome://gpu/VizProcessTransportFactory::CreateContextProvider");
|
||||||
return base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
return base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), gpu_memory_buffer_manager,
|
std::move(gpu_channel_host), gpu_memory_buffer_manager,
|
||||||
kGpuStreamIdDefault, kGpuStreamPriorityUI, gpu::kNullSurfaceHandle,
|
kGpuStreamIdDefault, kGpuStreamPriorityUI, gpu::kNullSurfaceHandle,
|
||||||
std::move(url), kAutomaticFlushes, support_locking, support_grcontext,
|
std::move(url), kAutomaticFlushes, support_locking, support_grcontext,
|
||||||
@@ -416,7 +416,7 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
|
|||||||
kSharedWorkerContextSupportsLocking, kSharedWorkerContextSupportsGLES2,
|
kSharedWorkerContextSupportsLocking, kSharedWorkerContextSupportsGLES2,
|
||||||
kSharedWorkerContextSupportsRaster,
|
kSharedWorkerContextSupportsRaster,
|
||||||
kSharedWorkerContextSupportsGrContext,
|
kSharedWorkerContextSupportsGrContext,
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_WORKER);
|
ws::command_buffer_metrics::ContextType::BROWSER_WORKER);
|
||||||
|
|
||||||
// Don't observer context loss on |worker_context_provider_| here, that is
|
// Don't observer context loss on |worker_context_provider_| here, that is
|
||||||
// already observered by LayerTreeFrameSink. The lost context will be caught
|
// already observered by LayerTreeFrameSink. The lost context will be caught
|
||||||
@@ -443,7 +443,7 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
|
|||||||
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
||||||
kCompositorContextSupportsLocking, kCompositorContextSupportsGLES2,
|
kCompositorContextSupportsLocking, kCompositorContextSupportsGLES2,
|
||||||
kCompositorContextSupportsRaster, kCompositorContextSupportsGrContext,
|
kCompositorContextSupportsRaster, kCompositorContextSupportsGrContext,
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_MAIN_THREAD);
|
ws::command_buffer_metrics::ContextType::BROWSER_MAIN_THREAD);
|
||||||
main_context_provider_->SetDefaultTaskRunner(resize_task_runner());
|
main_context_provider_->SetDefaultTaskRunner(resize_task_runner());
|
||||||
|
|
||||||
auto context_result = main_context_provider_->BindToCurrentThread();
|
auto context_result = main_context_provider_->BindToCurrentThread();
|
||||||
|
@@ -31,15 +31,15 @@ namespace gpu {
|
|||||||
class GpuChannelEstablishFactory;
|
class GpuChannelEstablishFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class ContextProviderCommandBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace viz {
|
namespace viz {
|
||||||
class CompositingModeReporterImpl;
|
class CompositingModeReporterImpl;
|
||||||
class RasterContextProvider;
|
class RasterContextProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class ContextProviderCommandBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
// A replacement for GpuProcessTransportFactory to be used when running viz. In
|
// A replacement for GpuProcessTransportFactory to be used when running viz. In
|
||||||
@@ -124,7 +124,7 @@ class VizProcessTransportFactory : public ui::ContextFactory,
|
|||||||
|
|
||||||
// ContextProvider used on the main thread. Shared by ui::Compositors and also
|
// ContextProvider used on the main thread. Shared by ui::Compositors and also
|
||||||
// returned from GetSharedMainThreadContextProvider().
|
// returned from GetSharedMainThreadContextProvider().
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> main_context_provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> main_context_provider_;
|
||||||
|
|
||||||
std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
|
std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ class ContextTestBase : public content::ContentBrowserTest {
|
|||||||
gpu::ContextSupport* context_support_ = nullptr;
|
gpu::ContextSupport* context_support_ = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -221,7 +221,7 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest,
|
|||||||
MAYBE_GrContextKeepsGpuChannelAlive) {
|
MAYBE_GrContextKeepsGpuChannelAlive) {
|
||||||
// Test for crbug.com/551143
|
// Test for crbug.com/551143
|
||||||
// This test verifies that holding a reference to the GrContext created by
|
// This test verifies that holding a reference to the GrContext created by
|
||||||
// a ui::ContextProviderCommandBuffer will keep the gpu channel alive after
|
// a ws::ContextProviderCommandBuffer will keep the gpu channel alive after
|
||||||
// the
|
// the
|
||||||
// provider has been destroyed. Without this behavior, user code would have
|
// provider has been destroyed. Without this behavior, user code would have
|
||||||
// to be careful to destroy objects in the right order to avoid using freed
|
// to be careful to destroy objects in the right order to avoid using freed
|
||||||
@@ -231,7 +231,7 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest,
|
|||||||
|
|
||||||
// Step 2: verify that holding onto the provider's GrContext will
|
// Step 2: verify that holding onto the provider's GrContext will
|
||||||
// retain the host after provider is destroyed.
|
// retain the host after provider is destroyed.
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider =
|
||||||
content::GpuBrowsertestCreateContext(GetGpuChannel());
|
content::GpuBrowsertestCreateContext(GetGpuChannel());
|
||||||
ASSERT_EQ(provider->BindToCurrentThread(), gpu::ContextResult::kSuccess);
|
ASSERT_EQ(provider->BindToCurrentThread(), gpu::ContextResult::kSuccess);
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest,
|
|||||||
EstablishAndWait();
|
EstablishAndWait();
|
||||||
scoped_refptr<gpu::GpuChannelHost> host = GetGpuChannel();
|
scoped_refptr<gpu::GpuChannelHost> host = GetGpuChannel();
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider =
|
||||||
content::GpuBrowsertestCreateContext(GetGpuChannel());
|
content::GpuBrowsertestCreateContext(GetGpuChannel());
|
||||||
ContextLostRunLoop run_loop(provider.get());
|
ContextLostRunLoop run_loop(provider.get());
|
||||||
ASSERT_EQ(provider->BindToCurrentThread(), gpu::ContextResult::kSuccess);
|
ASSERT_EQ(provider->BindToCurrentThread(), gpu::ContextResult::kSuccess);
|
||||||
|
@@ -360,20 +360,20 @@ void CreateContextProviderAfterGpuChannelEstablished(
|
|||||||
constexpr bool support_grcontext = false;
|
constexpr bool support_grcontext = false;
|
||||||
|
|
||||||
auto context_provider =
|
auto context_provider =
|
||||||
base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
||||||
stream_id, stream_priority, handle,
|
stream_id, stream_priority, handle,
|
||||||
GURL(std::string("chrome://gpu/Compositor::CreateContextProvider")),
|
GURL(std::string("chrome://gpu/Compositor::CreateContextProvider")),
|
||||||
automatic_flushes, support_locking, support_grcontext,
|
automatic_flushes, support_locking, support_grcontext,
|
||||||
shared_memory_limits, attributes,
|
shared_memory_limits, attributes,
|
||||||
ui::command_buffer_metrics::ContextType::UNKNOWN);
|
ws::command_buffer_metrics::ContextType::UNKNOWN);
|
||||||
callback.Run(std::move(context_provider));
|
callback.Run(std::move(context_provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
class AndroidOutputSurface : public viz::OutputSurface {
|
class AndroidOutputSurface : public viz::OutputSurface {
|
||||||
public:
|
public:
|
||||||
AndroidOutputSurface(
|
AndroidOutputSurface(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider,
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider,
|
||||||
base::RepeatingCallback<void(const gfx::Size&)> swap_buffers_callback)
|
base::RepeatingCallback<void(const gfx::Size&)> swap_buffers_callback)
|
||||||
: viz::OutputSurface(std::move(context_provider)),
|
: viz::OutputSurface(std::move(context_provider)),
|
||||||
swap_buffers_callback_(std::move(swap_buffers_callback)),
|
swap_buffers_callback_(std::move(swap_buffers_callback)),
|
||||||
@@ -458,7 +458,7 @@ class AndroidOutputSurface : public viz::OutputSurface {
|
|||||||
|
|
||||||
uint32_t GetFramebufferCopyTextureFormat() override {
|
uint32_t GetFramebufferCopyTextureFormat() override {
|
||||||
auto* gl =
|
auto* gl =
|
||||||
static_cast<ui::ContextProviderCommandBuffer*>(context_provider());
|
static_cast<ws::ContextProviderCommandBuffer*>(context_provider());
|
||||||
return gl->GetCopyTextureInternalFormat();
|
return gl->GetCopyTextureInternalFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,8 +466,8 @@ class AndroidOutputSurface : public viz::OutputSurface {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
gpu::CommandBufferProxyImpl* GetCommandBufferProxy() {
|
gpu::CommandBufferProxyImpl* GetCommandBufferProxy() {
|
||||||
ui::ContextProviderCommandBuffer* provider_command_buffer =
|
ws::ContextProviderCommandBuffer* provider_command_buffer =
|
||||||
static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
|
static_cast<ws::ContextProviderCommandBuffer*>(context_provider_.get());
|
||||||
gpu::CommandBufferProxyImpl* command_buffer_proxy =
|
gpu::CommandBufferProxyImpl* command_buffer_proxy =
|
||||||
provider_command_buffer->GetCommandBufferProxy();
|
provider_command_buffer->GetCommandBufferProxy();
|
||||||
DCHECK(command_buffer_proxy);
|
DCHECK(command_buffer_proxy);
|
||||||
@@ -1065,7 +1065,7 @@ void CompositorImpl::OnGpuChannelEstablished(
|
|||||||
gpu::SurfaceHandle surface_handle =
|
gpu::SurfaceHandle surface_handle =
|
||||||
enable_viz_ ? gpu::kNullSurfaceHandle : surface_handle_;
|
enable_viz_ ? gpu::kNullSurfaceHandle : surface_handle_;
|
||||||
auto context_provider =
|
auto context_provider =
|
||||||
base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
||||||
stream_id, stream_priority, surface_handle,
|
stream_id, stream_priority, surface_handle,
|
||||||
GURL(std::string("chrome://gpu/CompositorImpl::") +
|
GURL(std::string("chrome://gpu/CompositorImpl::") +
|
||||||
@@ -1074,7 +1074,7 @@ void CompositorImpl::OnGpuChannelEstablished(
|
|||||||
GetCompositorContextSharedMemoryLimits(root_window_),
|
GetCompositorContextSharedMemoryLimits(root_window_),
|
||||||
GetCompositorContextAttributes(display_color_space_,
|
GetCompositorContextAttributes(display_color_space_,
|
||||||
requires_alpha_channel_),
|
requires_alpha_channel_),
|
||||||
ui::command_buffer_metrics::ContextType::BROWSER_COMPOSITOR);
|
ws::command_buffer_metrics::ContextType::BROWSER_COMPOSITOR);
|
||||||
auto result = context_provider->BindToCurrentThread();
|
auto result = context_provider->BindToCurrentThread();
|
||||||
LOG_IF(FATAL, result == gpu::ContextResult::kFatalFailure)
|
LOG_IF(FATAL, result == gpu::ContextResult::kFatalFailure)
|
||||||
<< "Fatal error making Gpu context";
|
<< "Fatal error making Gpu context";
|
||||||
@@ -1311,7 +1311,7 @@ void CompositorImpl::DoLowEndBackgroundCleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CompositorImpl::InitializeVizLayerTreeFrameSink(
|
void CompositorImpl::InitializeVizLayerTreeFrameSink(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider) {
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider) {
|
||||||
DCHECK(enable_viz_);
|
DCHECK(enable_viz_);
|
||||||
|
|
||||||
pending_frames_ = 0;
|
pending_frames_ = 0;
|
||||||
|
@@ -199,7 +199,7 @@ class CONTENT_EXPORT CompositorImpl
|
|||||||
|
|
||||||
// Viz specific functions:
|
// Viz specific functions:
|
||||||
void InitializeVizLayerTreeFrameSink(
|
void InitializeVizLayerTreeFrameSink(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider);
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider);
|
||||||
|
|
||||||
viz::FrameSinkId frame_sink_id_;
|
viz::FrameSinkId frame_sink_id_;
|
||||||
|
|
||||||
|
@@ -80,12 +80,12 @@ void StreamTextureProxy::ForwardStreamTextureForSurfaceRequest(
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
scoped_refptr<StreamTextureFactory> StreamTextureFactory::Create(
|
scoped_refptr<StreamTextureFactory> StreamTextureFactory::Create(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider) {
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider) {
|
||||||
return new StreamTextureFactory(std::move(context_provider));
|
return new StreamTextureFactory(std::move(context_provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamTextureFactory::StreamTextureFactory(
|
StreamTextureFactory::StreamTextureFactory(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider)
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider)
|
||||||
: context_provider_(std::move(context_provider)),
|
: context_provider_(std::move(context_provider)),
|
||||||
channel_(context_provider_->GetCommandBufferProxy()->channel()) {
|
channel_(context_provider_->GetCommandBufferProxy()->channel()) {
|
||||||
DCHECK(channel_);
|
DCHECK(channel_);
|
||||||
|
@@ -26,7 +26,7 @@ class GLES2Interface;
|
|||||||
class GpuChannelHost;
|
class GpuChannelHost;
|
||||||
} // namespace gpu
|
} // namespace gpu
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class ContextProviderCommandBuffer;
|
class ContextProviderCommandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class CONTENT_EXPORT StreamTextureFactory
|
|||||||
: public base::RefCounted<StreamTextureFactory> {
|
: public base::RefCounted<StreamTextureFactory> {
|
||||||
public:
|
public:
|
||||||
static scoped_refptr<StreamTextureFactory> Create(
|
static scoped_refptr<StreamTextureFactory> Create(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider);
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider);
|
||||||
|
|
||||||
// Create the StreamTextureProxy object. This internally calls
|
// Create the StreamTextureProxy object. This internally calls
|
||||||
// CreateSteamTexture with the recieved arguments. CreateSteamTexture
|
// CreateSteamTexture with the recieved arguments. CreateSteamTexture
|
||||||
@@ -108,7 +108,7 @@ class CONTENT_EXPORT StreamTextureFactory
|
|||||||
private:
|
private:
|
||||||
friend class base::RefCounted<StreamTextureFactory>;
|
friend class base::RefCounted<StreamTextureFactory>;
|
||||||
StreamTextureFactory(
|
StreamTextureFactory(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider);
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider);
|
||||||
~StreamTextureFactory();
|
~StreamTextureFactory();
|
||||||
// Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the
|
// Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the
|
||||||
// client-side id of the gpu::StreamTexture. The texture is produced into
|
// client-side id of the gpu::StreamTexture. The texture is produced into
|
||||||
@@ -116,7 +116,7 @@ class CONTENT_EXPORT StreamTextureFactory
|
|||||||
unsigned CreateStreamTexture(unsigned* texture_id,
|
unsigned CreateStreamTexture(unsigned* texture_id,
|
||||||
gpu::Mailbox* texture_mailbox);
|
gpu::Mailbox* texture_mailbox);
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider_;
|
||||||
scoped_refptr<gpu::GpuChannelHost> channel_;
|
scoped_refptr<gpu::GpuChannelHost> channel_;
|
||||||
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory);
|
DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory);
|
||||||
|
@@ -57,7 +57,7 @@ GpuVideoAcceleratorFactoriesImpl::Create(
|
|||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
||||||
const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
|
const scoped_refptr<ws::ContextProviderCommandBuffer>& context_provider,
|
||||||
bool enable_video_gpu_memory_buffers,
|
bool enable_video_gpu_memory_buffers,
|
||||||
bool enable_media_stream_gpu_memory_buffers,
|
bool enable_media_stream_gpu_memory_buffers,
|
||||||
bool enable_video_accelerator,
|
bool enable_video_accelerator,
|
||||||
@@ -75,7 +75,7 @@ GpuVideoAcceleratorFactoriesImpl::GpuVideoAcceleratorFactoriesImpl(
|
|||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
||||||
const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
|
const scoped_refptr<ws::ContextProviderCommandBuffer>& context_provider,
|
||||||
bool enable_video_gpu_memory_buffers,
|
bool enable_video_gpu_memory_buffers,
|
||||||
bool enable_media_stream_gpu_memory_buffers,
|
bool enable_media_stream_gpu_memory_buffers,
|
||||||
bool enable_video_accelerator,
|
bool enable_video_accelerator,
|
||||||
@@ -400,7 +400,7 @@ GpuVideoAcceleratorFactoriesImpl::GetVideoEncodeAcceleratorSupportedProfiles() {
|
|||||||
.video_encode_accelerator_supported_profiles);
|
.video_encode_accelerator_supported_profiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>
|
scoped_refptr<ws::ContextProviderCommandBuffer>
|
||||||
GpuVideoAcceleratorFactoriesImpl::GetMediaContextProvider() {
|
GpuVideoAcceleratorFactoriesImpl::GetMediaContextProvider() {
|
||||||
return CheckContextLost() ? nullptr : context_provider_;
|
return CheckContextLost() ? nullptr : context_provider_;
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ class CONTENT_EXPORT GpuVideoAcceleratorFactoriesImpl
|
|||||||
const scoped_refptr<base::SingleThreadTaskRunner>&
|
const scoped_refptr<base::SingleThreadTaskRunner>&
|
||||||
main_thread_task_runner,
|
main_thread_task_runner,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
||||||
const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
|
const scoped_refptr<ws::ContextProviderCommandBuffer>& context_provider,
|
||||||
bool enable_video_gpu_memory_buffers,
|
bool enable_video_gpu_memory_buffers,
|
||||||
bool enable_media_stream_gpu_memory_buffers,
|
bool enable_media_stream_gpu_memory_buffers,
|
||||||
bool enable_video_accelerator,
|
bool enable_video_accelerator,
|
||||||
@@ -114,7 +114,7 @@ class CONTENT_EXPORT GpuVideoAcceleratorFactoriesImpl
|
|||||||
std::vector<media::VideoEncodeAccelerator::SupportedProfile>
|
std::vector<media::VideoEncodeAccelerator::SupportedProfile>
|
||||||
GetVideoEncodeAcceleratorSupportedProfiles() override;
|
GetVideoEncodeAcceleratorSupportedProfiles() override;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> GetMediaContextProvider()
|
scoped_refptr<ws::ContextProviderCommandBuffer> GetMediaContextProvider()
|
||||||
override;
|
override;
|
||||||
|
|
||||||
void SetRenderingColorSpace(const gfx::ColorSpace& color_space) override;
|
void SetRenderingColorSpace(const gfx::ColorSpace& color_space) override;
|
||||||
@@ -132,7 +132,7 @@ class CONTENT_EXPORT GpuVideoAcceleratorFactoriesImpl
|
|||||||
const scoped_refptr<base::SingleThreadTaskRunner>&
|
const scoped_refptr<base::SingleThreadTaskRunner>&
|
||||||
main_thread_task_runner,
|
main_thread_task_runner,
|
||||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
||||||
const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider,
|
const scoped_refptr<ws::ContextProviderCommandBuffer>& context_provider,
|
||||||
bool enable_gpu_memory_buffer_video_frames_for_video,
|
bool enable_gpu_memory_buffer_video_frames_for_video,
|
||||||
bool enable_gpu_memory_buffer_video_frames_for_media_stream,
|
bool enable_gpu_memory_buffer_video_frames_for_media_stream,
|
||||||
bool enable_video_accelerator,
|
bool enable_video_accelerator,
|
||||||
@@ -151,7 +151,7 @@ class CONTENT_EXPORT GpuVideoAcceleratorFactoriesImpl
|
|||||||
// Shared pointer to a shared context provider. It is initially set on main
|
// Shared pointer to a shared context provider. It is initially set on main
|
||||||
// thread, but all subsequent access and destruction should happen only on the
|
// thread, but all subsequent access and destruction should happen only on the
|
||||||
// media thread.
|
// media thread.
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider_;
|
||||||
// Signals if |context_provider_| is alive on the media thread. For use on the
|
// Signals if |context_provider_| is alive on the media thread. For use on the
|
||||||
// main thread.
|
// main thread.
|
||||||
bool context_provider_lost_ = false;
|
bool context_provider_lost_ = false;
|
||||||
|
@@ -102,11 +102,11 @@ class FrameFetchContext : public media::ResourceFetchContext {
|
|||||||
|
|
||||||
void ObtainAndSetContextProvider(
|
void ObtainAndSetContextProvider(
|
||||||
base::OnceCallback<void(bool,
|
base::OnceCallback<void(bool,
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>)>
|
scoped_refptr<ws::ContextProviderCommandBuffer>)>
|
||||||
set_context_provider_callback,
|
set_context_provider_callback,
|
||||||
std::pair<media::GpuVideoAcceleratorFactories*, bool> gpu_info) {
|
std::pair<media::GpuVideoAcceleratorFactories*, bool> gpu_info) {
|
||||||
if (gpu_info.first) {
|
if (gpu_info.first) {
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider =
|
||||||
gpu_info.first->GetMediaContextProvider();
|
gpu_info.first->GetMediaContextProvider();
|
||||||
std::move(set_context_provider_callback)
|
std::move(set_context_provider_callback)
|
||||||
.Run(gpu_info.second, std::move(context_provider));
|
.Run(gpu_info.second, std::move(context_provider));
|
||||||
@@ -122,7 +122,7 @@ void ObtainAndSetContextProvider(
|
|||||||
void PostMediaContextProviderToCallback(
|
void PostMediaContextProviderToCallback(
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
||||||
base::OnceCallback<void(bool,
|
base::OnceCallback<void(bool,
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>)>
|
scoped_refptr<ws::ContextProviderCommandBuffer>)>
|
||||||
set_context_provider_callback) {
|
set_context_provider_callback) {
|
||||||
base::PostTaskAndReplyWithResult(
|
base::PostTaskAndReplyWithResult(
|
||||||
main_task_runner.get(), FROM_HERE, base::BindOnce([]() {
|
main_task_runner.get(), FROM_HERE, base::BindOnce([]() {
|
||||||
|
@@ -51,7 +51,7 @@ scoped_refptr<media::VideoFrame> CopyFrame(
|
|||||||
media::PIXEL_FORMAT_I420, frame->coded_size(), frame->visible_rect(),
|
media::PIXEL_FORMAT_I420, frame->coded_size(), frame->visible_rect(),
|
||||||
frame->natural_size(), frame->timestamp());
|
frame->natural_size(), frame->timestamp());
|
||||||
|
|
||||||
ui::ContextProviderCommandBuffer* const provider =
|
ws::ContextProviderCommandBuffer* const provider =
|
||||||
RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
|
RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
|
||||||
if (!provider) {
|
if (!provider) {
|
||||||
// Return a black frame (yuv = {0, 0x80, 0x80}).
|
// Return a black frame (yuv = {0, 0x80, 0x80}).
|
||||||
|
@@ -268,7 +268,7 @@ void VideoTrackRecorder::Encoder::RetrieveFrameOnMainThread(
|
|||||||
scoped_refptr<media::VideoFrame> frame;
|
scoped_refptr<media::VideoFrame> frame;
|
||||||
|
|
||||||
// |context_provider| is null if the GPU process has crashed or isn't there.
|
// |context_provider| is null if the GPU process has crashed or isn't there.
|
||||||
ui::ContextProviderCommandBuffer* const context_provider =
|
ws::ContextProviderCommandBuffer* const context_provider =
|
||||||
RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
|
RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
|
||||||
if (!context_provider) {
|
if (!context_provider) {
|
||||||
// Send black frames (yuv = {0, 127, 127}).
|
// Send black frames (yuv = {0, 127, 127}).
|
||||||
|
@@ -64,7 +64,7 @@ void MusEmbeddedFrame::SetWindowBounds(
|
|||||||
MusEmbeddedFrame::MusEmbeddedFrame(
|
MusEmbeddedFrame::MusEmbeddedFrame(
|
||||||
RendererWindowTreeClient* renderer_window_tree_client,
|
RendererWindowTreeClient* renderer_window_tree_client,
|
||||||
MusEmbeddedFrameDelegate* delegate,
|
MusEmbeddedFrameDelegate* delegate,
|
||||||
ui::ClientSpecificId window_id,
|
ws::ClientSpecificId window_id,
|
||||||
const base::UnguessableToken& token)
|
const base::UnguessableToken& token)
|
||||||
: renderer_window_tree_client_(renderer_window_tree_client),
|
: renderer_window_tree_client_(renderer_window_tree_client),
|
||||||
delegate_(delegate),
|
delegate_(delegate),
|
||||||
|
@@ -52,7 +52,7 @@ class MusEmbeddedFrame {
|
|||||||
|
|
||||||
MusEmbeddedFrame(RendererWindowTreeClient* renderer_window_tree_client,
|
MusEmbeddedFrame(RendererWindowTreeClient* renderer_window_tree_client,
|
||||||
MusEmbeddedFrameDelegate* delegate,
|
MusEmbeddedFrameDelegate* delegate,
|
||||||
ui::ClientSpecificId window_id,
|
ws::ClientSpecificId window_id,
|
||||||
const base::UnguessableToken& token);
|
const base::UnguessableToken& token);
|
||||||
|
|
||||||
// Called once the WindowTree has been obtained. This is only called if
|
// Called once the WindowTree has been obtained. This is only called if
|
||||||
@@ -72,7 +72,7 @@ class MusEmbeddedFrame {
|
|||||||
|
|
||||||
RendererWindowTreeClient* renderer_window_tree_client_;
|
RendererWindowTreeClient* renderer_window_tree_client_;
|
||||||
MusEmbeddedFrameDelegate* delegate_;
|
MusEmbeddedFrameDelegate* delegate_;
|
||||||
const ui::ClientSpecificId window_id_;
|
const ws::ClientSpecificId window_id_;
|
||||||
|
|
||||||
std::unique_ptr<PendingState> pending_state_;
|
std::unique_ptr<PendingState> pending_state_;
|
||||||
|
|
||||||
|
@@ -191,7 +191,7 @@ void RendererWindowTreeClient::OnEmbed(
|
|||||||
ws::mojom::WindowDataPtr root,
|
ws::mojom::WindowDataPtr root,
|
||||||
ws::mojom::WindowTreePtr tree,
|
ws::mojom::WindowTreePtr tree,
|
||||||
int64_t display_id,
|
int64_t display_id,
|
||||||
ui::Id focused_window_id,
|
ws::Id focused_window_id,
|
||||||
bool drawn,
|
bool drawn,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_surface_id) {
|
const base::Optional<viz::LocalSurfaceId>& local_surface_id) {
|
||||||
const bool is_reembed = tree_.is_bound();
|
const bool is_reembed = tree_.is_bound();
|
||||||
@@ -220,20 +220,20 @@ void RendererWindowTreeClient::OnEmbed(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnEmbeddedAppDisconnected(ui::Id window_id) {
|
void RendererWindowTreeClient::OnEmbeddedAppDisconnected(ws::Id window_id) {
|
||||||
// TODO(sad): Embedded mus-client (oopif) is gone. Figure out what to do.
|
// TODO(sad): Embedded mus-client (oopif) is gone. Figure out what to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnUnembed(ui::Id window_id) {
|
void RendererWindowTreeClient::OnUnembed(ws::Id window_id) {
|
||||||
// At this point all operations will fail. We don't delete this as it would
|
// At this point all operations will fail. We don't delete this as it would
|
||||||
// mean all consumers have to null check (as would MusEmbeddedFrames).
|
// mean all consumers have to null check (as would MusEmbeddedFrames).
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnCaptureChanged(ui::Id new_capture_window_id,
|
void RendererWindowTreeClient::OnCaptureChanged(ws::Id new_capture_window_id,
|
||||||
ui::Id old_capture_window_id) {}
|
ws::Id old_capture_window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnFrameSinkIdAllocated(
|
void RendererWindowTreeClient::OnFrameSinkIdAllocated(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const viz::FrameSinkId& frame_sink_id) {
|
const viz::FrameSinkId& frame_sink_id) {
|
||||||
// When mus is not hosting viz FrameSinkIds come from the browser, so we
|
// When mus is not hosting viz FrameSinkIds come from the browser, so we
|
||||||
// ignore them here.
|
// ignore them here.
|
||||||
@@ -259,57 +259,57 @@ void RendererWindowTreeClient::OnTopLevelCreated(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowBoundsChanged(
|
void RendererWindowTreeClient::OnWindowBoundsChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const gfx::Rect& old_bounds,
|
const gfx::Rect& old_bounds,
|
||||||
const gfx::Rect& new_bounds,
|
const gfx::Rect& new_bounds,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_surface_id) {}
|
const base::Optional<viz::LocalSurfaceId>& local_surface_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowTransformChanged(
|
void RendererWindowTreeClient::OnWindowTransformChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const gfx::Transform& old_transform,
|
const gfx::Transform& old_transform,
|
||||||
const gfx::Transform& new_transform) {}
|
const gfx::Transform& new_transform) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnTransientWindowAdded(
|
void RendererWindowTreeClient::OnTransientWindowAdded(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
ui::Id transient_window_id) {}
|
ws::Id transient_window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnTransientWindowRemoved(
|
void RendererWindowTreeClient::OnTransientWindowRemoved(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
ui::Id transient_window_id) {}
|
ws::Id transient_window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowHierarchyChanged(
|
void RendererWindowTreeClient::OnWindowHierarchyChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
ui::Id old_parent_id,
|
ws::Id old_parent_id,
|
||||||
ui::Id new_parent_id,
|
ws::Id new_parent_id,
|
||||||
std::vector<ws::mojom::WindowDataPtr> windows) {}
|
std::vector<ws::mojom::WindowDataPtr> windows) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowReordered(
|
void RendererWindowTreeClient::OnWindowReordered(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
ui::Id relative_window_id,
|
ws::Id relative_window_id,
|
||||||
ws::mojom::OrderDirection direction) {}
|
ws::mojom::OrderDirection direction) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowDeleted(ui::Id window_id) {
|
void RendererWindowTreeClient::OnWindowDeleted(ws::Id window_id) {
|
||||||
// See comments on OnUnembed() for why we do nothing here.
|
// See comments on OnUnembed() for why we do nothing here.
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowVisibilityChanged(ui::Id window_id,
|
void RendererWindowTreeClient::OnWindowVisibilityChanged(ws::Id window_id,
|
||||||
bool visible) {}
|
bool visible) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowOpacityChanged(ui::Id window_id,
|
void RendererWindowTreeClient::OnWindowOpacityChanged(ws::Id window_id,
|
||||||
float old_opacity,
|
float old_opacity,
|
||||||
float new_opacity) {}
|
float new_opacity) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowParentDrawnStateChanged(ui::Id window_id,
|
void RendererWindowTreeClient::OnWindowParentDrawnStateChanged(ws::Id window_id,
|
||||||
bool drawn) {}
|
bool drawn) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowSharedPropertyChanged(
|
void RendererWindowTreeClient::OnWindowSharedPropertyChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const base::Optional<std::vector<uint8_t>>& new_data) {}
|
const base::Optional<std::vector<uint8_t>>& new_data) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowInputEvent(
|
void RendererWindowTreeClient::OnWindowInputEvent(
|
||||||
uint32_t event_id,
|
uint32_t event_id,
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
int64_t display_id,
|
int64_t display_id,
|
||||||
std::unique_ptr<ui::Event> event,
|
std::unique_ptr<ui::Event> event,
|
||||||
bool matches_pointer_watcher) {
|
bool matches_pointer_watcher) {
|
||||||
@@ -318,18 +318,18 @@ void RendererWindowTreeClient::OnWindowInputEvent(
|
|||||||
|
|
||||||
void RendererWindowTreeClient::OnPointerEventObserved(
|
void RendererWindowTreeClient::OnPointerEventObserved(
|
||||||
std::unique_ptr<ui::Event> event,
|
std::unique_ptr<ui::Event> event,
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
int64_t display_id) {
|
int64_t display_id) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowFocused(ui::Id focused_window_id) {}
|
void RendererWindowTreeClient::OnWindowFocused(ws::Id focused_window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowCursorChanged(ui::Id window_id,
|
void RendererWindowTreeClient::OnWindowCursorChanged(ws::Id window_id,
|
||||||
ui::CursorData cursor) {}
|
ui::CursorData cursor) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnWindowSurfaceChanged(
|
void RendererWindowTreeClient::OnWindowSurfaceChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const viz::SurfaceInfo& surface_info) {
|
const viz::SurfaceInfo& surface_info) {
|
||||||
DCHECK(features::IsUsingWindowService());
|
DCHECK(features::IsUsingWindowService());
|
||||||
for (MusEmbeddedFrame* embedded_frame : embedded_frames_) {
|
for (MusEmbeddedFrame* embedded_frame : embedded_frames_) {
|
||||||
@@ -343,21 +343,21 @@ void RendererWindowTreeClient::OnWindowSurfaceChanged(
|
|||||||
void RendererWindowTreeClient::OnDragDropStart(
|
void RendererWindowTreeClient::OnDragDropStart(
|
||||||
const base::flat_map<std::string, std::vector<uint8_t>>& mime_data) {}
|
const base::flat_map<std::string, std::vector<uint8_t>>& mime_data) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnDragEnter(ui::Id window_id,
|
void RendererWindowTreeClient::OnDragEnter(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
OnDragEnterCallback callback) {}
|
OnDragEnterCallback callback) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnDragOver(ui::Id window_id,
|
void RendererWindowTreeClient::OnDragOver(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
OnDragOverCallback callback) {}
|
OnDragOverCallback callback) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnDragLeave(ui::Id window_id) {}
|
void RendererWindowTreeClient::OnDragLeave(ws::Id window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnCompleteDrop(ui::Id window_id,
|
void RendererWindowTreeClient::OnCompleteDrop(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
@@ -372,7 +372,7 @@ void RendererWindowTreeClient::OnPerformDragDropCompleted(
|
|||||||
void RendererWindowTreeClient::OnDragDropDone() {}
|
void RendererWindowTreeClient::OnDragDropDone() {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnTopmostWindowChanged(
|
void RendererWindowTreeClient::OnTopmostWindowChanged(
|
||||||
const std::vector<ui::Id>& topmost_ids) {}
|
const std::vector<ws::Id>& topmost_ids) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id,
|
void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id,
|
||||||
bool success) {
|
bool success) {
|
||||||
@@ -382,7 +382,7 @@ void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id,
|
|||||||
// controls the visibility of the root frame).
|
// controls the visibility of the root frame).
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererWindowTreeClient::RequestClose(ui::Id window_id) {}
|
void RendererWindowTreeClient::RequestClose(ws::Id window_id) {}
|
||||||
|
|
||||||
void RendererWindowTreeClient::GetScreenProviderObserver(
|
void RendererWindowTreeClient::GetScreenProviderObserver(
|
||||||
ws::mojom::ScreenProviderObserverAssociatedRequest observer) {}
|
ws::mojom::ScreenProviderObserverAssociatedRequest observer) {}
|
||||||
|
@@ -114,7 +114,7 @@ class RendererWindowTreeClient : public ws::mojom::WindowTreeClient,
|
|||||||
ws::mojom::WindowDataPtr root,
|
ws::mojom::WindowDataPtr root,
|
||||||
ws::mojom::WindowTreePtr tree,
|
ws::mojom::WindowTreePtr tree,
|
||||||
int64_t display_id,
|
int64_t display_id,
|
||||||
ui::Id focused_window_id,
|
ws::Id focused_window_id,
|
||||||
bool drawn,
|
bool drawn,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
||||||
void OnEmbedFromToken(
|
void OnEmbedFromToken(
|
||||||
@@ -122,11 +122,11 @@ class RendererWindowTreeClient : public ws::mojom::WindowTreeClient,
|
|||||||
ws::mojom::WindowDataPtr root,
|
ws::mojom::WindowDataPtr root,
|
||||||
int64_t display_id,
|
int64_t display_id,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
||||||
void OnEmbeddedAppDisconnected(ui::Id window_id) override;
|
void OnEmbeddedAppDisconnected(ws::Id window_id) override;
|
||||||
void OnUnembed(ui::Id window_id) override;
|
void OnUnembed(ws::Id window_id) override;
|
||||||
void OnCaptureChanged(ui::Id new_capture_window_id,
|
void OnCaptureChanged(ws::Id new_capture_window_id,
|
||||||
ui::Id old_capture_window_id) override;
|
ws::Id old_capture_window_id) override;
|
||||||
void OnFrameSinkIdAllocated(ui::Id window_id,
|
void OnFrameSinkIdAllocated(ws::Id window_id,
|
||||||
const viz::FrameSinkId& frame_sink_id) override;
|
const viz::FrameSinkId& frame_sink_id) override;
|
||||||
void OnTopLevelCreated(
|
void OnTopLevelCreated(
|
||||||
uint32_t change_id,
|
uint32_t change_id,
|
||||||
@@ -135,62 +135,61 @@ class RendererWindowTreeClient : public ws::mojom::WindowTreeClient,
|
|||||||
bool drawn,
|
bool drawn,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
const base::Optional<viz::LocalSurfaceId>& local_surface_id) override;
|
||||||
void OnWindowBoundsChanged(
|
void OnWindowBoundsChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const gfx::Rect& old_bounds,
|
const gfx::Rect& old_bounds,
|
||||||
const gfx::Rect& new_bounds,
|
const gfx::Rect& new_bounds,
|
||||||
const base::Optional<viz::LocalSurfaceId>& local_frame_id) override;
|
const base::Optional<viz::LocalSurfaceId>& local_frame_id) override;
|
||||||
void OnWindowTransformChanged(ui::Id window_id,
|
void OnWindowTransformChanged(ws::Id window_id,
|
||||||
const gfx::Transform& old_transform,
|
const gfx::Transform& old_transform,
|
||||||
const gfx::Transform& new_transform) override;
|
const gfx::Transform& new_transform) override;
|
||||||
void OnTransientWindowAdded(ui::Id window_id,
|
void OnTransientWindowAdded(ws::Id window_id,
|
||||||
ui::Id transient_window_id) override;
|
ws::Id transient_window_id) override;
|
||||||
void OnTransientWindowRemoved(ui::Id window_id,
|
void OnTransientWindowRemoved(ws::Id window_id,
|
||||||
ui::Id transient_window_id) override;
|
ws::Id transient_window_id) override;
|
||||||
void OnWindowHierarchyChanged(
|
void OnWindowHierarchyChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
ui::Id old_parent_id,
|
ws::Id old_parent_id,
|
||||||
ui::Id new_parent_id,
|
ws::Id new_parent_id,
|
||||||
std::vector<ws::mojom::WindowDataPtr> windows) override;
|
std::vector<ws::mojom::WindowDataPtr> windows) override;
|
||||||
void OnWindowReordered(ui::Id window_id,
|
void OnWindowReordered(ws::Id window_id,
|
||||||
ui::Id relative_window_id,
|
ws::Id relative_window_id,
|
||||||
ws::mojom::OrderDirection direction) override;
|
ws::mojom::OrderDirection direction) override;
|
||||||
void OnWindowDeleted(ui::Id window_id) override;
|
void OnWindowDeleted(ws::Id window_id) override;
|
||||||
void OnWindowVisibilityChanged(ui::Id window_id, bool visible) override;
|
void OnWindowVisibilityChanged(ws::Id window_id, bool visible) override;
|
||||||
void OnWindowOpacityChanged(ui::Id window_id,
|
void OnWindowOpacityChanged(ws::Id window_id,
|
||||||
float old_opacity,
|
float old_opacity,
|
||||||
float new_opacity) override;
|
float new_opacity) override;
|
||||||
void OnWindowParentDrawnStateChanged(ui::Id window_id, bool drawn) override;
|
void OnWindowParentDrawnStateChanged(ws::Id window_id, bool drawn) override;
|
||||||
void OnWindowSharedPropertyChanged(
|
void OnWindowSharedPropertyChanged(
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const base::Optional<std::vector<uint8_t>>& new_data) override;
|
const base::Optional<std::vector<uint8_t>>& new_data) override;
|
||||||
void OnWindowInputEvent(
|
void OnWindowInputEvent(uint32_t event_id,
|
||||||
uint32_t event_id,
|
ws::Id window_id,
|
||||||
ui::Id window_id,
|
int64_t display_id,
|
||||||
int64_t display_id,
|
std::unique_ptr<ui::Event> event,
|
||||||
std::unique_ptr<ui::Event> event,
|
bool matches_pointer_watcher) override;
|
||||||
bool matches_pointer_watcher) override;
|
|
||||||
void OnPointerEventObserved(std::unique_ptr<ui::Event> event,
|
void OnPointerEventObserved(std::unique_ptr<ui::Event> event,
|
||||||
ui::Id window_id,
|
ws::Id window_id,
|
||||||
int64_t display_id) override;
|
int64_t display_id) override;
|
||||||
void OnWindowFocused(ui::Id focused_window_id) override;
|
void OnWindowFocused(ws::Id focused_window_id) override;
|
||||||
void OnWindowCursorChanged(ui::Id window_id, ui::CursorData cursor) override;
|
void OnWindowCursorChanged(ws::Id window_id, ui::CursorData cursor) override;
|
||||||
void OnWindowSurfaceChanged(ui::Id window_id,
|
void OnWindowSurfaceChanged(ws::Id window_id,
|
||||||
const viz::SurfaceInfo& surface_info) override;
|
const viz::SurfaceInfo& surface_info) override;
|
||||||
void OnDragDropStart(const base::flat_map<std::string, std::vector<uint8_t>>&
|
void OnDragDropStart(const base::flat_map<std::string, std::vector<uint8_t>>&
|
||||||
mime_data) override;
|
mime_data) override;
|
||||||
void OnDragEnter(ui::Id window_id,
|
void OnDragEnter(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
OnDragEnterCallback callback) override;
|
OnDragEnterCallback callback) override;
|
||||||
void OnDragOver(ui::Id window_id,
|
void OnDragOver(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
OnDragOverCallback callback) override;
|
OnDragOverCallback callback) override;
|
||||||
void OnDragLeave(ui::Id window_id) override;
|
void OnDragLeave(ws::Id window_id) override;
|
||||||
void OnCompleteDrop(ui::Id window_id,
|
void OnCompleteDrop(ws::Id window_id,
|
||||||
uint32_t event_flags,
|
uint32_t event_flags,
|
||||||
const gfx::Point& position,
|
const gfx::Point& position,
|
||||||
uint32_t effect_bitmask,
|
uint32_t effect_bitmask,
|
||||||
@@ -199,14 +198,14 @@ class RendererWindowTreeClient : public ws::mojom::WindowTreeClient,
|
|||||||
bool success,
|
bool success,
|
||||||
uint32_t action_taken) override;
|
uint32_t action_taken) override;
|
||||||
void OnDragDropDone() override;
|
void OnDragDropDone() override;
|
||||||
void OnTopmostWindowChanged(const std::vector<ui::Id>& topmost_ids) override;
|
void OnTopmostWindowChanged(const std::vector<ws::Id>& topmost_ids) override;
|
||||||
void OnChangeCompleted(uint32_t change_id, bool success) override;
|
void OnChangeCompleted(uint32_t change_id, bool success) override;
|
||||||
void RequestClose(ui::Id window_id) override;
|
void RequestClose(ws::Id window_id) override;
|
||||||
void GetScreenProviderObserver(
|
void GetScreenProviderObserver(
|
||||||
ws::mojom::ScreenProviderObserverAssociatedRequest observer) override;
|
ws::mojom::ScreenProviderObserverAssociatedRequest observer) override;
|
||||||
|
|
||||||
const int routing_id_;
|
const int routing_id_;
|
||||||
ui::Id root_window_id_ = 0u;
|
ws::Id root_window_id_ = 0u;
|
||||||
bool visible_ = false;
|
bool visible_ = false;
|
||||||
scoped_refptr<viz::ContextProvider> pending_context_provider_;
|
scoped_refptr<viz::ContextProvider> pending_context_provider_;
|
||||||
gpu::GpuMemoryBufferManager* pending_gpu_memory_buffer_manager_ = nullptr;
|
gpu::GpuMemoryBufferManager* pending_gpu_memory_buffer_manager_ = nullptr;
|
||||||
@@ -215,7 +214,7 @@ class RendererWindowTreeClient : public ws::mojom::WindowTreeClient,
|
|||||||
mojo::Binding<ws::mojom::WindowTreeClient> binding_;
|
mojo::Binding<ws::mojom::WindowTreeClient> binding_;
|
||||||
mojo::Binding<mojom::RenderWidgetWindowTreeClient>
|
mojo::Binding<mojom::RenderWidgetWindowTreeClient>
|
||||||
render_widget_window_tree_client_binding_;
|
render_widget_window_tree_client_binding_;
|
||||||
ui::ClientSpecificId next_window_id_ = 0;
|
ws::ClientSpecificId next_window_id_ = 0;
|
||||||
uint32_t next_change_id_ = 0;
|
uint32_t next_change_id_ = 0;
|
||||||
|
|
||||||
// Set of MusEmbeddedFrames. They are owned by the corresponding
|
// Set of MusEmbeddedFrames. They are owned by the corresponding
|
||||||
|
@@ -60,7 +60,7 @@ bool IsCodecSupported(media::VideoCodec codec) {
|
|||||||
// YUV->RGB converter class using a shader and FBO.
|
// YUV->RGB converter class using a shader and FBO.
|
||||||
class VideoDecoderShim::YUVConverter {
|
class VideoDecoderShim::YUVConverter {
|
||||||
public:
|
public:
|
||||||
YUVConverter(scoped_refptr<ui::ContextProviderCommandBuffer>);
|
YUVConverter(scoped_refptr<ws::ContextProviderCommandBuffer>);
|
||||||
~YUVConverter();
|
~YUVConverter();
|
||||||
bool Initialize();
|
bool Initialize();
|
||||||
void Convert(const scoped_refptr<media::VideoFrame>& frame, GLuint tex_out);
|
void Convert(const scoped_refptr<media::VideoFrame>& frame, GLuint tex_out);
|
||||||
@@ -71,7 +71,7 @@ class VideoDecoderShim::YUVConverter {
|
|||||||
GLuint CreateProgram(const char* name, GLuint vshader, GLuint fshader);
|
GLuint CreateProgram(const char* name, GLuint vshader, GLuint fshader);
|
||||||
GLuint CreateTexture();
|
GLuint CreateTexture();
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider_;
|
||||||
gpu::gles2::GLES2Interface* gl_;
|
gpu::gles2::GLES2Interface* gl_;
|
||||||
GLuint frame_buffer_;
|
GLuint frame_buffer_;
|
||||||
GLuint vertex_buffer_;
|
GLuint vertex_buffer_;
|
||||||
@@ -101,7 +101,7 @@ class VideoDecoderShim::YUVConverter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
VideoDecoderShim::YUVConverter::YUVConverter(
|
VideoDecoderShim::YUVConverter::YUVConverter(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider)
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider)
|
||||||
: context_provider_(std::move(context_provider)),
|
: context_provider_(std::move(context_provider)),
|
||||||
gl_(context_provider_->ContextGL()),
|
gl_(context_provider_->ContextGL()),
|
||||||
frame_buffer_(0),
|
frame_buffer_(0),
|
||||||
|
@@ -22,7 +22,7 @@ namespace base {
|
|||||||
class SingleThreadTaskRunner;
|
class SingleThreadTaskRunner;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class ContextProviderCommandBuffer;
|
class ContextProviderCommandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ class VideoDecoderShim : public media::VideoDecodeAccelerator {
|
|||||||
|
|
||||||
PepperVideoDecoderHost* host_;
|
PepperVideoDecoderHost* host_;
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
|
scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider_;
|
||||||
|
|
||||||
// The current decoded frame size.
|
// The current decoded frame size.
|
||||||
gfx::Size texture_size_;
|
gfx::Size texture_size_;
|
||||||
|
@@ -329,7 +329,7 @@ void CreateFrameFactory(mojom::FrameFactoryRequest request,
|
|||||||
std::move(request));
|
std::move(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> CreateOffscreenContext(
|
scoped_refptr<ws::ContextProviderCommandBuffer> CreateOffscreenContext(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
|
||||||
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
||||||
const gpu::SharedMemoryLimits& limits,
|
const gpu::SharedMemoryLimits& limits,
|
||||||
@@ -338,7 +338,7 @@ scoped_refptr<ui::ContextProviderCommandBuffer> CreateOffscreenContext(
|
|||||||
bool support_raster_interface,
|
bool support_raster_interface,
|
||||||
bool support_oop_rasterization,
|
bool support_oop_rasterization,
|
||||||
bool support_grcontext,
|
bool support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType type,
|
ws::command_buffer_metrics::ContextType type,
|
||||||
int32_t stream_id,
|
int32_t stream_id,
|
||||||
gpu::SchedulingPriority stream_priority) {
|
gpu::SchedulingPriority stream_priority) {
|
||||||
DCHECK(gpu_channel_host);
|
DCHECK(gpu_channel_host);
|
||||||
@@ -365,11 +365,11 @@ scoped_refptr<ui::ContextProviderCommandBuffer> CreateOffscreenContext(
|
|||||||
!support_gles2_interface;
|
!support_gles2_interface;
|
||||||
|
|
||||||
const bool automatic_flushes = false;
|
const bool automatic_flushes = false;
|
||||||
return base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
return base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), gpu_memory_buffer_manager, stream_id,
|
std::move(gpu_channel_host), gpu_memory_buffer_manager, stream_id,
|
||||||
stream_priority, gpu::kNullSurfaceHandle,
|
stream_priority, gpu::kNullSurfaceHandle,
|
||||||
GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext/" +
|
GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext/" +
|
||||||
ui::command_buffer_metrics::ContextTypeToString(type)),
|
ws::command_buffer_metrics::ContextTypeToString(type)),
|
||||||
automatic_flushes, support_locking, support_grcontext, limits, attributes,
|
automatic_flushes, support_locking, support_grcontext, limits, attributes,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
@@ -744,7 +744,7 @@ void RenderThreadImpl::Init() {
|
|||||||
base::BindRepeating(&CreateSingleSampleMetricsProvider,
|
base::BindRepeating(&CreateSingleSampleMetricsProvider,
|
||||||
main_thread_runner(), GetConnector()));
|
main_thread_runner(), GetConnector()));
|
||||||
|
|
||||||
gpu_ = ui::Gpu::Create(GetConnector(),
|
gpu_ = ws::Gpu::Create(GetConnector(),
|
||||||
features::IsUsingWindowService()
|
features::IsUsingWindowService()
|
||||||
? ws::mojom::kServiceName
|
? ws::mojom::kServiceName
|
||||||
: mojom::kBrowserServiceName,
|
: mojom::kBrowserServiceName,
|
||||||
@@ -1393,12 +1393,12 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() {
|
|||||||
bool support_raster_interface = false;
|
bool support_raster_interface = false;
|
||||||
bool support_oop_rasterization = false;
|
bool support_oop_rasterization = false;
|
||||||
bool support_grcontext = false;
|
bool support_grcontext = false;
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> media_context_provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> media_context_provider =
|
||||||
CreateOffscreenContext(gpu_channel_host, GetGpuMemoryBufferManager(),
|
CreateOffscreenContext(gpu_channel_host, GetGpuMemoryBufferManager(),
|
||||||
limits, support_locking, support_gles2_interface,
|
limits, support_locking, support_gles2_interface,
|
||||||
support_raster_interface,
|
support_raster_interface,
|
||||||
support_oop_rasterization, support_grcontext,
|
support_oop_rasterization, support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::MEDIA,
|
ws::command_buffer_metrics::ContextType::MEDIA,
|
||||||
kGpuStreamIdMedia, kGpuStreamPriorityMedia);
|
kGpuStreamIdMedia, kGpuStreamPriorityMedia);
|
||||||
|
|
||||||
const bool enable_video_accelerator =
|
const bool enable_video_accelerator =
|
||||||
@@ -1437,7 +1437,7 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() {
|
|||||||
return gpu_factories_.back().get();
|
return gpu_factories_.back().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>
|
scoped_refptr<ws::ContextProviderCommandBuffer>
|
||||||
RenderThreadImpl::SharedMainThreadContextProvider() {
|
RenderThreadImpl::SharedMainThreadContextProvider() {
|
||||||
DCHECK(IsMainThread());
|
DCHECK(IsMainThread());
|
||||||
if (shared_main_thread_contexts_ &&
|
if (shared_main_thread_contexts_ &&
|
||||||
@@ -1461,7 +1461,7 @@ RenderThreadImpl::SharedMainThreadContextProvider() {
|
|||||||
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
||||||
gpu::SharedMemoryLimits(), support_locking, support_gles2_interface,
|
gpu::SharedMemoryLimits(), support_locking, support_gles2_interface,
|
||||||
support_raster_interface, support_oop_rasterization, support_grcontext,
|
support_raster_interface, support_oop_rasterization, support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::RENDERER_MAIN_THREAD,
|
ws::command_buffer_metrics::ContextType::RENDERER_MAIN_THREAD,
|
||||||
kGpuStreamIdDefault, kGpuStreamPriorityDefault);
|
kGpuStreamIdDefault, kGpuStreamPriorityDefault);
|
||||||
auto result = shared_main_thread_contexts_->BindToCurrentThread();
|
auto result = shared_main_thread_contexts_->BindToCurrentThread();
|
||||||
if (result != gpu::ContextResult::kSuccess)
|
if (result != gpu::ContextResult::kSuccess)
|
||||||
@@ -1476,7 +1476,7 @@ scoped_refptr<StreamTextureFactory> RenderThreadImpl::GetStreamTexureFactory() {
|
|||||||
if (!stream_texture_factory_.get() ||
|
if (!stream_texture_factory_.get() ||
|
||||||
stream_texture_factory_->ContextGL()->GetGraphicsResetStatusKHR() !=
|
stream_texture_factory_->ContextGL()->GetGraphicsResetStatusKHR() !=
|
||||||
GL_NO_ERROR) {
|
GL_NO_ERROR) {
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> shared_context_provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> shared_context_provider =
|
||||||
SharedMainThreadContextProvider();
|
SharedMainThreadContextProvider();
|
||||||
if (!shared_context_provider) {
|
if (!shared_context_provider) {
|
||||||
stream_texture_factory_ = nullptr;
|
stream_texture_factory_ = nullptr;
|
||||||
@@ -2027,13 +2027,13 @@ void RenderThreadImpl::RequestNewLayerTreeFrameSink(
|
|||||||
constexpr bool support_locking = false;
|
constexpr bool support_locking = false;
|
||||||
constexpr bool support_grcontext = true;
|
constexpr bool support_grcontext = true;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> context_provider(
|
scoped_refptr<ws::ContextProviderCommandBuffer> context_provider(
|
||||||
new ui::ContextProviderCommandBuffer(
|
new ws::ContextProviderCommandBuffer(
|
||||||
gpu_channel_host, GetGpuMemoryBufferManager(), kGpuStreamIdDefault,
|
gpu_channel_host, GetGpuMemoryBufferManager(), kGpuStreamIdDefault,
|
||||||
kGpuStreamPriorityDefault, gpu::kNullSurfaceHandle, url,
|
kGpuStreamPriorityDefault, gpu::kNullSurfaceHandle, url,
|
||||||
automatic_flushes, support_locking, support_grcontext, limits,
|
automatic_flushes, support_locking, support_grcontext, limits,
|
||||||
attributes,
|
attributes,
|
||||||
ui::command_buffer_metrics::ContextType::RENDER_COMPOSITOR));
|
ws::command_buffer_metrics::ContextType::RENDER_COMPOSITOR));
|
||||||
|
|
||||||
if (layout_test_deps_) {
|
if (layout_test_deps_) {
|
||||||
if (!layout_test_deps_->UseDisplayCompositorPixelDump()) {
|
if (!layout_test_deps_->UseDisplayCompositorPixelDump()) {
|
||||||
@@ -2348,7 +2348,7 @@ RenderThreadImpl::SharedCompositorWorkerContextProvider() {
|
|||||||
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
|
||||||
shared_memory_limits, support_locking, support_gles2_interface,
|
shared_memory_limits, support_locking, support_gles2_interface,
|
||||||
support_raster_interface, support_oop_rasterization, support_grcontext,
|
support_raster_interface, support_oop_rasterization, support_grcontext,
|
||||||
ui::command_buffer_metrics::ContextType::RENDER_WORKER,
|
ws::command_buffer_metrics::ContextType::RENDER_WORKER,
|
||||||
kGpuStreamIdWorker, kGpuStreamPriorityWorker);
|
kGpuStreamIdWorker, kGpuStreamPriorityWorker);
|
||||||
auto result = shared_worker_context_provider_->BindToCurrentThread();
|
auto result = shared_worker_context_provider_->BindToCurrentThread();
|
||||||
if (result != gpu::ContextResult::kSuccess)
|
if (result != gpu::ContextResult::kSuccess)
|
||||||
|
@@ -105,11 +105,6 @@ namespace media {
|
|||||||
class GpuVideoAcceleratorFactories;
|
class GpuVideoAcceleratorFactories;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class ContextProviderCommandBuffer;
|
|
||||||
class Gpu;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
class Extension;
|
class Extension;
|
||||||
}
|
}
|
||||||
@@ -120,6 +115,11 @@ class RasterContextProvider;
|
|||||||
class SyntheticBeginFrameSource;
|
class SyntheticBeginFrameSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class ContextProviderCommandBuffer;
|
||||||
|
class Gpu;
|
||||||
|
} // namespace ws
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
class AppCacheDispatcher;
|
class AppCacheDispatcher;
|
||||||
@@ -404,7 +404,7 @@ class CONTENT_EXPORT RenderThreadImpl
|
|||||||
|
|
||||||
media::GpuVideoAcceleratorFactories* GetGpuFactories();
|
media::GpuVideoAcceleratorFactories* GetGpuFactories();
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer>
|
scoped_refptr<ws::ContextProviderCommandBuffer>
|
||||||
SharedMainThreadContextProvider();
|
SharedMainThreadContextProvider();
|
||||||
|
|
||||||
// AudioRendererMixerManager instance which manages renderer side mixer
|
// AudioRendererMixerManager instance which manages renderer side mixer
|
||||||
@@ -683,7 +683,7 @@ class CONTENT_EXPORT RenderThreadImpl
|
|||||||
scoped_refptr<StreamTextureFactory> stream_texture_factory_;
|
scoped_refptr<StreamTextureFactory> stream_texture_factory_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> shared_main_thread_contexts_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> shared_main_thread_contexts_;
|
||||||
|
|
||||||
base::ObserverList<RenderThreadObserver>::Unchecked observers_;
|
base::ObserverList<RenderThreadObserver>::Unchecked observers_;
|
||||||
|
|
||||||
@@ -699,7 +699,7 @@ class CONTENT_EXPORT RenderThreadImpl
|
|||||||
// memory saving mode.
|
// memory saving mode.
|
||||||
std::unique_ptr<LowMemoryModeController> low_memory_mode_controller_;
|
std::unique_ptr<LowMemoryModeController> low_memory_mode_controller_;
|
||||||
|
|
||||||
std::unique_ptr<ui::Gpu> gpu_;
|
std::unique_ptr<ws::Gpu> gpu_;
|
||||||
|
|
||||||
scoped_refptr<base::SingleThreadTaskRunner>
|
scoped_refptr<base::SingleThreadTaskRunner>
|
||||||
main_thread_compositor_task_runner_;
|
main_thread_compositor_task_runner_;
|
||||||
|
@@ -1048,15 +1048,15 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider(
|
|||||||
constexpr bool automatic_flushes = true;
|
constexpr bool automatic_flushes = true;
|
||||||
constexpr bool support_locking = false;
|
constexpr bool support_locking = false;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider(
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider(
|
||||||
new ui::ContextProviderCommandBuffer(
|
new ws::ContextProviderCommandBuffer(
|
||||||
std::move(gpu_channel_host),
|
std::move(gpu_channel_host),
|
||||||
RenderThreadImpl::current()->GetGpuMemoryBufferManager(),
|
RenderThreadImpl::current()->GetGpuMemoryBufferManager(),
|
||||||
kGpuStreamIdDefault, kGpuStreamPriorityDefault,
|
kGpuStreamIdDefault, kGpuStreamPriorityDefault,
|
||||||
gpu::kNullSurfaceHandle, GURL(top_document_web_url),
|
gpu::kNullSurfaceHandle, GURL(top_document_web_url),
|
||||||
automatic_flushes, support_locking, web_attributes.support_grcontext,
|
automatic_flushes, support_locking, web_attributes.support_grcontext,
|
||||||
gpu::SharedMemoryLimits(), attributes,
|
gpu::SharedMemoryLimits(), attributes,
|
||||||
ui::command_buffer_metrics::ContextType::WEBGL));
|
ws::command_buffer_metrics::ContextType::WEBGL));
|
||||||
return std::make_unique<WebGraphicsContext3DProviderImpl>(
|
return std::make_unique<WebGraphicsContext3DProviderImpl>(
|
||||||
std::move(provider));
|
std::move(provider));
|
||||||
}
|
}
|
||||||
@@ -1067,7 +1067,7 @@ std::unique_ptr<blink::WebGraphicsContext3DProvider>
|
|||||||
RendererBlinkPlatformImpl::CreateSharedOffscreenGraphicsContext3DProvider() {
|
RendererBlinkPlatformImpl::CreateSharedOffscreenGraphicsContext3DProvider() {
|
||||||
auto* thread = RenderThreadImpl::current();
|
auto* thread = RenderThreadImpl::current();
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider =
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider =
|
||||||
thread->SharedMainThreadContextProvider();
|
thread->SharedMainThreadContextProvider();
|
||||||
if (!provider)
|
if (!provider)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl(
|
WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider)
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider)
|
||||||
: provider_(std::move(provider)) {}
|
: provider_(std::move(provider)) {}
|
||||||
|
|
||||||
WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {
|
WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {
|
||||||
|
@@ -21,14 +21,14 @@ class GLES2Interface;
|
|||||||
} // namespace gles2
|
} // namespace gles2
|
||||||
} // namespace gpu
|
} // namespace gpu
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class ContextProviderCommandBuffer;
|
|
||||||
} // namespace ui
|
|
||||||
|
|
||||||
namespace viz {
|
namespace viz {
|
||||||
class GLHelper;
|
class GLHelper;
|
||||||
} // namespace viz
|
} // namespace viz
|
||||||
|
|
||||||
|
namespace ws {
|
||||||
|
class ContextProviderCommandBuffer;
|
||||||
|
} // namespace ws
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
|
class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
|
||||||
@@ -36,7 +36,7 @@ class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
|
|||||||
public viz::ContextLostObserver {
|
public viz::ContextLostObserver {
|
||||||
public:
|
public:
|
||||||
WebGraphicsContext3DProviderImpl(
|
WebGraphicsContext3DProviderImpl(
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider);
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider);
|
||||||
~WebGraphicsContext3DProviderImpl() override;
|
~WebGraphicsContext3DProviderImpl() override;
|
||||||
|
|
||||||
// WebGraphicsContext3DProvider implementation.
|
// WebGraphicsContext3DProvider implementation.
|
||||||
@@ -51,7 +51,7 @@ class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
|
|||||||
base::RepeatingCallback<void(const char*, int32_t)>) override;
|
base::RepeatingCallback<void(const char*, int32_t)>) override;
|
||||||
cc::ImageDecodeCache* ImageDecodeCache() override;
|
cc::ImageDecodeCache* ImageDecodeCache() override;
|
||||||
|
|
||||||
ui::ContextProviderCommandBuffer* context_provider() const {
|
ws::ContextProviderCommandBuffer* context_provider() const {
|
||||||
return provider_.get();
|
return provider_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
|
|||||||
// viz::ContextLostObserver implementation.
|
// viz::ContextLostObserver implementation.
|
||||||
void OnContextLost() override;
|
void OnContextLost() override;
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> provider_;
|
scoped_refptr<ws::ContextProviderCommandBuffer> provider_;
|
||||||
std::unique_ptr<viz::GLHelper> gl_helper_;
|
std::unique_ptr<viz::GLHelper> gl_helper_;
|
||||||
base::RepeatingClosure context_lost_callback_;
|
base::RepeatingClosure context_lost_callback_;
|
||||||
std::unique_ptr<cc::ImageDecodeCache> image_decode_cache_;
|
std::unique_ptr<cc::ImageDecodeCache> image_decode_cache_;
|
||||||
|
@@ -46,7 +46,7 @@ GpuBrowsertestEstablishGpuChannelSyncRunLoop() {
|
|||||||
return gpu_channel_host;
|
return gpu_channel_host;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> GpuBrowsertestCreateContext(
|
scoped_refptr<ws::ContextProviderCommandBuffer> GpuBrowsertestCreateContext(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) {
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) {
|
||||||
gpu::GpuChannelEstablishFactory* factory =
|
gpu::GpuChannelEstablishFactory* factory =
|
||||||
content::BrowserMainLoop::GetInstance()->gpu_channel_establish_factory();
|
content::BrowserMainLoop::GetInstance()->gpu_channel_establish_factory();
|
||||||
@@ -62,12 +62,12 @@ scoped_refptr<ui::ContextProviderCommandBuffer> GpuBrowsertestCreateContext(
|
|||||||
constexpr bool automatic_flushes = false;
|
constexpr bool automatic_flushes = false;
|
||||||
constexpr bool support_locking = false;
|
constexpr bool support_locking = false;
|
||||||
constexpr bool support_grcontext = true;
|
constexpr bool support_grcontext = true;
|
||||||
return base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
return base::MakeRefCounted<ws::ContextProviderCommandBuffer>(
|
||||||
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
std::move(gpu_channel_host), factory->GetGpuMemoryBufferManager(),
|
||||||
content::kGpuStreamIdDefault, content::kGpuStreamPriorityDefault,
|
content::kGpuStreamIdDefault, content::kGpuStreamPriorityDefault,
|
||||||
gpu::kNullSurfaceHandle, GURL(), automatic_flushes, support_locking,
|
gpu::kNullSurfaceHandle, GURL(), automatic_flushes, support_locking,
|
||||||
support_grcontext, gpu::SharedMemoryLimits(), attributes,
|
support_grcontext, gpu::SharedMemoryLimits(), attributes,
|
||||||
ui::command_buffer_metrics::ContextType::FOR_TESTING);
|
ws::command_buffer_metrics::ContextType::FOR_TESTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace content
|
} // namespace content
|
||||||
|
@@ -11,7 +11,7 @@ namespace gpu {
|
|||||||
class GpuChannelHost;
|
class GpuChannelHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ws {
|
||||||
class ContextProviderCommandBuffer;
|
class ContextProviderCommandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ GpuBrowsertestEstablishGpuChannelSyncRunLoop();
|
|||||||
|
|
||||||
// Creates a new ContextProviderCommandBuffer using the provided
|
// Creates a new ContextProviderCommandBuffer using the provided
|
||||||
// GpuChannelHost.
|
// GpuChannelHost.
|
||||||
scoped_refptr<ui::ContextProviderCommandBuffer> GpuBrowsertestCreateContext(
|
scoped_refptr<ws::ContextProviderCommandBuffer> GpuBrowsertestCreateContext(
|
||||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
|
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
|
||||||
|
|
||||||
} // namespace content
|
} // namespace content
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user