diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 20:15:40 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 20:15:40 +0000 |
commit | 0a04ef13507cbec52c86bb6a7f77d059b8d5a8e7 (patch) | |
tree | 30b5454160c7ef58cd1433f8ddfe7b7f092460f1 /ash | |
parent | 5d261c985ff7cd0630585fc9c25bc15fdcae62d8 (diff) | |
download | chromium_src-0a04ef13507cbec52c86bb6a7f77d059b8d5a8e7.zip chromium_src-0a04ef13507cbec52c86bb6a7f77d059b8d5a8e7.tar.gz chromium_src-0a04ef13507cbec52c86bb6a7f77d059b8d5a8e7.tar.bz2 |
Move some non-event related functionality from RootWindow onto RootWindowHost.
- Transform logic
- Compositor
R=sky@chromium.org
http://crbug.com/308843
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236017
Review URL: https://codereview.chromium.org/70103020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241929 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/autoclick/autoclick_controller.cc | 2 | ||||
-rw-r--r-- | ash/debug.cc | 6 | ||||
-rw-r--r-- | ash/display/display_controller.cc | 4 | ||||
-rw-r--r-- | ash/display/display_controller_unittest.cc | 28 | ||||
-rw-r--r-- | ash/display/display_manager_unittest.cc | 4 | ||||
-rw-r--r-- | ash/display/mirror_window_controller.cc | 11 | ||||
-rw-r--r-- | ash/display/screen_position_controller.cc | 2 | ||||
-rw-r--r-- | ash/display/virtual_keyboard_window_controller.cc | 2 | ||||
-rw-r--r-- | ash/magnifier/magnification_controller.cc | 5 | ||||
-rw-r--r-- | ash/wm/window_manager_unittest.cc | 2 |
10 files changed, 34 insertions, 32 deletions
diff --git a/ash/autoclick/autoclick_controller.cc b/ash/autoclick/autoclick_controller.cc index ec8977b..8520dcf 100644 --- a/ash/autoclick/autoclick_controller.cc +++ b/ash/autoclick/autoclick_controller.cc @@ -186,7 +186,7 @@ void AutoclickControllerImpl::DoAutoclick() { wm::ConvertPointFromScreen(root_window, &click_location); aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); - dispatcher->ConvertPointToHost(&click_location); + dispatcher->host()->ConvertPointToHost(&click_location); ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, click_location, diff --git a/ash/debug.cc b/ash/debug.cc index f5c6220..a54759b 100644 --- a/ash/debug.cc +++ b/ash/debug.cc @@ -18,7 +18,7 @@ void ToggleShowDebugBorders() { scoped_ptr<bool> value; for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->host()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_debug_borders)); @@ -33,7 +33,7 @@ void ToggleShowFpsCounter() { scoped_ptr<bool> value; for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->host()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_fps_counter)); @@ -48,7 +48,7 @@ void ToggleShowPaintRects() { scoped_ptr<bool> value; for (aura::Window::Windows::iterator it = root_windows.begin(); it != root_windows.end(); ++it) { - ui::Compositor* compositor = (*it)->GetDispatcher()->compositor(); + ui::Compositor* compositor = (*it)->GetDispatcher()->host()->compositor(); cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); if (!value.get()) value.reset(new bool(!state.show_paint_rects)); diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index ee5d25a..09927b3 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -124,7 +124,7 @@ void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root, #endif scoped_ptr<aura::RootWindowTransformer> transformer( internal::CreateRootWindowTransformerForDisplay(root->window(), display)); - root->SetRootWindowTransformer(transformer.Pass()); + root->host()->SetRootWindowTransformer(transformer.Pass()); } } // namespace @@ -761,7 +761,7 @@ aura::RootWindow* DisplayController::AddRootWindowForDisplay( aura::RootWindow* root_window = new aura::RootWindow(params); root_window->window()->SetName( base::StringPrintf("RootWindow-%d", root_window_count++)); - root_window->compositor()->SetBackgroundColor(SK_ColorBLACK); + root_window->host()->compositor()->SetBackgroundColor(SK_ColorBLACK); // No need to remove RootWindowObserver because // the DisplayController object outlives RootWindow objects. root_window->AddRootWindowObserver(this); diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc index 1d4bb5a5..98f9304 100644 --- a/ash/display/display_controller_unittest.cc +++ b/ash/display/display_controller_unittest.cc @@ -921,12 +921,12 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) { test::CursorManagerTestApi test_api(Shell::GetInstance()->cursor_manager()); - EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()-> - GetDeviceScaleFactor()); + EXPECT_EQ(1.0f, primary_root->GetDispatcher()->host()->compositor()-> + device_scale_factor()); primary_root->MoveCursorTo(gfx::Point(50, 50)); EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); - EXPECT_EQ(2.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()-> - GetDeviceScaleFactor()); + EXPECT_EQ(2.0f, secondary_root->GetDispatcher()->host()->compositor()-> + device_scale_factor()); secondary_root->MoveCursorTo(gfx::Point(50, 50)); EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); @@ -935,13 +935,13 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) { // Cursor's device scale factor should be updated accroding to the swap of // primary and secondary. - EXPECT_EQ(1.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()-> - GetDeviceScaleFactor()); + EXPECT_EQ(1.0f, secondary_root->GetDispatcher()->host()->compositor()-> + device_scale_factor()); secondary_root->MoveCursorTo(gfx::Point(50, 50)); EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); primary_root->MoveCursorTo(gfx::Point(50, 50)); - EXPECT_EQ(2.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()-> - GetDeviceScaleFactor()); + EXPECT_EQ(2.0f, primary_root->GetDispatcher()->host()->compositor()-> + device_scale_factor()); EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); // Deleting 2nd display. @@ -952,8 +952,8 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) { EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); primary_root->MoveCursorTo(gfx::Point(50, 50)); - EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()-> - GetDeviceScaleFactor()); + EXPECT_EQ(1.0f, primary_root->GetDispatcher()->host()->compositor()-> + device_scale_factor()); EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); } @@ -994,13 +994,13 @@ TEST_F(DisplayControllerTest, OverscanInsets) { UpdateDisplay("400x300*2,600x400/o"); root_windows = Shell::GetAllRootWindows(); gfx::Point point; - Shell::GetAllRootWindows()[1]->GetDispatcher()-> + Shell::GetAllRootWindows()[1]->GetDispatcher()->host()-> GetRootTransform().TransformPoint(&point); EXPECT_EQ("15,10", point.ToString()); display_controller->SwapPrimaryDisplay(); point.SetPoint(0, 0); - Shell::GetAllRootWindows()[1]->GetDispatcher()-> + Shell::GetAllRootWindows()[1]->GetDispatcher()->host()-> GetRootTransform().TransformPoint(&point); EXPECT_EQ("15,10", point.ToString()); @@ -1253,7 +1253,7 @@ TEST_F(DisplayControllerTest, DockToSingle) { display_info_list.push_back(external_display_info); display_manager->OnNativeDisplaysChanged(display_info_list); EXPECT_EQ(1U, display_manager->GetNumDisplays()); - EXPECT_FALSE(Shell::GetPrimaryRootWindow()->GetDispatcher()-> + EXPECT_FALSE(Shell::GetPrimaryRootWindow()->GetDispatcher()->host()-> GetRootTransform().IsIdentityOrIntegerTranslation()); // Switch to single mode and make sure the transform is the one @@ -1261,7 +1261,7 @@ TEST_F(DisplayControllerTest, DockToSingle) { display_info_list.clear(); display_info_list.push_back(internal_display_info); display_manager->OnNativeDisplaysChanged(display_info_list); - EXPECT_TRUE(Shell::GetPrimaryRootWindow()->GetDispatcher()-> + EXPECT_TRUE(Shell::GetPrimaryRootWindow()->GetDispatcher()->host()-> GetRootTransform().IsIdentityOrIntegerTranslation()); } diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 162f9a9..63a37f5 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -384,11 +384,11 @@ TEST_F(DisplayManagerTest, TestDeviceScaleOnlyChange) { UpdateDisplay("1000x600"); aura::WindowEventDispatcher* dispatcher = Shell::GetPrimaryRootWindow()->GetDispatcher(); - EXPECT_EQ(1, dispatcher->compositor()->device_scale_factor()); + EXPECT_EQ(1, dispatcher->host()->compositor()->device_scale_factor()); EXPECT_EQ("1000x600", Shell::GetPrimaryRootWindow()->bounds().size().ToString()); UpdateDisplay("1000x600*2"); - EXPECT_EQ(2, dispatcher->compositor()->device_scale_factor()); + EXPECT_EQ(2, dispatcher->host()->compositor()->device_scale_factor()); EXPECT_EQ("500x300", Shell::GetPrimaryRootWindow()->bounds().size().ToString()); } diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc index 7e812a4c..9a16898 100644 --- a/ash/display/mirror_window_controller.cc +++ b/ash/display/mirror_window_controller.cc @@ -168,7 +168,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { root_window_.reset(new aura::RootWindow(params)); root_window_->window()->SetName( base::StringPrintf("MirrorRootWindow-%d", mirror_root_window_count++)); - root_window_->compositor()->SetBackgroundColor(SK_ColorBLACK); + root_window_->host()->compositor()->SetBackgroundColor(SK_ColorBLACK); // No need to remove RootWindowObserver because // the DisplayController object outlives RootWindow objects. root_window_->AddRootWindowObserver( @@ -193,7 +193,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { mirror_window->SetBounds(root_window_->window()->bounds()); mirror_window->Show(); reflector_ = ui::ContextFactory::GetInstance()->CreateReflector( - Shell::GetPrimaryRootWindow()->GetDispatcher()->compositor(), + Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->compositor(), mirror_window->layer()); cursor_window_ = new aura::Window(cursor_window_delegate_.get()); @@ -215,7 +215,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { internal::CreateRootWindowTransformerForMirroredDisplay( source_display_info, display_info)); - root_window_->SetRootWindowTransformer(transformer.Pass()); + root_window_->host()->SetRootWindowTransformer(transformer.Pass()); UpdateCursorLocation(); } @@ -250,7 +250,8 @@ void MirrorWindowController::UpdateCursorLocation() { if (cursor_window_) { // TODO(oshima): Rotate cursor image (including hotpoint). gfx::Point point = aura::Env::GetInstance()->last_mouse_location(); - Shell::GetPrimaryRootWindow()->GetDispatcher()->ConvertPointToHost(&point); + Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->ConvertPointToHost( + &point); point.Offset(-hot_point_.x(), -hot_point_.y()); gfx::Rect bounds = cursor_window_->bounds(); bounds.set_origin(point); @@ -325,7 +326,7 @@ void MirrorWindowController::OnRootWindowHostResized( return; mirror_window_host_size_ = root->host()->GetBounds().size(); reflector_->OnMirroringCompositorResized(); - root_window_->SetRootWindowTransformer( + root_window_->host()->SetRootWindowTransformer( CreateRootWindowTransformer().Pass()); UpdateCursorLocation(); } diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index e9f7a42..624a0cd 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -140,7 +140,7 @@ void ScreenPositionController::ConvertHostPointToScreen( aura::Window* root_window, gfx::Point* point) { aura::Window* root = root_window->GetRootWindow(); - root->GetDispatcher()->ConvertPointFromHost(point); + root->GetDispatcher()->host()->ConvertPointFromHost(point); std::pair<aura::Window*, gfx::Point> pair = GetRootWindowRelativeToWindow(root, *point); *point = pair.second; diff --git a/ash/display/virtual_keyboard_window_controller.cc b/ash/display/virtual_keyboard_window_controller.cc index dd0c4d8..7b9f295 100644 --- a/ash/display/virtual_keyboard_window_controller.cc +++ b/ash/display/virtual_keyboard_window_controller.cc @@ -95,7 +95,7 @@ void VirtualKeyboardWindowController::FlipDisplay() { scoped_ptr<aura::RootWindowTransformer> transformer( internal::CreateRootWindowTransformerForDisplay(root_window->window(), display_manager->non_desktop_display())); - root_window->SetRootWindowTransformer(transformer.Pass()); + root_window->host()->SetRootWindowTransformer(transformer.Pass()); } } // namespace internal diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index 0df6e12..66bebf2 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -44,7 +44,7 @@ const int kPanningMergin = 100; void MoveCursorTo(aura::RootWindow* root_window, const gfx::Point& root_location) { gfx::Point3F host_location_3f(root_location); - root_window->GetRootTransform().TransformPoint(&host_location_3f); + root_window->host()->GetRootTransform().TransformPoint(&host_location_3f); root_window->MoveCursorToHostLocation( gfx::ToCeiledPoint(host_location_3f.AsPointF())); } @@ -273,7 +273,8 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip, Shell::GetScreen()->GetDisplayNearestWindow(root_window_); scoped_ptr<aura::RootWindowTransformer> transformer( internal::CreateRootWindowTransformerForDisplay(root_window_, display)); - root_window_->GetDispatcher()->SetRootWindowTransformer(transformer.Pass()); + root_window_->GetDispatcher()->host()->SetRootWindowTransformer( + transformer.Pass()); if (animate) is_on_animation_ = true; diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index 15d4a18..a30715f 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -592,7 +592,7 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) { gfx::Transform transform; transform.Translate(size.width(), 0); transform.Rotate(90.0f); - root_window->GetDispatcher()->SetTransform(transform); + root_window->GetDispatcher()->host()->SetTransform(transform); test::TestActivationDelegate d1; aura::test::TestWindowDelegate wd; |