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 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 return settings_.gpu_rasterization_msaa_sample_count; | 1606 return settings_.gpu_rasterization_msaa_sample_count; |
1607 } | 1607 } |
1608 | 1608 |
1609 bool LayerTreeHostImpl::CanUseGpuRasterization() { | 1609 bool LayerTreeHostImpl::CanUseGpuRasterization() { |
1610 if (!(output_surface_ && output_surface_->context_provider() && | 1610 if (!(output_surface_ && output_surface_->context_provider() && |
1611 output_surface_->worker_context_provider())) | 1611 output_surface_->worker_context_provider())) |
1612 return false; | 1612 return false; |
1613 | 1613 |
1614 ContextProvider* context_provider = | 1614 ContextProvider* context_provider = |
1615 output_surface_->worker_context_provider(); | 1615 output_surface_->worker_context_provider(); |
1616 base::AutoLock context_lock(*context_provider->GetLock()); | 1616 ContextProvider::ScopedContextLock scoped_context(context_provider); |
| 1617 if (context_provider->HasBeenDestroyed()) |
| 1618 return false; |
1617 if (!context_provider->GrContext()) | 1619 if (!context_provider->GrContext()) |
1618 return false; | 1620 return false; |
1619 | 1621 |
1620 return true; | 1622 return true; |
1621 } | 1623 } |
1622 | 1624 |
1623 void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { | 1625 void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { |
1624 bool use_gpu = false; | 1626 bool use_gpu = false; |
1625 bool use_msaa = false; | 1627 bool use_msaa = false; |
1626 bool using_msaa_for_complex_content = | 1628 bool using_msaa_for_complex_content = |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3597 if (active_tree()) { | 3599 if (active_tree()) { |
3598 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); | 3600 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
3599 if (layer) | 3601 if (layer) |
3600 return layer->ScrollOffsetForAnimation(); | 3602 return layer->ScrollOffsetForAnimation(); |
3601 } | 3603 } |
3602 | 3604 |
3603 return gfx::ScrollOffset(); | 3605 return gfx::ScrollOffset(); |
3604 } | 3606 } |
3605 | 3607 |
3606 } // namespace cc | 3608 } // namespace cc |
OLD | NEW |