| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 &memory_used_bytes); | 380 &memory_used_bytes); |
| 381 SendManagedMemoryStats(memory_required_bytes, | 381 SendManagedMemoryStats(memory_required_bytes, |
| 382 memory_nice_to_have_bytes, | 382 memory_nice_to_have_bytes, |
| 383 memory_used_bytes); | 383 memory_used_bytes); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void LayerTreeHostImpl::StartPageScaleAnimation(gfx::Vector2d target_offset, | 386 void LayerTreeHostImpl::StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 387 bool anchor_point, | 387 bool anchor_point, |
| 388 float page_scale, | 388 float page_scale, |
| 389 base::TimeDelta duration) { | 389 base::TimeDelta duration) { |
| 390 if (!RootScrollLayer()) | 390 if (!InnerViewportScrollLayer()) |
| 391 return; | 391 return; |
| 392 | 392 |
| 393 // Should we attempt to set to OuterViewportScrollingLayer if it's available? |
| 394 active_tree_->SetCurrentlyScrollingLayer(InnerViewportScrollLayer()); |
| 395 |
| 393 gfx::Vector2dF scroll_total = | 396 gfx::Vector2dF scroll_total = |
| 394 RootScrollLayer()->scroll_offset() + RootScrollLayer()->ScrollDelta(); | 397 active_tree_->TotalScrollOffset() + active_tree_->TotalScrollDelta(); |
| 395 gfx::SizeF scaled_scrollable_size = active_tree_->ScrollableSize(); | 398 gfx::SizeF scaled_scrollable_size = active_tree_->ScrollableSize(); |
| 396 gfx::SizeF viewport_size = UnscaledScrollableViewportSize(); | 399 gfx::SizeF viewport_size = UnscaledScrollableViewportSize(); |
| 397 | 400 |
| 398 // Easing constants experimentally determined. | 401 // Easing constants experimentally determined. |
| 399 scoped_ptr<TimingFunction> timing_function = | 402 scoped_ptr<TimingFunction> timing_function = |
| 400 CubicBezierTimingFunction::Create(.8, 0, .3, .9).PassAs<TimingFunction>(); | 403 CubicBezierTimingFunction::Create(.8, 0, .3, .9).PassAs<TimingFunction>(); |
| 401 | 404 |
| 402 page_scale_animation_ = | 405 page_scale_animation_ = |
| 403 PageScaleAnimation::Create(scroll_total, | 406 PageScaleAnimation::Create(scroll_total, |
| 404 active_tree_->total_page_scale_factor(), | 407 active_tree_->total_page_scale_factor(), |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); | 1240 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); |
| 1238 metadata.latency_info = active_tree_->GetLatencyInfo(); | 1241 metadata.latency_info = active_tree_->GetLatencyInfo(); |
| 1239 if (top_controls_manager_) { | 1242 if (top_controls_manager_) { |
| 1240 metadata.location_bar_offset = | 1243 metadata.location_bar_offset = |
| 1241 gfx::Vector2dF(0.f, top_controls_manager_->controls_top_offset()); | 1244 gfx::Vector2dF(0.f, top_controls_manager_->controls_top_offset()); |
| 1242 metadata.location_bar_content_translation = | 1245 metadata.location_bar_content_translation = |
| 1243 gfx::Vector2dF(0.f, top_controls_manager_->content_top_offset()); | 1246 gfx::Vector2dF(0.f, top_controls_manager_->content_top_offset()); |
| 1244 metadata.overdraw_bottom_height = overdraw_bottom_height_; | 1247 metadata.overdraw_bottom_height = overdraw_bottom_height_; |
| 1245 } | 1248 } |
| 1246 | 1249 |
| 1247 if (!RootScrollLayer()) | 1250 if (!InnerViewportScrollLayer()) |
| 1248 return metadata; | 1251 return metadata; |
| 1249 | 1252 |
| 1250 metadata.root_scroll_offset = RootScrollLayer()->TotalScrollOffset(); | 1253 metadata.root_scroll_offset = active_tree_->TotalScrollOffset(); |
| 1251 | 1254 |
| 1252 return metadata; | 1255 return metadata; |
| 1253 } | 1256 } |
| 1254 | 1257 |
| 1255 static void LayerTreeHostImplDidBeginTracingCallback(LayerImpl* layer) { | 1258 static void LayerTreeHostImplDidBeginTracingCallback(LayerImpl* layer) { |
| 1256 layer->DidBeginTracing(); | 1259 layer->DidBeginTracing(); |
| 1257 } | 1260 } |
| 1258 | 1261 |
| 1259 void LayerTreeHostImpl::DrawLayers(FrameData* frame, | 1262 void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
| 1260 base::TimeTicks frame_begin_time) { | 1263 base::TimeTicks frame_begin_time) { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 client_->DidLoseOutputSurfaceOnImplThread(); | 1431 client_->DidLoseOutputSurfaceOnImplThread(); |
| 1429 } | 1432 } |
| 1430 | 1433 |
| 1431 void LayerTreeHostImpl::Readback(void* pixels, | 1434 void LayerTreeHostImpl::Readback(void* pixels, |
| 1432 gfx::Rect rect_in_device_viewport) { | 1435 gfx::Rect rect_in_device_viewport) { |
| 1433 DCHECK(renderer_); | 1436 DCHECK(renderer_); |
| 1434 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); | 1437 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); |
| 1435 } | 1438 } |
| 1436 | 1439 |
| 1437 bool LayerTreeHostImpl::HaveRootScrollLayer() const { | 1440 bool LayerTreeHostImpl::HaveRootScrollLayer() const { |
| 1438 return !!RootScrollLayer(); | 1441 return !!InnerViewportScrollLayer(); |
| 1439 } | 1442 } |
| 1440 | 1443 |
| 1441 LayerImpl* LayerTreeHostImpl::RootLayer() const { | 1444 LayerImpl* LayerTreeHostImpl::RootLayer() const { |
| 1442 return active_tree_->root_layer(); | 1445 return active_tree_->root_layer(); |
| 1443 } | 1446 } |
| 1444 | 1447 |
| 1445 LayerImpl* LayerTreeHostImpl::RootScrollLayer() const { | 1448 LayerImpl* LayerTreeHostImpl::InnerViewportScrollLayer() const { |
| 1446 return active_tree_->RootScrollLayer(); | 1449 return active_tree_->InnerViewportScrollLayer(); |
| 1450 } |
| 1451 |
| 1452 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { |
| 1453 return active_tree_->OuterViewportScrollLayer(); |
| 1447 } | 1454 } |
| 1448 | 1455 |
| 1449 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { | 1456 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { |
| 1450 return active_tree_->CurrentlyScrollingLayer(); | 1457 return active_tree_->CurrentlyScrollingLayer(); |
| 1451 } | 1458 } |
| 1452 | 1459 |
| 1453 bool LayerTreeHostImpl::IsCurrentlyScrolling() const { | 1460 bool LayerTreeHostImpl::IsCurrentlyScrolling() const { |
| 1454 return CurrentlyScrollingLayer() || | 1461 return CurrentlyScrollingLayer() || |
| 1455 (RootScrollLayer() && RootScrollLayer()->IsExternalFlingActive()); | 1462 (InnerViewportScrollLayer() && |
| 1463 InnerViewportScrollLayer()->IsExternalFlingActive()) || |
| 1464 (OuterViewportScrollLayer() && |
| 1465 OuterViewportScrollLayer()->IsExternalFlingActive()); |
| 1456 } | 1466 } |
| 1457 | 1467 |
| 1458 // Content layers can be either directly scrollable or contained in an outer | 1468 // Content layers can be either directly scrollable or contained in an outer |
| 1459 // scrolling layer which applies the scroll transform. Given a content layer, | 1469 // scrolling layer which applies the scroll transform. Given a content layer, |
| 1460 // this function returns the associated scroll layer if any. | 1470 // this function returns the associated scroll layer if any. |
| 1461 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { | 1471 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { |
| 1462 if (!layer_impl) | 1472 if (!layer_impl) |
| 1463 return NULL; | 1473 return NULL; |
| 1464 | 1474 |
| 1465 if (layer_impl->scrollable()) | 1475 if (layer_impl->scrollable()) |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 | 1829 |
| 1820 void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { | 1830 void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { |
| 1821 if (device_viewport_size == device_viewport_size_) | 1831 if (device_viewport_size == device_viewport_size_) |
| 1822 return; | 1832 return; |
| 1823 | 1833 |
| 1824 if (pending_tree_) | 1834 if (pending_tree_) |
| 1825 active_tree_->SetViewportSizeInvalid(); | 1835 active_tree_->SetViewportSizeInvalid(); |
| 1826 | 1836 |
| 1827 device_viewport_size_ = device_viewport_size; | 1837 device_viewport_size_ = device_viewport_size; |
| 1828 | 1838 |
| 1829 UpdateMaxScrollOffset(); | |
| 1830 | |
| 1831 if (renderer_) | 1839 if (renderer_) |
| 1832 renderer_->ViewportChanged(); | 1840 renderer_->ViewportChanged(); |
| 1833 | 1841 |
| 1834 client_->OnCanDrawStateChanged(CanDraw()); | 1842 client_->OnCanDrawStateChanged(CanDraw()); |
| 1835 SetFullRootLayerDamage(); | 1843 SetFullRootLayerDamage(); |
| 1836 } | 1844 } |
| 1837 | 1845 |
| 1838 void LayerTreeHostImpl::SetOverdrawBottomHeight(float overdraw_bottom_height) { | 1846 void LayerTreeHostImpl::SetOverdrawBottomHeight(float overdraw_bottom_height) { |
| 1839 if (overdraw_bottom_height == overdraw_bottom_height_) | 1847 if (overdraw_bottom_height == overdraw_bottom_height_) |
| 1840 return; | 1848 return; |
| 1841 overdraw_bottom_height_ = overdraw_bottom_height; | 1849 overdraw_bottom_height_ = overdraw_bottom_height; |
| 1842 | 1850 |
| 1843 UpdateMaxScrollOffset(); | |
| 1844 SetFullRootLayerDamage(); | 1851 SetFullRootLayerDamage(); |
| 1845 } | 1852 } |
| 1846 | 1853 |
| 1847 void LayerTreeHostImpl::SetOverhangUIResource( | 1854 void LayerTreeHostImpl::SetOverhangUIResource( |
| 1848 UIResourceId overhang_ui_resource_id, | 1855 UIResourceId overhang_ui_resource_id, |
| 1849 gfx::Size overhang_ui_resource_size) { | 1856 gfx::Size overhang_ui_resource_size) { |
| 1850 overhang_ui_resource_id_ = overhang_ui_resource_id; | 1857 overhang_ui_resource_id_ = overhang_ui_resource_id; |
| 1851 overhang_ui_resource_size_ = overhang_ui_resource_size; | 1858 overhang_ui_resource_size_ = overhang_ui_resource_size; |
| 1852 } | 1859 } |
| 1853 | 1860 |
| 1854 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { | 1861 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { |
| 1855 if (device_scale_factor == device_scale_factor_) | 1862 if (device_scale_factor == device_scale_factor_) |
| 1856 return; | 1863 return; |
| 1857 device_scale_factor_ = device_scale_factor; | 1864 device_scale_factor_ = device_scale_factor; |
| 1858 | 1865 |
| 1859 if (renderer_) | 1866 if (renderer_) |
| 1860 renderer_->ViewportChanged(); | 1867 renderer_->ViewportChanged(); |
| 1861 | 1868 |
| 1862 UpdateMaxScrollOffset(); | |
| 1863 SetFullRootLayerDamage(); | 1869 SetFullRootLayerDamage(); |
| 1864 } | 1870 } |
| 1865 | 1871 |
| 1866 gfx::Size LayerTreeHostImpl::DrawViewportSize() const { | 1872 gfx::Size LayerTreeHostImpl::DrawViewportSize() const { |
| 1867 return DeviceViewport().size(); | 1873 return DeviceViewport().size(); |
| 1868 } | 1874 } |
| 1869 | 1875 |
| 1870 gfx::Rect LayerTreeHostImpl::DeviceViewport() const { | 1876 gfx::Rect LayerTreeHostImpl::DeviceViewport() const { |
| 1871 if (external_viewport_.IsEmpty()) | 1877 if (external_viewport_.IsEmpty()) |
| 1872 return gfx::Rect(device_viewport_size_); | 1878 return gfx::Rect(device_viewport_size_); |
| 1873 | 1879 |
| 1874 return external_viewport_; | 1880 return external_viewport_; |
| 1875 } | 1881 } |
| 1876 | 1882 |
| 1877 gfx::Rect LayerTreeHostImpl::DeviceClip() const { | 1883 gfx::Rect LayerTreeHostImpl::DeviceClip() const { |
| 1878 if (external_clip_.IsEmpty()) | 1884 if (external_clip_.IsEmpty()) |
| 1879 return DeviceViewport(); | 1885 return DeviceViewport(); |
| 1880 | 1886 |
| 1881 return external_clip_; | 1887 return external_clip_; |
| 1882 } | 1888 } |
| 1883 | 1889 |
| 1884 const gfx::Transform& LayerTreeHostImpl::DrawTransform() const { | 1890 const gfx::Transform& LayerTreeHostImpl::DrawTransform() const { |
| 1885 return external_transform_; | 1891 return external_transform_; |
| 1886 } | 1892 } |
| 1887 | 1893 |
| 1888 void LayerTreeHostImpl::UpdateMaxScrollOffset() { | |
| 1889 active_tree_->UpdateMaxScrollOffset(); | |
| 1890 } | |
| 1891 | |
| 1892 void LayerTreeHostImpl::DidChangeTopControlsPosition() { | 1894 void LayerTreeHostImpl::DidChangeTopControlsPosition() { |
| 1893 client_->SetNeedsRedrawOnImplThread(); | 1895 client_->SetNeedsRedrawOnImplThread(); |
| 1894 active_tree_->set_needs_update_draw_properties(); | 1896 active_tree_->set_needs_update_draw_properties(); |
| 1895 SetFullRootLayerDamage(); | 1897 SetFullRootLayerDamage(); |
| 1896 } | 1898 } |
| 1897 | 1899 |
| 1898 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { | 1900 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { |
| 1899 active_tree_->UpdateDrawProperties(); | 1901 active_tree_->UpdateDrawProperties(); |
| 1900 return !active_tree_->RenderSurfaceLayerList().empty(); | 1902 return !active_tree_->RenderSurfaceLayerList().empty(); |
| 1901 } | 1903 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 if (status == ScrollStarted && !potentially_scrolling_layer_impl) | 1943 if (status == ScrollStarted && !potentially_scrolling_layer_impl) |
| 1942 potentially_scrolling_layer_impl = scroll_layer_impl; | 1944 potentially_scrolling_layer_impl = scroll_layer_impl; |
| 1943 } | 1945 } |
| 1944 | 1946 |
| 1945 // When hiding top controls is enabled and the controls are hidden or | 1947 // When hiding top controls is enabled and the controls are hidden or |
| 1946 // overlaying the content, force scrolls to be enabled on the root layer to | 1948 // overlaying the content, force scrolls to be enabled on the root layer to |
| 1947 // allow bringing the top controls back into view. | 1949 // allow bringing the top controls back into view. |
| 1948 if (!potentially_scrolling_layer_impl && top_controls_manager_ && | 1950 if (!potentially_scrolling_layer_impl && top_controls_manager_ && |
| 1949 top_controls_manager_->content_top_offset() != | 1951 top_controls_manager_->content_top_offset() != |
| 1950 settings_.top_controls_height) { | 1952 settings_.top_controls_height) { |
| 1951 potentially_scrolling_layer_impl = RootScrollLayer(); | 1953 potentially_scrolling_layer_impl = |
| 1954 OuterViewportScrollLayer() ? OuterViewportScrollLayer() |
| 1955 : InnerViewportScrollLayer(); |
| 1952 } | 1956 } |
| 1953 | 1957 |
| 1954 return potentially_scrolling_layer_impl; | 1958 return potentially_scrolling_layer_impl; |
| 1955 } | 1959 } |
| 1956 | 1960 |
| 1957 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( | 1961 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
| 1958 gfx::Point viewport_point, InputHandler::ScrollInputType type) { | 1962 gfx::Point viewport_point, InputHandler::ScrollInputType type) { |
| 1959 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); | 1963 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); |
| 1960 | 1964 |
| 1961 if (top_controls_manager_) | 1965 if (top_controls_manager_) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1977 FindScrollLayerForDeviceViewportPoint(device_viewport_point, type, | 1981 FindScrollLayerForDeviceViewportPoint(device_viewport_point, type, |
| 1978 layer_impl, &scroll_on_main_thread); | 1982 layer_impl, &scroll_on_main_thread); |
| 1979 | 1983 |
| 1980 if (scroll_on_main_thread) { | 1984 if (scroll_on_main_thread) { |
| 1981 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true); | 1985 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true); |
| 1982 return ScrollOnMainThread; | 1986 return ScrollOnMainThread; |
| 1983 } | 1987 } |
| 1984 | 1988 |
| 1985 // If we want to send a DidOverscroll for this scroll it can't be ignored. | 1989 // If we want to send a DidOverscroll for this scroll it can't be ignored. |
| 1986 if (!potentially_scrolling_layer_impl && settings_.always_overscroll) | 1990 if (!potentially_scrolling_layer_impl && settings_.always_overscroll) |
| 1987 potentially_scrolling_layer_impl = RootScrollLayer(); | 1991 potentially_scrolling_layer_impl = |
| 1992 OuterViewportScrollLayer() ? OuterViewportScrollLayer() |
| 1993 : InnerViewportScrollLayer(); |
| 1988 | 1994 |
| 1989 if (potentially_scrolling_layer_impl) { | 1995 if (potentially_scrolling_layer_impl) { |
| 1990 active_tree_->SetCurrentlyScrollingLayer( | 1996 active_tree_->SetCurrentlyScrollingLayer( |
| 1991 potentially_scrolling_layer_impl); | 1997 potentially_scrolling_layer_impl); |
| 1992 should_bubble_scrolls_ = (type != NonBubblingGesture); | 1998 should_bubble_scrolls_ = (type != NonBubblingGesture); |
| 1993 last_scroll_did_bubble_ = false; | 1999 last_scroll_did_bubble_ = false; |
| 1994 wheel_scrolling_ = (type == Wheel); | 2000 wheel_scrolling_ = (type == Wheel); |
| 1995 client_->RenewTreePriority(); | 2001 client_->RenewTreePriority(); |
| 1996 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); | 2002 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); |
| 1997 return ScrollStarted; | 2003 return ScrollStarted; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 gfx::Vector2dF scroll_delta) { | 2092 gfx::Vector2dF scroll_delta) { |
| 2087 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); | 2093 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); |
| 2088 if (!CurrentlyScrollingLayer()) | 2094 if (!CurrentlyScrollingLayer()) |
| 2089 return false; | 2095 return false; |
| 2090 | 2096 |
| 2091 gfx::Vector2dF pending_delta = scroll_delta; | 2097 gfx::Vector2dF pending_delta = scroll_delta; |
| 2092 gfx::Vector2dF unused_root_delta; | 2098 gfx::Vector2dF unused_root_delta; |
| 2093 bool did_scroll_x = false; | 2099 bool did_scroll_x = false; |
| 2094 bool did_scroll_y = false; | 2100 bool did_scroll_y = false; |
| 2095 bool consume_by_top_controls = top_controls_manager_ && | 2101 bool consume_by_top_controls = top_controls_manager_ && |
| 2096 (CurrentlyScrollingLayer() == RootScrollLayer() || scroll_delta.y() < 0); | 2102 (CurrentlyScrollingLayer() == InnerViewportScrollLayer() || scroll_delta.y
() < 0); |
| 2097 last_scroll_did_bubble_ = false; | 2103 last_scroll_did_bubble_ = false; |
| 2098 | 2104 |
| 2099 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); | 2105 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); |
| 2100 layer_impl; | 2106 layer_impl; |
| 2101 layer_impl = layer_impl->parent()) { | 2107 layer_impl = layer_impl->parent()) { |
| 2102 if (!layer_impl->scrollable()) | 2108 if (!layer_impl->scrollable()) |
| 2103 continue; | 2109 continue; |
| 2104 | 2110 |
| 2105 if (layer_impl == RootScrollLayer()) { | 2111 if (layer_impl == InnerViewportScrollLayer()) { |
| 2106 // Only allow bubble scrolling when the scroll is in the direction to make | 2112 // Only allow bubble scrolling when the scroll is in the direction to make |
| 2107 // the top controls visible. | 2113 // the top controls visible. |
| 2108 if (consume_by_top_controls && layer_impl == RootScrollLayer()) { | 2114 if (consume_by_top_controls && layer_impl == InnerViewportScrollLayer()) |
| 2109 pending_delta = top_controls_manager_->ScrollBy(pending_delta); | 2115 pending_delta = top_controls_manager_->ScrollBy(pending_delta); |
| 2110 UpdateMaxScrollOffset(); | |
| 2111 } | |
| 2112 // Track root layer deltas for reporting overscroll. | 2116 // Track root layer deltas for reporting overscroll. |
| 2113 unused_root_delta = pending_delta; | 2117 unused_root_delta = pending_delta; |
| 2114 } | 2118 } |
| 2115 | 2119 |
| 2116 gfx::Vector2dF applied_delta; | 2120 gfx::Vector2dF applied_delta; |
| 2117 // Gesture events need to be transformed from viewport coordinates to local | 2121 // Gesture events need to be transformed from viewport coordinates to local |
| 2118 // layer coordinates so that the scrolling contents exactly follow the | 2122 // layer coordinates so that the scrolling contents exactly follow the |
| 2119 // user's finger. In contrast, wheel events represent a fixed amount of | 2123 // user's finger. In contrast, wheel events represent a fixed amount of |
| 2120 // scrolling so we can just apply them directly. | 2124 // scrolling so we can just apply them directly. |
| 2121 if (!wheel_scrolling_) { | 2125 if (!wheel_scrolling_) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2139 continue; | 2143 continue; |
| 2140 | 2144 |
| 2141 if (should_bubble_scrolls_) { | 2145 if (should_bubble_scrolls_) { |
| 2142 last_scroll_did_bubble_ = true; | 2146 last_scroll_did_bubble_ = true; |
| 2143 continue; | 2147 continue; |
| 2144 } | 2148 } |
| 2145 | 2149 |
| 2146 break; | 2150 break; |
| 2147 } | 2151 } |
| 2148 | 2152 |
| 2149 if (layer_impl == RootScrollLayer()) | 2153 if (layer_impl == InnerViewportScrollLayer() || |
| 2154 layer_impl == OuterViewportScrollLayer()) |
| 2150 unused_root_delta.Subtract(applied_delta); | 2155 unused_root_delta.Subtract(applied_delta); |
| 2151 | 2156 |
| 2152 did_lock_scrolling_layer_ = true; | 2157 did_lock_scrolling_layer_ = true; |
| 2153 if (!should_bubble_scrolls_) { | 2158 if (!should_bubble_scrolls_) { |
| 2154 active_tree_->SetCurrentlyScrollingLayer(layer_impl); | 2159 active_tree_->SetCurrentlyScrollingLayer(layer_impl); |
| 2155 break; | 2160 break; |
| 2156 } | 2161 } |
| 2157 | 2162 |
| 2158 // If the applied delta is within 45 degrees of the input delta, bail out to | 2163 // If the applied delta is within 45 degrees of the input delta, bail out to |
| 2159 // make it easier to scroll just one layer in one direction without | 2164 // make it easier to scroll just one layer in one direction without |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 bool LayerTreeHostImpl::ScrollVerticallyByPage(gfx::Point viewport_point, | 2211 bool LayerTreeHostImpl::ScrollVerticallyByPage(gfx::Point viewport_point, |
| 2207 ScrollDirection direction) { | 2212 ScrollDirection direction) { |
| 2208 DCHECK(wheel_scrolling_); | 2213 DCHECK(wheel_scrolling_); |
| 2209 | 2214 |
| 2210 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); | 2215 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); |
| 2211 layer_impl; | 2216 layer_impl; |
| 2212 layer_impl = layer_impl->parent()) { | 2217 layer_impl = layer_impl->parent()) { |
| 2213 if (!layer_impl->scrollable()) | 2218 if (!layer_impl->scrollable()) |
| 2214 continue; | 2219 continue; |
| 2215 | 2220 |
| 2216 if (!layer_impl->vertical_scrollbar_layer()) | 2221 if (!layer_impl->HasScrollbar(VERTICAL)) |
| 2217 continue; | 2222 continue; |
| 2218 | 2223 |
| 2219 float height = layer_impl->vertical_scrollbar_layer()->bounds().height(); | 2224 // TODO(wjmaclean) make sure this is ok! |
| 2225 float height = layer_impl->clip_height(); |
| 2220 | 2226 |
| 2221 // These magical values match WebKit and are designed to scroll nearly the | 2227 // These magical values match WebKit and are designed to scroll nearly the |
| 2222 // entire visible content height but leave a bit of overlap. | 2228 // entire visible content height but leave a bit of overlap. |
| 2223 float page = std::max(height * 0.875f, 1.f); | 2229 float page = std::max(height * 0.875f, 1.f); |
| 2224 if (direction == SCROLL_BACKWARD) | 2230 if (direction == SCROLL_BACKWARD) |
| 2225 page = -page; | 2231 page = -page; |
| 2226 | 2232 |
| 2227 gfx::Vector2dF delta = gfx::Vector2dF(0.f, page); | 2233 gfx::Vector2dF delta = gfx::Vector2dF(0.f, page); |
| 2228 | 2234 |
| 2229 gfx::Vector2dF applied_delta = ScrollLayerWithLocalDelta(layer_impl, delta); | 2235 gfx::Vector2dF applied_delta = ScrollLayerWithLocalDelta(layer_impl, delta); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 top_controls_manager_->ScrollEnd(); | 2271 top_controls_manager_->ScrollEnd(); |
| 2266 ClearCurrentlyScrollingLayer(); | 2272 ClearCurrentlyScrollingLayer(); |
| 2267 StartScrollbarAnimation(); | 2273 StartScrollbarAnimation(); |
| 2268 } | 2274 } |
| 2269 | 2275 |
| 2270 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { | 2276 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |
| 2271 if (!active_tree_->CurrentlyScrollingLayer()) | 2277 if (!active_tree_->CurrentlyScrollingLayer()) |
| 2272 return ScrollIgnored; | 2278 return ScrollIgnored; |
| 2273 | 2279 |
| 2274 if (settings_.ignore_root_layer_flings && | 2280 if (settings_.ignore_root_layer_flings && |
| 2275 active_tree_->CurrentlyScrollingLayer() == | 2281 (active_tree_->CurrentlyScrollingLayer() == InnerViewportScrollLayer() || |
| 2276 active_tree_->RootScrollLayer()) { | 2282 active_tree_->CurrentlyScrollingLayer() == OuterViewportScrollLayer())) { |
| 2277 ClearCurrentlyScrollingLayer(); | 2283 ClearCurrentlyScrollingLayer(); |
| 2278 return ScrollIgnored; | 2284 return ScrollIgnored; |
| 2279 } | 2285 } |
| 2280 | 2286 |
| 2281 if (!wheel_scrolling_) | 2287 if (!wheel_scrolling_) |
| 2282 should_bubble_scrolls_ = last_scroll_did_bubble_; | 2288 should_bubble_scrolls_ = last_scroll_did_bubble_; |
| 2283 | 2289 |
| 2284 return ScrollStarted; | 2290 return ScrollStarted; |
| 2285 } | 2291 } |
| 2286 | 2292 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2326 scroll_layer_impl->scrollbar_animation_controller(); | 2332 scroll_layer_impl->scrollbar_animation_controller(); |
| 2327 if (animation_controller) { | 2333 if (animation_controller) { |
| 2328 animation_controller->DidMouseMoveOffScrollbar( | 2334 animation_controller->DidMouseMoveOffScrollbar( |
| 2329 CurrentPhysicalTimeTicks()); | 2335 CurrentPhysicalTimeTicks()); |
| 2330 StartScrollbarAnimation(); | 2336 StartScrollbarAnimation(); |
| 2331 } | 2337 } |
| 2332 scroll_layer_id_when_mouse_over_scrollbar_ = 0; | 2338 scroll_layer_id_when_mouse_over_scrollbar_ = 0; |
| 2333 } | 2339 } |
| 2334 | 2340 |
| 2335 bool scroll_on_main_thread = false; | 2341 bool scroll_on_main_thread = false; |
| 2342 // wjm - what does FindScrollLayerForDeviceViewportPoint exactly do? |
| 2336 LayerImpl* scroll_layer_impl = FindScrollLayerForDeviceViewportPoint( | 2343 LayerImpl* scroll_layer_impl = FindScrollLayerForDeviceViewportPoint( |
| 2337 device_viewport_point, InputHandler::Gesture, layer_impl, | 2344 device_viewport_point, InputHandler::Gesture, layer_impl, |
| 2338 &scroll_on_main_thread); | 2345 &scroll_on_main_thread); |
| 2339 if (scroll_on_main_thread || !scroll_layer_impl) | 2346 if (scroll_on_main_thread || !scroll_layer_impl) |
| 2340 return; | 2347 return; |
| 2341 | 2348 |
| 2342 ScrollbarAnimationController* animation_controller = | 2349 ScrollbarAnimationController* animation_controller = |
| 2343 scroll_layer_impl->scrollbar_animation_controller(); | 2350 scroll_layer_impl->scrollbar_animation_controller(); |
| 2344 if (!animation_controller) | 2351 if (!animation_controller) |
| 2345 return; | 2352 return; |
| 2346 | 2353 |
| 2347 float distance_to_scrollbar = std::min( | 2354 // TODO(wjmaclean) What to do with this? is it ok to choose from more than |
| 2348 DeviceSpaceDistanceToLayer(device_viewport_point, | 2355 // two scrollbars? |
| 2349 scroll_layer_impl->horizontal_scrollbar_layer()), | 2356 float distance_to_scrollbar = std::numeric_limits<float>::max(); |
| 2350 DeviceSpaceDistanceToLayer(device_viewport_point, | 2357 for (LayerImpl::ScrollbarSet::iterator it = |
| 2351 scroll_layer_impl->vertical_scrollbar_layer())); | 2358 scroll_layer_impl->scrollbars()->begin(); |
| 2359 it != scroll_layer_impl->scrollbars()->end(); |
| 2360 ++it) |
| 2361 distance_to_scrollbar = std::min(distance_to_scrollbar, |
| 2362 DeviceSpaceDistanceToLayer(device_viewport_point, *it)); |
| 2352 | 2363 |
| 2353 bool should_animate = animation_controller->DidMouseMoveNear( | 2364 bool should_animate = animation_controller->DidMouseMoveNear( |
| 2354 CurrentPhysicalTimeTicks(), distance_to_scrollbar / device_scale_factor_); | 2365 CurrentPhysicalTimeTicks(), distance_to_scrollbar / device_scale_factor_); |
| 2355 if (should_animate) { | 2366 if (should_animate) { |
| 2356 client_->SetNeedsRedrawOnImplThread(); | 2367 client_->SetNeedsRedrawOnImplThread(); |
| 2357 StartScrollbarAnimation(); | 2368 StartScrollbarAnimation(); |
| 2358 } | 2369 } |
| 2359 } | 2370 } |
| 2360 | 2371 |
| 2361 bool LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl, | 2372 bool LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2375 } | 2386 } |
| 2376 | 2387 |
| 2377 return false; | 2388 return false; |
| 2378 } | 2389 } |
| 2379 | 2390 |
| 2380 void LayerTreeHostImpl::PinchGestureBegin() { | 2391 void LayerTreeHostImpl::PinchGestureBegin() { |
| 2381 pinch_gesture_active_ = true; | 2392 pinch_gesture_active_ = true; |
| 2382 previous_pinch_anchor_ = gfx::Point(); | 2393 previous_pinch_anchor_ = gfx::Point(); |
| 2383 client_->RenewTreePriority(); | 2394 client_->RenewTreePriority(); |
| 2384 pinch_gesture_end_should_clear_scrolling_layer_ = !CurrentlyScrollingLayer(); | 2395 pinch_gesture_end_should_clear_scrolling_layer_ = !CurrentlyScrollingLayer(); |
| 2385 active_tree_->SetCurrentlyScrollingLayer(RootScrollLayer()); | 2396 if (active_tree_->OuterViewportScrollLayer()) { |
| 2397 active_tree_->SetCurrentlyScrollingLayer( |
| 2398 active_tree_->OuterViewportScrollLayer()); |
| 2399 } else { |
| 2400 active_tree_->SetCurrentlyScrollingLayer( |
| 2401 active_tree_->InnerViewportScrollLayer()); |
| 2402 } |
| 2386 } | 2403 } |
| 2387 | 2404 |
| 2388 void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, | 2405 void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, |
| 2389 gfx::Point anchor) { | 2406 gfx::Point anchor) { |
| 2390 TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); | 2407 TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); |
| 2391 | 2408 |
| 2392 if (!RootScrollLayer()) | 2409 LayerImpl* pinch_scroll_layer = CurrentlyScrollingLayer(); |
| 2410 if (!pinch_scroll_layer) |
| 2411 pinch_scroll_layer = InnerViewportScrollLayer(); |
| 2412 |
| 2413 if (!pinch_scroll_layer) |
| 2393 return; | 2414 return; |
| 2394 | 2415 |
| 2395 // Keep the center-of-pinch anchor specified by (x, y) in a stable | 2416 // Keep the center-of-pinch anchor specified by (x, y) in a stable |
| 2396 // position over the course of the magnify. | 2417 // position over the course of the magnify. |
| 2397 float page_scale_delta = active_tree_->page_scale_delta(); | 2418 float page_scale_delta = active_tree_->page_scale_delta(); |
| 2398 gfx::PointF previous_scale_anchor = | 2419 gfx::PointF previous_scale_anchor = |
| 2399 gfx::ScalePoint(anchor, 1.f / page_scale_delta); | 2420 gfx::ScalePoint(anchor, 1.f / page_scale_delta); |
| 2400 active_tree_->SetPageScaleDelta(page_scale_delta * magnify_delta); | 2421 active_tree_->SetPageScaleDelta(page_scale_delta * magnify_delta); |
| 2401 page_scale_delta = active_tree_->page_scale_delta(); | 2422 page_scale_delta = active_tree_->page_scale_delta(); |
| 2402 gfx::PointF new_scale_anchor = | 2423 gfx::PointF new_scale_anchor = |
| 2403 gfx::ScalePoint(anchor, 1.f / page_scale_delta); | 2424 gfx::ScalePoint(anchor, 1.f / page_scale_delta); |
| 2404 gfx::Vector2dF move = previous_scale_anchor - new_scale_anchor; | 2425 gfx::Vector2dF move = previous_scale_anchor - new_scale_anchor; |
| 2405 | 2426 |
| 2406 previous_pinch_anchor_ = anchor; | 2427 previous_pinch_anchor_ = anchor; |
| 2407 | 2428 |
| 2408 move.Scale(1 / active_tree_->page_scale_factor()); | 2429 move.Scale(1 / active_tree_->page_scale_factor()); |
| 2430 // When shrinking the page, the current scroll offset of the inner viewport |
| 2431 // scroll layer may need to be adjusted so that it doesn't exceed its maximum |
| 2432 // at the new page scale factor. |
| 2433 if (magnify_delta < 1.f) { |
| 2434 // If clamping the inner viewport scroll offset causes a change, it should |
| 2435 // be accounted for from the intended move. |
| 2436 move -= InnerViewportScrollLayer()->ClampScrollToMaxScrollOffset(); |
| 2437 } |
| 2409 | 2438 |
| 2410 RootScrollLayer()->ScrollBy(move); | 2439 // We manually manage the bubbling behaviour here as it is different to that |
| 2440 // implemented in LayerTreeHostImpl::ScrollBy(). Specifically: |
| 2441 // 1) we want to explicit limit the bubbling to the outer/inner viewports, |
| 2442 // 2) we don't want the directional limitations on the unused parts that |
| 2443 // ScrollBy() implements, and |
| 2444 // 3) pinching should not engage the top controls manager. |
| 2445 gfx::Vector2dF unused = pinch_scroll_layer->ScrollBy(move); |
| 2411 | 2446 |
| 2447 if (!unused.IsZero() && pinch_scroll_layer == OuterViewportScrollLayer()) { |
| 2448 InnerViewportScrollLayer()->ScrollBy(unused); |
| 2449 InnerViewportScrollLayer()->ClampScrollToMaxScrollOffset(); |
| 2450 active_tree_->SetCurrentlyScrollingLayer( |
| 2451 active_tree_->InnerViewportScrollLayer()); |
| 2452 } |
| 2453 /* |
| 2454 // Don't enable during unit tests. |
| 2455 { |
| 2456 gfx::Vector2d maxi = InnerViewportScrollLayer()->MaxScrollOffset(); |
| 2457 gfx::Vector2d maxo = OuterViewportScrollLayer()->MaxScrollOffset(); |
| 2458 gfx::Vector2dF offi = InnerViewportScrollLayer()->TotalScrollOffset(); |
| 2459 gfx::Vector2dF offo = OuterViewportScrollLayer()->TotalScrollOffset(); |
| 2460 fprintf(stderr, "wjm: Viewport summary: ovsl = (%f,%f) of (%d,%d), ivsl = (%f,
%f) of (%d,%d)\n", |
| 2461 offo.x(), offo.y(), |
| 2462 maxo.x(), maxo.y(), |
| 2463 offi.x(), offi.y(), |
| 2464 maxi.x(), maxi.y()); |
| 2465 } |
| 2466 */ |
| 2412 client_->SetNeedsCommitOnImplThread(); | 2467 client_->SetNeedsCommitOnImplThread(); |
| 2413 client_->SetNeedsRedrawOnImplThread(); | 2468 client_->SetNeedsRedrawOnImplThread(); |
| 2414 client_->RenewTreePriority(); | 2469 client_->RenewTreePriority(); |
| 2415 } | 2470 } |
| 2416 | 2471 |
| 2417 void LayerTreeHostImpl::PinchGestureEnd() { | 2472 void LayerTreeHostImpl::PinchGestureEnd() { |
| 2418 pinch_gesture_active_ = false; | 2473 pinch_gesture_active_ = false; |
| 2419 if (pinch_gesture_end_should_clear_scrolling_layer_) { | 2474 if (pinch_gesture_end_should_clear_scrolling_layer_) { |
| 2420 pinch_gesture_end_should_clear_scrolling_layer_ = false; | 2475 pinch_gesture_end_should_clear_scrolling_layer_ = false; |
| 2421 ClearCurrentlyScrollingLayer(); | 2476 ClearCurrentlyScrollingLayer(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2450 active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta); | 2505 active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta); |
| 2451 | 2506 |
| 2452 return scroll_info.Pass(); | 2507 return scroll_info.Pass(); |
| 2453 } | 2508 } |
| 2454 | 2509 |
| 2455 void LayerTreeHostImpl::SetFullRootLayerDamage() { | 2510 void LayerTreeHostImpl::SetFullRootLayerDamage() { |
| 2456 SetViewportDamage(gfx::Rect(DrawViewportSize())); | 2511 SetViewportDamage(gfx::Rect(DrawViewportSize())); |
| 2457 } | 2512 } |
| 2458 | 2513 |
| 2459 void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks time) { | 2514 void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks time) { |
| 2460 if (!page_scale_animation_ || !RootScrollLayer()) | 2515 if (!page_scale_animation_) |
| 2461 return; | 2516 return; |
| 2462 | 2517 |
| 2463 double monotonic_time = (time - base::TimeTicks()).InSecondsF(); | 2518 double monotonic_time = (time - base::TimeTicks()).InSecondsF(); |
| 2464 gfx::Vector2dF scroll_total = RootScrollLayer()->scroll_offset() + | 2519 gfx::Vector2dF scroll_total = active_tree_->TotalScrollOffset(); |
| 2465 RootScrollLayer()->ScrollDelta(); | |
| 2466 | 2520 |
| 2467 if (!page_scale_animation_->IsAnimationStarted()) | 2521 if (!page_scale_animation_->IsAnimationStarted()) |
| 2468 page_scale_animation_->StartAnimation(monotonic_time); | 2522 page_scale_animation_->StartAnimation(monotonic_time); |
| 2469 | 2523 |
| 2470 active_tree_->SetPageScaleDelta( | 2524 active_tree_->SetPageScaleDelta( |
| 2471 page_scale_animation_->PageScaleFactorAtTime(monotonic_time) / | 2525 page_scale_animation_->PageScaleFactorAtTime(monotonic_time) / |
| 2472 active_tree_->page_scale_factor()); | 2526 active_tree_->page_scale_factor()); |
| 2473 gfx::Vector2dF next_scroll = | 2527 gfx::Vector2dF next_scroll = |
| 2474 page_scale_animation_->ScrollOffsetAtTime(monotonic_time); | 2528 page_scale_animation_->ScrollOffsetAtTime(monotonic_time); |
| 2475 | 2529 |
| 2476 RootScrollLayer()->ScrollBy(next_scroll - scroll_total); | 2530 ScrollBy(gfx::Point(), next_scroll - scroll_total); |
| 2477 client_->SetNeedsRedrawOnImplThread(); | 2531 client_->SetNeedsRedrawOnImplThread(); |
| 2478 | 2532 |
| 2479 if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) { | 2533 if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) { |
| 2480 page_scale_animation_.reset(); | 2534 page_scale_animation_.reset(); |
| 2481 client_->SetNeedsCommitOnImplThread(); | 2535 client_->SetNeedsCommitOnImplThread(); |
| 2482 client_->RenewTreePriority(); | 2536 client_->RenewTreePriority(); |
| 2483 } | 2537 } |
| 2484 } | 2538 } |
| 2485 | 2539 |
| 2486 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { | 2540 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { |
| 2487 if (!top_controls_manager_ || !RootScrollLayer()) | 2541 if (!top_controls_manager_) |
| 2488 return; | 2542 return; |
| 2489 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); | 2543 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); |
| 2490 UpdateMaxScrollOffset(); | 2544 if (active_tree_->TotalScrollOffset().y() == 0.f) |
| 2491 if (RootScrollLayer()->TotalScrollOffset().y() == 0.f) | |
| 2492 return; | 2545 return; |
| 2493 RootScrollLayer()->ScrollBy(gfx::ScaleVector2d( | 2546 ScrollBy(gfx::Point(), |
| 2494 scroll, 1.f / active_tree_->total_page_scale_factor())); | 2547 gfx::ScaleVector2d(scroll, |
| 2548 1.f / active_tree_->total_page_scale_factor())); |
| 2495 } | 2549 } |
| 2496 | 2550 |
| 2497 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, | 2551 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, |
| 2498 base::Time wall_clock_time) { | 2552 base::Time wall_clock_time) { |
| 2499 if (!settings_.accelerated_animation_enabled || | 2553 if (!settings_.accelerated_animation_enabled || |
| 2500 animation_registrar_->active_animation_controllers().empty() || | 2554 animation_registrar_->active_animation_controllers().empty() || |
| 2501 !active_tree_->root_layer()) | 2555 !active_tree_->root_layer()) |
| 2502 return; | 2556 return; |
| 2503 | 2557 |
| 2504 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); | 2558 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 std::set<UIResourceId>::iterator found_in_evicted = | 2870 std::set<UIResourceId>::iterator found_in_evicted = |
| 2817 evicted_ui_resources_.find(uid); | 2871 evicted_ui_resources_.find(uid); |
| 2818 if (found_in_evicted == evicted_ui_resources_.end()) | 2872 if (found_in_evicted == evicted_ui_resources_.end()) |
| 2819 return; | 2873 return; |
| 2820 evicted_ui_resources_.erase(found_in_evicted); | 2874 evicted_ui_resources_.erase(found_in_evicted); |
| 2821 if (evicted_ui_resources_.empty()) | 2875 if (evicted_ui_resources_.empty()) |
| 2822 client_->OnCanDrawStateChanged(CanDraw()); | 2876 client_->OnCanDrawStateChanged(CanDraw()); |
| 2823 } | 2877 } |
| 2824 | 2878 |
| 2825 } // namespace cc | 2879 } // namespace cc |
| OLD | NEW |