| 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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 CreateAndSetTileManager(resource_provider_.get(), | 1892 CreateAndSetTileManager(resource_provider_.get(), |
| 1893 NULL, | 1893 NULL, |
| 1894 GetRendererCapabilities().using_map_image); | 1894 GetRendererCapabilities().using_map_image); |
| 1895 DCHECK(tile_manager_); | 1895 DCHECK(tile_manager_); |
| 1896 | 1896 |
| 1897 SetOffscreenContextProvider(NULL); | 1897 SetOffscreenContextProvider(NULL); |
| 1898 | 1898 |
| 1899 client_->SetNeedsCommitOnImplThread(); | 1899 client_->SetNeedsCommitOnImplThread(); |
| 1900 } | 1900 } |
| 1901 | 1901 |
| 1902 void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { | 1902 void LayerTreeHostImpl::SetViewportSize(const gfx::Size& device_viewport_size) { |
| 1903 if (device_viewport_size == device_viewport_size_) | 1903 if (device_viewport_size == device_viewport_size_) |
| 1904 return; | 1904 return; |
| 1905 | 1905 |
| 1906 if (pending_tree_) | 1906 if (pending_tree_) |
| 1907 active_tree_->SetViewportSizeInvalid(); | 1907 active_tree_->SetViewportSizeInvalid(); |
| 1908 | 1908 |
| 1909 device_viewport_size_ = device_viewport_size; | 1909 device_viewport_size_ = device_viewport_size; |
| 1910 | 1910 |
| 1911 UpdateMaxScrollOffset(); | 1911 UpdateMaxScrollOffset(); |
| 1912 | 1912 |
| 1913 client_->OnCanDrawStateChanged(CanDraw()); | 1913 client_->OnCanDrawStateChanged(CanDraw()); |
| 1914 SetFullRootLayerDamage(); | 1914 SetFullRootLayerDamage(); |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 void LayerTreeHostImpl::SetOverdrawBottomHeight(float overdraw_bottom_height) { | 1917 void LayerTreeHostImpl::SetOverdrawBottomHeight(float overdraw_bottom_height) { |
| 1918 if (overdraw_bottom_height == overdraw_bottom_height_) | 1918 if (overdraw_bottom_height == overdraw_bottom_height_) |
| 1919 return; | 1919 return; |
| 1920 overdraw_bottom_height_ = overdraw_bottom_height; | 1920 overdraw_bottom_height_ = overdraw_bottom_height; |
| 1921 | 1921 |
| 1922 UpdateMaxScrollOffset(); | 1922 UpdateMaxScrollOffset(); |
| 1923 SetFullRootLayerDamage(); | 1923 SetFullRootLayerDamage(); |
| 1924 } | 1924 } |
| 1925 | 1925 |
| 1926 void LayerTreeHostImpl::SetOverhangUIResource( | 1926 void LayerTreeHostImpl::SetOverhangUIResource( |
| 1927 UIResourceId overhang_ui_resource_id, | 1927 UIResourceId overhang_ui_resource_id, |
| 1928 gfx::Size overhang_ui_resource_size) { | 1928 const gfx::Size& overhang_ui_resource_size) { |
| 1929 overhang_ui_resource_id_ = overhang_ui_resource_id; | 1929 overhang_ui_resource_id_ = overhang_ui_resource_id; |
| 1930 overhang_ui_resource_size_ = overhang_ui_resource_size; | 1930 overhang_ui_resource_size_ = overhang_ui_resource_size; |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { | 1933 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { |
| 1934 if (device_scale_factor == device_scale_factor_) | 1934 if (device_scale_factor == device_scale_factor_) |
| 1935 return; | 1935 return; |
| 1936 device_scale_factor_ = device_scale_factor; | 1936 device_scale_factor_ = device_scale_factor; |
| 1937 | 1937 |
| 1938 UpdateMaxScrollOffset(); | 1938 UpdateMaxScrollOffset(); |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2922 swap_promise_monitor_.erase(monitor); | 2922 swap_promise_monitor_.erase(monitor); |
| 2923 } | 2923 } |
| 2924 | 2924 |
| 2925 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 2925 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 2926 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 2926 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 2927 for (; it != swap_promise_monitor_.end(); it++) | 2927 for (; it != swap_promise_monitor_.end(); it++) |
| 2928 (*it)->OnSetNeedsRedrawOnImpl(); | 2928 (*it)->OnSetNeedsRedrawOnImpl(); |
| 2929 } | 2929 } |
| 2930 | 2930 |
| 2931 } // namespace cc | 2931 } // namespace cc |
| OLD | NEW |