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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 // in the proper places and update the notifyIfCanDrawChanged test. | 216 // in the proper places and update the notifyIfCanDrawChanged test. |
217 | 217 |
218 if (!rootLayer()) { | 218 if (!rootLayer()) { |
219 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no root layer"); | 219 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no root layer"); |
220 return false; | 220 return false; |
221 } | 221 } |
222 if (deviceViewportSize().IsEmpty()) { | 222 if (deviceViewportSize().IsEmpty()) { |
223 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw empty viewport"); | 223 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw empty viewport"); |
224 return false; | 224 return false; |
225 } | 225 } |
226 if (deviceViewportSize() != activeTree()->device_viewport_size()) { | |
227 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw viewport resize i ncomplete"); | |
228 return false; | |
229 } | |
226 if (!m_renderer) { | 230 if (!m_renderer) { |
227 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no renderer"); | 231 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no renderer"); |
228 return false; | 232 return false; |
229 } | 233 } |
230 if (m_activeTree->ContentsTexturesPurged()) { | 234 if (m_activeTree->ContentsTexturesPurged()) { |
231 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw contents textures purged"); | 235 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw contents textures purged"); |
232 return false; | 236 return false; |
233 } | 237 } |
234 return true; | 238 return true; |
235 } | 239 } |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1086 | 1090 |
1087 return true; | 1091 return true; |
1088 } | 1092 } |
1089 | 1093 |
1090 void LayerTreeHostImpl::setViewportSize(const gfx::Size& layoutViewportSize, con st gfx::Size& deviceViewportSize) | 1094 void LayerTreeHostImpl::setViewportSize(const gfx::Size& layoutViewportSize, con st gfx::Size& deviceViewportSize) |
1091 { | 1095 { |
1092 if (layoutViewportSize == m_layoutViewportSize && deviceViewportSize == m_de viceViewportSize) | 1096 if (layoutViewportSize == m_layoutViewportSize && deviceViewportSize == m_de viceViewportSize) |
1093 return; | 1097 return; |
1094 | 1098 |
1095 m_layoutViewportSize = layoutViewportSize; | 1099 m_layoutViewportSize = layoutViewportSize; |
1096 m_deviceViewportSize = deviceViewportSize; | 1100 m_deviceViewportSize = deviceViewportSize; |
danakj
2013/02/13 05:44:30
Can you just remove the m_deviceViewportSize from
| |
1097 | 1101 |
1102 if (m_settings.implSidePainting) | |
1103 pendingTree()->SetDeviceViewportSize(deviceViewportSize); | |
1104 else | |
1105 activeTree()->SetDeviceViewportSize(deviceViewportSize); | |
1106 | |
1098 updateMaxScrollOffset(); | 1107 updateMaxScrollOffset(); |
1099 | 1108 |
1100 if (m_renderer) | 1109 if (m_renderer) |
1101 m_renderer->viewportChanged(); | 1110 m_renderer->viewportChanged(); |
danakj
2013/02/13 05:44:30
You want this to happen when the active tree's vie
| |
1102 | 1111 |
1103 m_client->onCanDrawStateChanged(canDraw()); | 1112 m_client->onCanDrawStateChanged(canDraw()); |
1104 } | 1113 } |
1105 | 1114 |
1106 static void adjustScrollsForPageScaleChange(LayerImpl* layerImpl, float pageScal eChange) | 1115 static void adjustScrollsForPageScaleChange(LayerImpl* layerImpl, float pageScal eChange) |
1107 { | 1116 { |
1108 if (!layerImpl) | 1117 if (!layerImpl) |
1109 return; | 1118 return; |
1110 | 1119 |
1111 if (layerImpl->scrollable()) { | 1120 if (layerImpl->scrollable()) { |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1728 if (m_tileManager) | 1737 if (m_tileManager) |
1729 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ()); | 1738 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ()); |
1730 } | 1739 } |
1731 | 1740 |
1732 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) | 1741 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) |
1733 { | 1742 { |
1734 m_paintTimeCounter->SavePaintTime(totalPaintTime); | 1743 m_paintTimeCounter->SavePaintTime(totalPaintTime); |
1735 } | 1744 } |
1736 | 1745 |
1737 } // namespace cc | 1746 } // namespace cc |
OLD | NEW |