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 28 matching lines...) Expand all Loading... | |
39 } | 39 } |
40 | 40 |
41 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() | 41 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() |
42 { | 42 { |
43 } | 43 } |
44 | 44 |
45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs) | 45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs) |
46 { | 46 { |
47 LayerTreeSettings settings; | 47 LayerTreeSettings settings; |
48 settings.acceleratePainting = webSettings.acceleratePainting; | 48 settings.acceleratePainting = webSettings.acceleratePainting; |
49 settings.showFPSCounter = webSettings.showFPSCounter; | |
50 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; | 49 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; |
51 settings.showPaintRects = webSettings.showPaintRects; | 50 settings.showPaintRects = webSettings.showPaintRects; |
52 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; | 51 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; |
53 settings.refreshRate = webSettings.refreshRate; | 52 settings.refreshRate = webSettings.refreshRate; |
54 settings.defaultTileSize = convert(webSettings.defaultTileSize); | 53 settings.defaultTileSize = convert(webSettings.defaultTileSize); |
55 settings.maxUntiledLayerSize = convert(webSettings.maxUntiledLayerSize); | 54 settings.maxUntiledLayerSize = convert(webSettings.maxUntiledLayerSize); |
56 m_layerTreeHost = LayerTreeHost::create(this, settings); | 55 m_layerTreeHost = LayerTreeHost::create(this, settings); |
57 if (!m_layerTreeHost.get()) | 56 if (!m_layerTreeHost.get()) |
58 return false; | 57 return false; |
58 | |
59 if (webSettings.showFPSCounter) | |
egraether
2012/10/30 20:14:04
This condition detects the commandline-flag set in
| |
60 setShowFPSCounter(true); | |
59 return true; | 61 return true; |
60 } | 62 } |
61 | 63 |
62 void WebLayerTreeViewImpl::setSurfaceReady() | 64 void WebLayerTreeViewImpl::setSurfaceReady() |
63 { | 65 { |
64 m_layerTreeHost->setSurfaceReady(); | 66 m_layerTreeHost->setSurfaceReady(); |
65 } | 67 } |
66 | 68 |
67 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) | 69 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) |
68 { | 70 { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; | 183 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; |
182 stats.droppedFrameCount = ccStats.droppedFrameCount; | 184 stats.droppedFrameCount = ccStats.droppedFrameCount; |
183 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; | 185 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; |
184 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; | 186 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; |
185 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; | 187 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; |
186 stats.totalCommitCount = ccStats.totalCommitCount; | 188 stats.totalCommitCount = ccStats.totalCommitCount; |
187 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; | 189 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; |
188 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; | 190 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; |
189 } | 191 } |
190 | 192 |
193 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) | |
194 { | |
195 m_layerTreeHost->setShowFPSCounter(show); | |
196 } | |
197 | |
191 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) | 198 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) |
192 { | 199 { |
193 IntRect asciiToRectTable[128]; | 200 IntRect asciiToRectTable[128]; |
194 for (int i = 0; i < 128; ++i) | 201 for (int i = 0; i < 128; ++i) |
195 asciiToRectTable[i] = convert(asciiToWebRectTable[i]); | 202 asciiToRectTable[i] = convert(asciiToWebRectTable[i]); |
196 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); | 203 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); |
197 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); | 204 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); |
198 } | 205 } |
199 | 206 |
200 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) | 207 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 { | 272 { |
266 m_client->didCompleteSwapBuffers(); | 273 m_client->didCompleteSwapBuffers(); |
267 } | 274 } |
268 | 275 |
269 void WebLayerTreeViewImpl::scheduleComposite() | 276 void WebLayerTreeViewImpl::scheduleComposite() |
270 { | 277 { |
271 m_client->scheduleComposite(); | 278 m_client->scheduleComposite(); |
272 } | 279 } |
273 | 280 |
274 } // namespace WebKit | 281 } // namespace WebKit |
OLD | NEW |