| 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1393 bool LayerTreeHostImpl::IsContextLost() { | 1393 bool LayerTreeHostImpl::IsContextLost() { |
| 1394 DCHECK(proxy_->IsImplThread()); | 1394 DCHECK(proxy_->IsImplThread()); |
| 1395 return renderer_ && renderer_->IsContextLost(); | 1395 return renderer_ && renderer_->IsContextLost(); |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { | 1398 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { |
| 1399 return renderer_->Capabilities(); | 1399 return renderer_->Capabilities(); |
| 1400 } | 1400 } |
| 1401 | 1401 |
| 1402 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { | 1402 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
| 1403 if (frame.has_no_damage) | 1403 if (frame.has_no_damage) { |
| 1404 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); |
| 1404 return false; | 1405 return false; |
| 1406 } |
| 1405 renderer_->SwapBuffers(); | 1407 renderer_->SwapBuffers(); |
| 1406 active_tree_->ClearLatencyInfo(); | 1408 active_tree_->ClearLatencyInfo(); |
| 1409 active_tree()->FinishSwapPromises(); |
| 1407 return true; | 1410 return true; |
| 1408 } | 1411 } |
| 1409 | 1412 |
| 1410 void LayerTreeHostImpl::SetNeedsBeginImplFrame(bool enable) { | 1413 void LayerTreeHostImpl::SetNeedsBeginImplFrame(bool enable) { |
| 1411 if (output_surface_) | 1414 if (output_surface_) |
| 1412 output_surface_->SetNeedsBeginImplFrame(enable); | 1415 output_surface_->SetNeedsBeginImplFrame(enable); |
| 1413 } | 1416 } |
| 1414 | 1417 |
| 1415 gfx::SizeF LayerTreeHostImpl::UnscaledScrollableViewportSize() const { | 1418 gfx::SizeF LayerTreeHostImpl::UnscaledScrollableViewportSize() const { |
| 1416 // Use the root container layer bounds if it clips to them, otherwise, the | 1419 // Use the root container layer bounds if it clips to them, otherwise, the |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2835 std::set<UIResourceId>::iterator found_in_evicted = | 2838 std::set<UIResourceId>::iterator found_in_evicted = |
| 2836 evicted_ui_resources_.find(uid); | 2839 evicted_ui_resources_.find(uid); |
| 2837 if (found_in_evicted == evicted_ui_resources_.end()) | 2840 if (found_in_evicted == evicted_ui_resources_.end()) |
| 2838 return; | 2841 return; |
| 2839 evicted_ui_resources_.erase(found_in_evicted); | 2842 evicted_ui_resources_.erase(found_in_evicted); |
| 2840 if (evicted_ui_resources_.empty()) | 2843 if (evicted_ui_resources_.empty()) |
| 2841 client_->OnCanDrawStateChanged(CanDraw()); | 2844 client_->OnCanDrawStateChanged(CanDraw()); |
| 2842 } | 2845 } |
| 2843 | 2846 |
| 2844 } // namespace cc | 2847 } // namespace cc |
| OLD | NEW |