OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 DidVisibilityChange(this, visible_); | 1941 DidVisibilityChange(this, visible_); |
1942 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); | 1942 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); |
1943 | 1943 |
1944 // If we just became visible, we have to ensure that we draw high res tiles, | 1944 // If we just became visible, we have to ensure that we draw high res tiles, |
1945 // to prevent checkerboard/low res flashes. | 1945 // to prevent checkerboard/low res flashes. |
1946 if (visible_) | 1946 if (visible_) |
1947 SetRequiresHighResToDraw(); | 1947 SetRequiresHighResToDraw(); |
1948 else | 1948 else |
1949 EvictAllUIResources(); | 1949 EvictAllUIResources(); |
1950 | 1950 |
1951 // Evict tiles immediately if invisible since this tab may never get another | 1951 // Call PrepareTiles unconditionally on visibility change since this tab may |
1952 // draw or timer tick. | 1952 // never get another draw or timer tick. When becoming visible we care about |
1953 if (!visible_) | 1953 // unblocking the scheduler which might be waiting for activation / ready to |
1954 PrepareTiles(); | 1954 // draw. When becoming invisible we care about evicting tiles immediately. |
| 1955 PrepareTiles(); |
1955 | 1956 |
1956 if (!renderer_) | 1957 if (!renderer_) |
1957 return; | 1958 return; |
1958 | 1959 |
1959 renderer_->SetVisible(visible); | 1960 renderer_->SetVisible(visible); |
1960 } | 1961 } |
1961 | 1962 |
1962 void LayerTreeHostImpl::SetNeedsAnimate() { | 1963 void LayerTreeHostImpl::SetNeedsAnimate() { |
1963 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 1964 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
1964 client_->SetNeedsAnimateOnImplThread(); | 1965 client_->SetNeedsAnimateOnImplThread(); |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3447 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3448 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3448 | 3449 |
3449 curve->UpdateTarget( | 3450 curve->UpdateTarget( |
3450 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3451 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3451 .InSecondsF(), | 3452 .InSecondsF(), |
3452 new_target); | 3453 new_target); |
3453 | 3454 |
3454 return true; | 3455 return true; |
3455 } | 3456 } |
3456 } // namespace cc | 3457 } // namespace cc |
OLD | NEW |