| 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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // in the proper places and update the notifyIfCanDrawChanged test. | 227 // in the proper places and update the notifyIfCanDrawChanged test. |
| 228 | 228 |
| 229 if (!rootLayer()) { | 229 if (!rootLayer()) { |
| 230 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no root layer"); | 230 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no root layer"); |
| 231 return false; | 231 return false; |
| 232 } | 232 } |
| 233 if (deviceViewportSize().IsEmpty()) { | 233 if (deviceViewportSize().IsEmpty()) { |
| 234 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw empty viewport"); | 234 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw empty viewport"); |
| 235 return false; | 235 return false; |
| 236 } | 236 } |
| 237 if (m_activeTree->ViewportSizeInvalid()) { |
| 238 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw viewport size rec
ently changed"); |
| 239 return false; |
| 240 } |
| 237 if (!m_renderer) { | 241 if (!m_renderer) { |
| 238 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no renderer"); | 242 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no renderer"); |
| 239 return false; | 243 return false; |
| 240 } | 244 } |
| 241 if (m_activeTree->ContentsTexturesPurged()) { | 245 if (m_activeTree->ContentsTexturesPurged()) { |
| 242 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw contents textures
purged"); | 246 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw contents textures
purged"); |
| 243 return false; | 247 return false; |
| 244 } | 248 } |
| 245 return true; | 249 return true; |
| 246 } | 250 } |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 pendingTree()->set_needs_update_draw_properties(); | 1099 pendingTree()->set_needs_update_draw_properties(); |
| 1096 | 1100 |
| 1097 return true; | 1101 return true; |
| 1098 } | 1102 } |
| 1099 | 1103 |
| 1100 void LayerTreeHostImpl::setViewportSize(const gfx::Size& layoutViewportSize, con
st gfx::Size& deviceViewportSize) | 1104 void LayerTreeHostImpl::setViewportSize(const gfx::Size& layoutViewportSize, con
st gfx::Size& deviceViewportSize) |
| 1101 { | 1105 { |
| 1102 if (layoutViewportSize == m_layoutViewportSize && deviceViewportSize == m_de
viceViewportSize) | 1106 if (layoutViewportSize == m_layoutViewportSize && deviceViewportSize == m_de
viceViewportSize) |
| 1103 return; | 1107 return; |
| 1104 | 1108 |
| 1109 if (pendingTree() && m_deviceViewportSize != deviceViewportSize) |
| 1110 activeTree()->SetViewportSizeInvalid(); |
| 1111 |
| 1105 m_layoutViewportSize = layoutViewportSize; | 1112 m_layoutViewportSize = layoutViewportSize; |
| 1106 m_deviceViewportSize = deviceViewportSize; | 1113 m_deviceViewportSize = deviceViewportSize; |
| 1107 | 1114 |
| 1108 updateMaxScrollOffset(); | 1115 updateMaxScrollOffset(); |
| 1109 | 1116 |
| 1110 if (m_renderer) | 1117 if (m_renderer) |
| 1111 m_renderer->viewportChanged(); | 1118 m_renderer->viewportChanged(); |
| 1112 | 1119 |
| 1113 m_client->onCanDrawStateChanged(canDraw()); | 1120 m_client->onCanDrawStateChanged(canDraw()); |
| 1114 } | 1121 } |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 if (m_tileManager) | 1772 if (m_tileManager) |
| 1766 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); | 1773 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); |
| 1767 } | 1774 } |
| 1768 | 1775 |
| 1769 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) | 1776 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) |
| 1770 { | 1777 { |
| 1771 m_paintTimeCounter->SavePaintTime(totalPaintTime); | 1778 m_paintTimeCounter->SavePaintTime(totalPaintTime); |
| 1772 } | 1779 } |
| 1773 | 1780 |
| 1774 } // namespace cc | 1781 } // namespace cc |
| OLD | NEW |