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 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1464 static_cast<int>(resource_pool_->memory_usage_bytes() / kMegabyte)); | 1464 static_cast<int>(resource_pool_->memory_usage_bytes() / kMegabyte)); |
1465 } | 1465 } |
1466 | 1466 |
1467 resource_pool_->CheckBusyResources(); | 1467 resource_pool_->CheckBusyResources(); |
1468 resource_pool_->ReduceResourceUsage(); | 1468 resource_pool_->ReduceResourceUsage(); |
1469 } | 1469 } |
1470 | 1470 |
1471 // If we're not visible, we likely released resources, so we want to | 1471 // If we're not visible, we likely released resources, so we want to |
1472 // aggressively flush here to make sure those DeleteTextures make it to the | 1472 // aggressively flush here to make sure those DeleteTextures make it to the |
1473 // GPU process to free up the memory. | 1473 // GPU process to free up the memory. |
1474 if (compositor_frame_sink_->context_provider() && !visible_) { | 1474 if (!visible_) { |
vmpstr
2017/01/09 21:43:43
nit: no braces
| |
1475 compositor_frame_sink_->context_provider() | 1475 resource_provider_->FlushPendingDeletions(); |
1476 ->ContextGL() | |
1477 ->ShallowFlushCHROMIUM(); | |
1478 } | 1476 } |
1479 } | 1477 } |
1480 | 1478 |
1481 void LayerTreeHostImpl::OnDraw(const gfx::Transform& transform, | 1479 void LayerTreeHostImpl::OnDraw(const gfx::Transform& transform, |
1482 const gfx::Rect& viewport, | 1480 const gfx::Rect& viewport, |
1483 bool resourceless_software_draw) { | 1481 bool resourceless_software_draw) { |
1484 DCHECK(!resourceless_software_draw_); | 1482 DCHECK(!resourceless_software_draw_); |
1485 const bool transform_changed = external_transform_ != transform; | 1483 const bool transform_changed = external_transform_ != transform; |
1486 const bool viewport_changed = external_viewport_ != viewport; | 1484 const bool viewport_changed = external_viewport_ != viewport; |
1487 | 1485 |
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4088 worker_context_visibility_ = | 4086 worker_context_visibility_ = |
4089 worker_context->CacheController()->ClientBecameVisible(); | 4087 worker_context->CacheController()->ClientBecameVisible(); |
4090 } else { | 4088 } else { |
4091 worker_context->CacheController()->ClientBecameNotVisible( | 4089 worker_context->CacheController()->ClientBecameNotVisible( |
4092 std::move(worker_context_visibility_)); | 4090 std::move(worker_context_visibility_)); |
4093 } | 4091 } |
4094 } | 4092 } |
4095 } | 4093 } |
4096 | 4094 |
4097 } // namespace cc | 4095 } // namespace cc |
OLD | NEW |