| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 if (!m_timeSourceClientAdapter) | 524 if (!m_timeSourceClientAdapter) |
| 525 m_timeSourceClientAdapter = LayerTreeHostImplTimeSourceAdapter::create(t
his, DelayBasedTimeSource::create(lowFrequencyAnimationInterval(), m_proxy->curr
entThread())); | 525 m_timeSourceClientAdapter = LayerTreeHostImplTimeSourceAdapter::create(t
his, DelayBasedTimeSource::create(lowFrequencyAnimationInterval(), m_proxy->curr
entThread())); |
| 526 | 526 |
| 527 m_timeSourceClientAdapter->setActive(enabled); | 527 m_timeSourceClientAdapter->setActive(enabled); |
| 528 } | 528 } |
| 529 | 529 |
| 530 gfx::Size LayerTreeHostImpl::contentSize() const | 530 gfx::Size LayerTreeHostImpl::contentSize() const |
| 531 { | 531 { |
| 532 // TODO(aelias): Hardcoding the first child here is weird. Think of | 532 // TODO(aelias): Hardcoding the first child here is weird. Think of |
| 533 // a cleaner way to get the contentBounds on the Impl side. | 533 // a cleaner way to get the contentBounds on the Impl side. |
| 534 if (!m_rootScrollLayerImpl || m_rootScrollLayerImpl->children().isEmpty()) | 534 if (!m_rootScrollLayerImpl || m_rootScrollLayerImpl->children().empty()) |
| 535 return gfx::Size(); | 535 return gfx::Size(); |
| 536 return m_rootScrollLayerImpl->children()[0]->contentBounds(); | 536 return m_rootScrollLayerImpl->children()[0]->contentBounds(); |
| 537 } | 537 } |
| 538 | 538 |
| 539 static inline RenderPass* findRenderPassById(RenderPass::Id renderPassId, const
LayerTreeHostImpl::FrameData& frame) | 539 static inline RenderPass* findRenderPassById(RenderPass::Id renderPassId, const
LayerTreeHostImpl::FrameData& frame) |
| 540 { | 540 { |
| 541 RenderPassIdHashMap::const_iterator it = frame.renderPassesById.find(renderP
assId); | 541 RenderPassIdHashMap::const_iterator it = frame.renderPassesById.find(renderP
assId); |
| 542 DCHECK(it != frame.renderPassesById.end()); | 542 DCHECK(it != frame.renderPassesById.end()); |
| 543 return it->second; | 543 return it->second; |
| 544 } | 544 } |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1505 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
| 1506 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1506 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
| 1507 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1507 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
| 1508 m_client->setNeedsRedrawOnImplThread(); | 1508 m_client->setNeedsRedrawOnImplThread(); |
| 1509 | 1509 |
| 1510 for (size_t i = 0; i < layer->children().size(); ++i) | 1510 for (size_t i = 0; i < layer->children().size(); ++i) |
| 1511 animateScrollbarsRecursive(layer->children()[i], time); | 1511 animateScrollbarsRecursive(layer->children()[i], time); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 } // namespace cc | 1514 } // namespace cc |
| OLD | NEW |