| 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 "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
| 10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 bool WebLayerTreeViewImpl::commitRequested() const | 165 bool WebLayerTreeViewImpl::commitRequested() const |
| 166 { | 166 { |
| 167 return m_layerTreeHost->commitRequested(); | 167 return m_layerTreeHost->commitRequested(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void WebLayerTreeViewImpl::composite() | 170 void WebLayerTreeViewImpl::composite() |
| 171 { | 171 { |
| 172 m_layerTreeHost->composite(); | 172 m_layerTreeHost->composite(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void WebLayerTreeViewImpl::updateAnimations(double frameBeginTimeSeconds) | 175 void WebLayerTreeViewImpl::updateAnimations(double monotonicFrameBeginTimeSecond
s, double wallClockFrameBeginTimeSeconds) |
| 176 { | 176 { |
| 177 base::TimeTicks frameBeginTime = base::TimeTicks::FromInternalValue(frameBeg
inTimeSeconds * base::Time::kMicrosecondsPerSecond); | 177 base::TimeTicks monotonicFrameBeginTime = base::TimeTicks::FromInternalValue
(monotonicFrameBeginTimeSeconds * base::Time::kMicrosecondsPerSecond); |
| 178 m_layerTreeHost->updateAnimations(frameBeginTime); | 178 base::Time wallClockFrameBeginTime = base::Time::FromDoubleT(wallClockFrameB
eginTimeSeconds); |
| 179 m_layerTreeHost->updateAnimations(monotonicFrameBeginTime, wallClockFrameBeg
inTime); |
| 179 } | 180 } |
| 180 | 181 |
| 181 void WebLayerTreeViewImpl::didStopFlinging() | 182 void WebLayerTreeViewImpl::didStopFlinging() |
| 182 { | 183 { |
| 183 m_layerTreeHost->didStopFlinging(); | 184 m_layerTreeHost->didStopFlinging(); |
| 184 } | 185 } |
| 185 | 186 |
| 186 bool WebLayerTreeViewImpl::compositeAndReadback(void *pixels, const WebRect& rec
t) | 187 bool WebLayerTreeViewImpl::compositeAndReadback(void *pixels, const WebRect& rec
t) |
| 187 { | 188 { |
| 188 return m_layerTreeHost->compositeAndReadback(pixels, rect); | 189 return m_layerTreeHost->compositeAndReadback(pixels, rect); |
| 189 } | 190 } |
| 190 | 191 |
| 191 void WebLayerTreeViewImpl::finishAllRendering() | 192 void WebLayerTreeViewImpl::finishAllRendering() |
| 192 { | 193 { |
| 193 m_layerTreeHost->finishAllRendering(); | 194 m_layerTreeHost->finishAllRendering(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) | 197 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) |
| 197 { | 198 { |
| 198 m_layerTreeHost->setDeferCommits(deferCommits); | 199 m_layerTreeHost->setDeferCommits(deferCommits); |
| 199 } | 200 } |
| 200 | 201 |
| 202 void WebLayerTreeViewImpl::registerForAnimations(WebLayer* layer) |
| 203 { |
| 204 cc::Layer* ccLayer = static_cast<WebLayerImpl*>(layer)->layer(); |
| 205 ccLayer->layerAnimationController()->setAnimationRegistrar(m_layerTreeHost->
animationRegistrar()); |
| 206 } |
| 207 |
| 201 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const | 208 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const |
| 202 { | 209 { |
| 203 m_layerTreeHost->renderingStats( | 210 m_layerTreeHost->renderingStats( |
| 204 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); | 211 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); |
| 205 } | 212 } |
| 206 | 213 |
| 207 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) | 214 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) |
| 208 { | 215 { |
| 209 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); | 216 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); |
| 210 debugState.showFPSCounter = show; | 217 debugState.showFPSCounter = show; |
| 211 m_layerTreeHost->setDebugState(debugState); | 218 m_layerTreeHost->setDebugState(debugState); |
| 212 } | 219 } |
| 213 | 220 |
| 214 void WebLayerTreeViewImpl::setShowPaintRects(bool show) | 221 void WebLayerTreeViewImpl::setShowPaintRects(bool show) |
| 215 { | 222 { |
| 216 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); | 223 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); |
| 217 debugState.showPaintRects = show; | 224 debugState.showPaintRects = show; |
| 218 m_layerTreeHost->setDebugState(debugState); | 225 m_layerTreeHost->setDebugState(debugState); |
| 219 } | 226 } |
| 220 | 227 |
| 221 void WebLayerTreeViewImpl::setContinuousPaintingEnabled(bool enabled) | 228 void WebLayerTreeViewImpl::setContinuousPaintingEnabled(bool enabled) |
| 222 { | 229 { |
| 223 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); | 230 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); |
| 224 debugState.continuousPainting = enabled; | 231 debugState.continuousPainting = enabled; |
| 225 m_layerTreeHost->setDebugState(debugState); | 232 m_layerTreeHost->setDebugState(debugState); |
| 226 } | 233 } |
| 227 | 234 |
| 235 void WebLayerTreeViewImpl::didUpdateLayout() |
| 236 { |
| 237 m_layerTreeHost->didUpdateLayout(); |
| 238 } |
| 239 |
| 228 scoped_ptr<FontAtlas> WebLayerTreeViewImpl::createFontAtlas() | 240 scoped_ptr<FontAtlas> WebLayerTreeViewImpl::createFontAtlas() |
| 229 { | 241 { |
| 230 int fontHeight; | 242 int fontHeight; |
| 231 WebRect asciiToWebRectTable[128]; | 243 WebRect asciiToWebRectTable[128]; |
| 232 gfx::Rect asciiToRectTable[128]; | 244 gfx::Rect asciiToRectTable[128]; |
| 233 SkBitmap bitmap; | 245 SkBitmap bitmap; |
| 234 | 246 |
| 235 m_client->createFontAtlas(bitmap, asciiToWebRectTable, fontHeight); | 247 m_client->createFontAtlas(bitmap, asciiToWebRectTable, fontHeight); |
| 236 | 248 |
| 237 for (int i = 0; i < 128; ++i) | 249 for (int i = 0; i < 128; ++i) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 { | 316 { |
| 305 m_client->didCompleteSwapBuffers(); | 317 m_client->didCompleteSwapBuffers(); |
| 306 } | 318 } |
| 307 | 319 |
| 308 void WebLayerTreeViewImpl::scheduleComposite() | 320 void WebLayerTreeViewImpl::scheduleComposite() |
| 309 { | 321 { |
| 310 m_client->scheduleComposite(); | 322 m_client->scheduleComposite(); |
| 311 } | 323 } |
| 312 | 324 |
| 313 } // namespace WebKit | 325 } // namespace WebKit |
| OLD | NEW |