Commit 2773260a authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Do not change activation color on the frame during overview session.

I'll look into the paint issue with MirrorView separatgely,
but I think this is good change anyway because it can eliminate
activation animation when entering/exitting overview for performance.

Bug: 1083951
Test: manual see bug for repro step.

Change-Id: I02a9ed265b2ab36cf348b37937669777cfd76c41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523907
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825234}
parent 57644371
...@@ -368,6 +368,14 @@ void OverviewController::ToggleOverview(OverviewEnterExitType type) { ...@@ -368,6 +368,14 @@ void OverviewController::ToggleOverview(OverviewEnterExitType type) {
DCHECK(CanEnterOverview()); DCHECK(CanEnterOverview());
TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("ui", "OverviewController::EnterOverview", TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("ui", "OverviewController::EnterOverview",
this); this);
auto* active_window = window_util::GetActiveWindow();
if (active_window) {
auto* active_widget =
views::Widget::GetWidgetForNativeView(active_window);
if (active_widget)
paint_as_active_lock_ = active_widget->LockPaintAsActive();
}
Shell::Get()->frame_throttling_controller()->StartThrottling(windows); Shell::Get()->frame_throttling_controller()->StartThrottling(windows);
// Clear any animations that may be running from last overview end. // Clear any animations that may be running from last overview end.
...@@ -517,15 +525,18 @@ void OverviewController::OnStartingAnimationComplete(bool canceled) { ...@@ -517,15 +525,18 @@ void OverviewController::OnStartingAnimationComplete(bool canceled) {
} }
void OverviewController::OnEndingAnimationComplete(bool canceled) { void OverviewController::OnEndingAnimationComplete(bool canceled) {
for (auto& observer : observers_)
observer.OnOverviewModeEndingAnimationComplete(canceled);
UnpauseOcclusionTracker(occlusion_pause_duration_for_end_);
// Unblur when animation is completed (or right away if there was no // Unblur when animation is completed (or right away if there was no
// delayed animation) unless it's canceled, in which case, we should keep // delayed animation) unless it's canceled, in which case, we should keep
// the blur. // the blur. Also resume the activation frame state.
if (!canceled) if (!canceled) {
overview_wallpaper_controller_->Unblur(); overview_wallpaper_controller_->Unblur();
paint_as_active_lock_.reset();
}
for (auto& observer : observers_)
observer.OnOverviewModeEndingAnimationComplete(canceled);
UnpauseOcclusionTracker(occlusion_pause_duration_for_end_);
TRACE_EVENT_NESTABLE_ASYNC_END1("ui", "OverviewController::ExitOverview", TRACE_EVENT_NESTABLE_ASYNC_END1("ui", "OverviewController::ExitOverview",
this, "canceled", canceled); this, "canceled", canceled);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/aura/window_occlusion_tracker.h" #include "ui/aura/window_occlusion_tracker.h"
#include "ui/views/widget/widget.h"
namespace ash { namespace ash {
...@@ -157,6 +158,8 @@ class ASH_EXPORT OverviewController : public OverviewDelegate, ...@@ -157,6 +158,8 @@ class ASH_EXPORT OverviewController : public OverviewDelegate,
base::ObserverList<OverviewObserver> observers_; base::ObserverList<OverviewObserver> observers_;
std::unique_ptr<views::Widget::PaintAsActiveLock> paint_as_active_lock_;
base::WeakPtrFactory<OverviewController> weak_ptr_factory_{this}; base::WeakPtrFactory<OverviewController> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(OverviewController); DISALLOW_COPY_AND_ASSIGN(OverviewController);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment