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