| 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1051   UMA_HISTOGRAM_CUSTOM_COUNTS( |  1051   UMA_HISTOGRAM_CUSTOM_COUNTS( | 
|  1052       "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20); |  1052       "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20); | 
|  1053  |  1053  | 
|  1054   bool update_lcd_text = false; |  1054   bool update_lcd_text = false; | 
|  1055   bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); |  1055   bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); | 
|  1056   DCHECK(ok) << "UpdateDrawProperties failed during draw"; |  1056   DCHECK(ok) << "UpdateDrawProperties failed during draw"; | 
|  1057  |  1057  | 
|  1058   // This will cause NotifyTileStateChanged() to be called for any visible tiles |  1058   // This will cause NotifyTileStateChanged() to be called for any visible tiles | 
|  1059   // that completed, which will add damage to the frame for them so they appear |  1059   // that completed, which will add damage to the frame for them so they appear | 
|  1060   // as part of the current frame being drawn. |  1060   // as part of the current frame being drawn. | 
|  1061   if (settings().impl_side_painting) |  1061   if (tile_manager_) | 
|  1062     tile_manager_->UpdateVisibleTiles(global_tile_state_); |  1062     tile_manager_->UpdateVisibleTiles(global_tile_state_); | 
|  1063  |  1063  | 
|  1064   frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); |  1064   frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); | 
|  1065   frame->render_passes.clear(); |  1065   frame->render_passes.clear(); | 
|  1066   frame->render_passes_by_id.clear(); |  1066   frame->render_passes_by_id.clear(); | 
|  1067   frame->will_draw_layers.clear(); |  1067   frame->will_draw_layers.clear(); | 
|  1068   frame->has_no_damage = false; |  1068   frame->has_no_damage = false; | 
|  1069  |  1069  | 
|  1070   if (active_tree_->root_layer()) { |  1070   if (active_tree_->root_layer()) { | 
|  1071     gfx::Rect device_viewport_damage_rect = viewport_damage_rect_; |  1071     gfx::Rect device_viewport_damage_rect = viewport_damage_rect_; | 
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1691  |  1691  | 
|  1692   outer_container->SetBoundsDelta(delta); |  1692   outer_container->SetBoundsDelta(delta); | 
|  1693   active_tree_->InnerViewportScrollLayer()->SetBoundsDelta(delta); |  1693   active_tree_->InnerViewportScrollLayer()->SetBoundsDelta(delta); | 
|  1694  |  1694  | 
|  1695   anchor.ResetViewportToAnchoredPosition(); |  1695   anchor.ResetViewportToAnchoredPosition(); | 
|  1696 } |  1696 } | 
|  1697  |  1697  | 
|  1698 void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() { |  1698 void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() { | 
|  1699   // Only valid for the single-threaded non-scheduled/synchronous case |  1699   // Only valid for the single-threaded non-scheduled/synchronous case | 
|  1700   // using the zero copy raster worker pool. |  1700   // using the zero copy raster worker pool. | 
|  1701   single_thread_synchronous_task_graph_runner_->RunUntilIdle(); |  1701   if (tile_manager_) | 
 |  1702     single_thread_synchronous_task_graph_runner_->RunUntilIdle(); | 
|  1702 } |  1703 } | 
|  1703  |  1704  | 
|  1704 void LayerTreeHostImpl::DidLoseOutputSurface() { |  1705 void LayerTreeHostImpl::DidLoseOutputSurface() { | 
|  1705   if (resource_provider_) |  1706   if (resource_provider_) | 
|  1706     resource_provider_->DidLoseOutputSurface(); |  1707     resource_provider_->DidLoseOutputSurface(); | 
|  1707   client_->DidLoseOutputSurfaceOnImplThread(); |  1708   client_->DidLoseOutputSurfaceOnImplThread(); | 
|  1708 } |  1709 } | 
|  1709  |  1710  | 
|  1710 bool LayerTreeHostImpl::HaveRootScrollLayer() const { |  1711 bool LayerTreeHostImpl::HaveRootScrollLayer() const { | 
|  1711   return !!InnerViewportScrollLayer(); |  1712   return !!InnerViewportScrollLayer(); | 
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2122       proxy_->blocking_main_thread_task_runner(), |  2123       proxy_->blocking_main_thread_task_runner(), | 
|  2123       settings_.renderer_settings.highp_threshold_min, |  2124       settings_.renderer_settings.highp_threshold_min, | 
|  2124       settings_.renderer_settings.use_rgba_4444_textures, |  2125       settings_.renderer_settings.use_rgba_4444_textures, | 
|  2125       settings_.renderer_settings.texture_id_allocation_chunk_size); |  2126       settings_.renderer_settings.texture_id_allocation_chunk_size); | 
|  2126  |  2127  | 
|  2127   if (output_surface_->capabilities().deferred_gl_initialization) |  2128   if (output_surface_->capabilities().deferred_gl_initialization) | 
|  2128     EnforceZeroBudget(true); |  2129     EnforceZeroBudget(true); | 
|  2129  |  2130  | 
|  2130   CreateAndSetRenderer(); |  2131   CreateAndSetRenderer(); | 
|  2131  |  2132  | 
|  2132   if (settings_.impl_side_painting) |  2133   if (settings_.impl_side_painting && settings_.raster_enabled) | 
|  2133     CreateAndSetTileManager(); |  2134     CreateAndSetTileManager(); | 
|  2134   RecreateTreeResources(); |  2135   RecreateTreeResources(); | 
|  2135  |  2136  | 
|  2136   // Initialize vsync parameters to sane values. |  2137   // Initialize vsync parameters to sane values. | 
|  2137   const base::TimeDelta display_refresh_interval = |  2138   const base::TimeDelta display_refresh_interval = | 
|  2138       base::TimeDelta::FromMicroseconds( |  2139       base::TimeDelta::FromMicroseconds( | 
|  2139           base::Time::kMicrosecondsPerSecond / |  2140           base::Time::kMicrosecondsPerSecond / | 
|  2140           settings_.renderer_settings.refresh_rate); |  2141           settings_.renderer_settings.refresh_rate); | 
|  2141   CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |  2142   CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 
|  2142  |  2143  | 
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3450     (*it)->OnSetNeedsRedrawOnImpl(); |  3451     (*it)->OnSetNeedsRedrawOnImpl(); | 
|  3451 } |  3452 } | 
|  3452  |  3453  | 
|  3453 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { |  3454 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { | 
|  3454   std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |  3455   std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 
|  3455   for (; it != swap_promise_monitor_.end(); it++) |  3456   for (; it != swap_promise_monitor_.end(); it++) | 
|  3456     (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); |  3457     (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); | 
|  3457 } |  3458 } | 
|  3458  |  3459  | 
|  3459 }  // namespace cc |  3460 }  // namespace cc | 
| OLD | NEW |