| 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 "web_layer_tree_view_impl.h" | 5 #include "web_layer_tree_view_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "cc/font_atlas.h" | 8 #include "cc/font_atlas.h" |
| 9 #include "cc/input_handler.h" | 9 #include "cc/input_handler.h" |
| 10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool WebLayerTreeViewImpl::commitRequested() const | 144 bool WebLayerTreeViewImpl::commitRequested() const |
| 145 { | 145 { |
| 146 return m_layerTreeHost->commitRequested(); | 146 return m_layerTreeHost->commitRequested(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void WebLayerTreeViewImpl::composite() | 149 void WebLayerTreeViewImpl::composite() |
| 150 { | 150 { |
| 151 m_layerTreeHost->composite(); | 151 m_layerTreeHost->composite(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // TODO(ajuma): Remove this after WebKit bug 106594 (which switches to using the
2-argument version) lands. | |
| 155 void WebLayerTreeViewImpl::updateAnimations(double frameBeginTimeSeconds) | |
| 156 { | |
| 157 base::TimeTicks frameBeginTime = base::TimeTicks::FromInternalValue(frameBeg
inTimeSeconds * base::Time::kMicrosecondsPerSecond); | |
| 158 m_layerTreeHost->updateAnimations(frameBeginTime, base::Time::Now()); | |
| 159 } | |
| 160 | |
| 161 void WebLayerTreeViewImpl::updateAnimations(double monotonicFrameBeginTimeSecond
s, double wallClockFrameBeginTimeSeconds) | 154 void WebLayerTreeViewImpl::updateAnimations(double monotonicFrameBeginTimeSecond
s, double wallClockFrameBeginTimeSeconds) |
| 162 { | 155 { |
| 163 base::TimeTicks monotonicFrameBeginTime = base::TimeTicks::FromInternalValue
(monotonicFrameBeginTimeSeconds * base::Time::kMicrosecondsPerSecond); | 156 base::TimeTicks monotonicFrameBeginTime = base::TimeTicks::FromInternalValue
(monotonicFrameBeginTimeSeconds * base::Time::kMicrosecondsPerSecond); |
| 164 base::Time wallClockFrameBeginTime = base::Time::FromDoubleT(wallClockFrameB
eginTimeSeconds); | 157 base::Time wallClockFrameBeginTime = base::Time::FromDoubleT(wallClockFrameB
eginTimeSeconds); |
| 165 m_layerTreeHost->updateAnimations(monotonicFrameBeginTime, wallClockFrameBeg
inTime); | 158 m_layerTreeHost->updateAnimations(monotonicFrameBeginTime, wallClockFrameBeg
inTime); |
| 166 } | 159 } |
| 167 | 160 |
| 168 void WebLayerTreeViewImpl::didStopFlinging() | 161 void WebLayerTreeViewImpl::didStopFlinging() |
| 169 { | 162 { |
| 170 m_layerTreeHost->didStopFlinging(); | 163 m_layerTreeHost->didStopFlinging(); |
| 171 } | 164 } |
| 172 | 165 |
| 173 bool WebLayerTreeViewImpl::compositeAndReadback(void *pixels, const WebRect& rec
t) | 166 bool WebLayerTreeViewImpl::compositeAndReadback(void *pixels, const WebRect& rec
t) |
| 174 { | 167 { |
| 175 return m_layerTreeHost->compositeAndReadback(pixels, rect); | 168 return m_layerTreeHost->compositeAndReadback(pixels, rect); |
| 176 } | 169 } |
| 177 | 170 |
| 178 void WebLayerTreeViewImpl::finishAllRendering() | 171 void WebLayerTreeViewImpl::finishAllRendering() |
| 179 { | 172 { |
| 180 m_layerTreeHost->finishAllRendering(); | 173 m_layerTreeHost->finishAllRendering(); |
| 181 } | 174 } |
| 182 | 175 |
| 183 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) | 176 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) |
| 184 { | 177 { |
| 185 m_layerTreeHost->setDeferCommits(deferCommits); | 178 m_layerTreeHost->setDeferCommits(deferCommits); |
| 186 } | 179 } |
| 187 | 180 |
| 181 void WebLayerTreeViewImpl::registerForAnimations(WebLayer* layer) |
| 182 { |
| 183 cc::Layer* ccLayer = static_cast<WebLayerImpl*>(layer)->layer(); |
| 184 ccLayer->layerAnimationController()->setAnimationRegistrar(m_layerTreeHost->
animationRegistrar()); |
| 185 } |
| 186 |
| 188 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const | 187 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const |
| 189 { | 188 { |
| 190 m_layerTreeHost->renderingStats( | 189 m_layerTreeHost->renderingStats( |
| 191 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); | 190 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); |
| 192 } | 191 } |
| 193 | 192 |
| 194 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) | 193 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) |
| 195 { | 194 { |
| 196 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); | 195 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); |
| 197 debugState.showFPSCounter = show; | 196 debugState.showFPSCounter = show; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 { | 290 { |
| 292 m_client->didCompleteSwapBuffers(); | 291 m_client->didCompleteSwapBuffers(); |
| 293 } | 292 } |
| 294 | 293 |
| 295 void WebLayerTreeViewImpl::scheduleComposite() | 294 void WebLayerTreeViewImpl::scheduleComposite() |
| 296 { | 295 { |
| 297 m_client->scheduleComposite(); | 296 m_client->scheduleComposite(); |
| 298 } | 297 } |
| 299 | 298 |
| 300 } // namespace WebKit | 299 } // namespace WebKit |
| OLD | NEW |