| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 bool LayerTreeHostImpl::IsContextLost() { | 1395 bool LayerTreeHostImpl::IsContextLost() { |
| 1396 DCHECK(proxy_->IsImplThread()); | 1396 DCHECK(proxy_->IsImplThread()); |
| 1397 return renderer_ && renderer_->IsContextLost(); | 1397 return renderer_ && renderer_->IsContextLost(); |
| 1398 } | 1398 } |
| 1399 | 1399 |
| 1400 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { | 1400 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { |
| 1401 return renderer_->Capabilities(); | 1401 return renderer_->Capabilities(); |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { | 1404 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
| 1405 if (frame.has_no_damage) | 1405 if (frame.has_no_damage) { |
| 1406 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); |
| 1406 return false; | 1407 return false; |
| 1408 } |
| 1407 renderer_->SwapBuffers(); | 1409 renderer_->SwapBuffers(); |
| 1408 active_tree_->ClearLatencyInfo(); | 1410 active_tree_->ClearLatencyInfo(); |
| 1411 active_tree()->FinishSwapPromises(); |
| 1409 return true; | 1412 return true; |
| 1410 } | 1413 } |
| 1411 | 1414 |
| 1412 void LayerTreeHostImpl::SetNeedsBeginImplFrame(bool enable) { | 1415 void LayerTreeHostImpl::SetNeedsBeginImplFrame(bool enable) { |
| 1413 if (output_surface_) | 1416 if (output_surface_) |
| 1414 output_surface_->SetNeedsBeginImplFrame(enable); | 1417 output_surface_->SetNeedsBeginImplFrame(enable); |
| 1415 } | 1418 } |
| 1416 | 1419 |
| 1417 gfx::SizeF LayerTreeHostImpl::UnscaledScrollableViewportSize() const { | 1420 gfx::SizeF LayerTreeHostImpl::UnscaledScrollableViewportSize() const { |
| 1418 // Use the root container layer bounds if it clips to them, otherwise, the | 1421 // Use the root container layer bounds if it clips to them, otherwise, the |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 if (evicted_ui_resources_.empty()) | 2845 if (evicted_ui_resources_.empty()) |
| 2843 client_->OnCanDrawStateChanged(CanDraw()); | 2846 client_->OnCanDrawStateChanged(CanDraw()); |
| 2844 } | 2847 } |
| 2845 | 2848 |
| 2846 void LayerTreeHostImpl::ScheduleMicroBenchmark( | 2849 void LayerTreeHostImpl::ScheduleMicroBenchmark( |
| 2847 scoped_ptr<MicroBenchmarkImpl> benchmark) { | 2850 scoped_ptr<MicroBenchmarkImpl> benchmark) { |
| 2848 micro_benchmark_controller_.ScheduleRun(benchmark.Pass()); | 2851 micro_benchmark_controller_.ScheduleRun(benchmark.Pass()); |
| 2849 } | 2852 } |
| 2850 | 2853 |
| 2851 } // namespace cc | 2854 } // namespace cc |
| OLD | NEW |