| 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 "cc/font_atlas.h" | 7 #include "cc/font_atlas.h" |
| 8 #include "cc/input_handler.h" | 8 #include "cc/input_handler.h" |
| 9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
| 10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| 11 #include "cc/thread.h" | 11 #include "cc/thread.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 19 #include "web_layer_impl.h" | 19 #include "web_layer_impl.h" |
| 20 #include "web_to_ccinput_handler_adapter.h" | 20 #include "web_to_ccinput_handler_adapter.h" |
| 21 #include "webkit/compositor_bindings/web_rendering_stats_impl.h" |
| 21 | 22 |
| 22 using namespace cc; | 23 using namespace cc; |
| 23 | 24 |
| 24 namespace WebKit { | 25 namespace WebKit { |
| 25 | 26 |
| 26 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) | 27 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) |
| 27 : m_client(client) | 28 : m_client(client) |
| 28 { | 29 { |
| 29 } | 30 } |
| 30 | 31 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 m_layerTreeHost->finishAllRendering(); | 162 m_layerTreeHost->finishAllRendering(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) | 165 void WebLayerTreeViewImpl::setDeferCommits(bool deferCommits) |
| 165 { | 166 { |
| 166 m_layerTreeHost->setDeferCommits(deferCommits); | 167 m_layerTreeHost->setDeferCommits(deferCommits); |
| 167 } | 168 } |
| 168 | 169 |
| 169 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const | 170 void WebLayerTreeViewImpl::renderingStats(WebRenderingStats& stats) const |
| 170 { | 171 { |
| 171 RenderingStats ccStats; | 172 m_layerTreeHost->renderingStats( |
| 172 m_layerTreeHost->renderingStats(&ccStats); | 173 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); |
| 173 | |
| 174 stats.numAnimationFrames = ccStats.numAnimationFrames; | |
| 175 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; | |
| 176 stats.droppedFrameCount = ccStats.droppedFrameCount; | |
| 177 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; | |
| 178 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; | |
| 179 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; | |
| 180 stats.totalCommitCount = ccStats.totalCommitCount; | |
| 181 stats.totalPixelsPainted = ccStats.totalPixelsPainted; | |
| 182 stats.totalPixelsRasterized = ccStats.totalPixelsRasterized; | |
| 183 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; | |
| 184 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; | |
| 185 } | 174 } |
| 186 | 175 |
| 187 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) | 176 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) |
| 188 { | 177 { |
| 189 m_layerTreeHost->setShowFPSCounter(show); | 178 m_layerTreeHost->setShowFPSCounter(show); |
| 190 } | 179 } |
| 191 | 180 |
| 192 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT
able[128], int fontHeight) { | 181 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT
able[128], int fontHeight) { |
| 193 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); | 182 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); |
| 194 } | 183 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 { | 259 { |
| 271 m_client->didCompleteSwapBuffers(); | 260 m_client->didCompleteSwapBuffers(); |
| 272 } | 261 } |
| 273 | 262 |
| 274 void WebLayerTreeViewImpl::scheduleComposite() | 263 void WebLayerTreeViewImpl::scheduleComposite() |
| 275 { | 264 { |
| 276 m_client->scheduleComposite(); | 265 m_client->scheduleComposite(); |
| 277 } | 266 } |
| 278 | 267 |
| 279 } // namespace WebKit | 268 } // namespace WebKit |
| OLD | NEW |