| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 // means a new max texture size which affects draw properties. Also, if the | 2334 // means a new max texture size which affects draw properties. Also, if the |
| 2335 // draw properties were up to date, layers still lost resources and we need to | 2335 // draw properties were up to date, layers still lost resources and we need to |
| 2336 // UpdateDrawProperties() after calling RecreateTreeResources(). | 2336 // UpdateDrawProperties() after calling RecreateTreeResources(). |
| 2337 active_tree_->set_needs_update_draw_properties(); | 2337 active_tree_->set_needs_update_draw_properties(); |
| 2338 if (pending_tree_) | 2338 if (pending_tree_) |
| 2339 pending_tree_->set_needs_update_draw_properties(); | 2339 pending_tree_->set_needs_update_draw_properties(); |
| 2340 | 2340 |
| 2341 CreateTileManagerResources(); | 2341 CreateTileManagerResources(); |
| 2342 RecreateTreeResources(); | 2342 RecreateTreeResources(); |
| 2343 | 2343 |
| 2344 // TODO(brianderson): Don't use a hard-coded parent draw time. | |
| 2345 base::TimeDelta parent_draw_time = | |
| 2346 compositor_frame_sink_->capabilities().adjust_deadline_for_parent | |
| 2347 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | |
| 2348 : base::TimeDelta(); | |
| 2349 client_->SetEstimatedParentDrawTime(parent_draw_time); | |
| 2350 client_->OnCanDrawStateChanged(CanDraw()); | 2344 client_->OnCanDrawStateChanged(CanDraw()); |
| 2351 SetFullViewportDamage(); | 2345 SetFullViewportDamage(); |
| 2352 // There will not be anything to draw here, so set high res | 2346 // There will not be anything to draw here, so set high res |
| 2353 // to avoid checkerboards, typically when we are recovering | 2347 // to avoid checkerboards, typically when we are recovering |
| 2354 // from lost context. | 2348 // from lost context. |
| 2355 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. | 2349 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. |
| 2356 SetRequiresHighResToDraw(); | 2350 SetRequiresHighResToDraw(); |
| 2357 | 2351 |
| 2358 return true; | 2352 return true; |
| 2359 } | 2353 } |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4190 if (is_visible) { | 4184 if (is_visible) { |
| 4191 worker_context_visibility_ = | 4185 worker_context_visibility_ = |
| 4192 worker_context->CacheController()->ClientBecameVisible(); | 4186 worker_context->CacheController()->ClientBecameVisible(); |
| 4193 } else { | 4187 } else { |
| 4194 worker_context->CacheController()->ClientBecameNotVisible( | 4188 worker_context->CacheController()->ClientBecameNotVisible( |
| 4195 std::move(worker_context_visibility_)); | 4189 std::move(worker_context_visibility_)); |
| 4196 } | 4190 } |
| 4197 } | 4191 } |
| 4198 | 4192 |
| 4199 } // namespace cc | 4193 } // namespace cc |
| OLD | NEW |