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 "config.h" | 5 #include "config.h" |
6 #include "web_layer_tree_view_impl.h" | 6 #include "web_layer_tree_view_impl.h" |
7 | 7 |
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 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() | 40 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti
ngs) | 44 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti
ngs) |
45 { | 45 { |
46 LayerTreeSettings settings; | 46 LayerTreeSettings settings; |
47 settings.acceleratePainting = webSettings.acceleratePainting; | 47 settings.acceleratePainting = webSettings.acceleratePainting; |
48 settings.showFPSCounter = webSettings.showFPSCounter; | |
49 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; | 48 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; |
50 settings.showPaintRects = webSettings.showPaintRects; | 49 settings.showPaintRects = webSettings.showPaintRects; |
51 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; | 50 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; |
52 settings.refreshRate = webSettings.refreshRate; | 51 settings.refreshRate = webSettings.refreshRate; |
53 settings.defaultTileSize = webSettings.defaultTileSize; | 52 settings.defaultTileSize = webSettings.defaultTileSize; |
54 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize; | 53 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize; |
55 m_layerTreeHost = LayerTreeHost::create(this, settings); | 54 m_layerTreeHost = LayerTreeHost::create(this, settings); |
56 if (!m_layerTreeHost.get()) | 55 if (!m_layerTreeHost.get()) |
57 return false; | 56 return false; |
| 57 |
| 58 if (webSettings.showFPSCounter) |
| 59 setShowFPSCounter(true); |
58 return true; | 60 return true; |
59 } | 61 } |
60 | 62 |
61 void WebLayerTreeViewImpl::setSurfaceReady() | 63 void WebLayerTreeViewImpl::setSurfaceReady() |
62 { | 64 { |
63 m_layerTreeHost->setSurfaceReady(); | 65 m_layerTreeHost->setSurfaceReady(); |
64 } | 66 } |
65 | 67 |
66 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) | 68 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) |
67 { | 69 { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; | 187 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; |
186 stats.droppedFrameCount = ccStats.droppedFrameCount; | 188 stats.droppedFrameCount = ccStats.droppedFrameCount; |
187 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; | 189 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; |
188 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; | 190 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; |
189 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; | 191 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; |
190 stats.totalCommitCount = ccStats.totalCommitCount; | 192 stats.totalCommitCount = ccStats.totalCommitCount; |
191 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; | 193 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; |
192 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; | 194 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; |
193 } | 195 } |
194 | 196 |
| 197 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) |
| 198 { |
| 199 m_layerTreeHost->setShowFPSCounter(show); |
| 200 } |
| 201 |
195 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT
able[128], int fontHeight) { | 202 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT
able[128], int fontHeight) { |
196 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); | 203 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); |
197 } | 204 } |
198 | 205 |
199 void WebLayerTreeViewImpl::setFontAtlas(WebRect asciiToWebRectTable[128], const
SkBitmap& bitmap, int fontHeight) | 206 void WebLayerTreeViewImpl::setFontAtlas(WebRect asciiToWebRectTable[128], const
SkBitmap& bitmap, int fontHeight) |
200 { | 207 { |
201 gfx::Rect asciiToRectTable[128]; | 208 gfx::Rect asciiToRectTable[128]; |
202 for (int i = 0; i < 128; ++i) | 209 for (int i = 0; i < 128; ++i) |
203 asciiToRectTable[i] = asciiToWebRectTable[i]; | 210 asciiToRectTable[i] = asciiToWebRectTable[i]; |
204 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable
, fontHeight); | 211 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable
, fontHeight); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 { | 280 { |
274 m_client->didCompleteSwapBuffers(); | 281 m_client->didCompleteSwapBuffers(); |
275 } | 282 } |
276 | 283 |
277 void WebLayerTreeViewImpl::scheduleComposite() | 284 void WebLayerTreeViewImpl::scheduleComposite() |
278 { | 285 { |
279 m_client->scheduleComposite(); | 286 m_client->scheduleComposite(); |
280 } | 287 } |
281 | 288 |
282 } // namespace WebKit | 289 } // namespace WebKit |
OLD | NEW |