Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: webkit/compositor_bindings/web_layer_tree_view_impl.cc

Issue 11189037: toggle FPS counter in compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added DCHECKs and moved hasFontAtlas into HUDLayer Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 CCLayerTreeSettings settings; 47 CCLayerTreeSettings 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 = CCLayerTreeHost::create(this, settings); 55 m_layerTreeHost = CCLayerTreeHost::create(this, settings);
57 if (!m_layerTreeHost.get()) 56 if (!m_layerTreeHost.get())
58 return false; 57 return false;
59 return true; 58 return true;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; 173 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen;
175 stats.droppedFrameCount = ccStats.droppedFrameCount; 174 stats.droppedFrameCount = ccStats.droppedFrameCount;
176 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; 175 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds;
177 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; 176 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds;
178 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; 177 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds;
179 stats.totalCommitCount = ccStats.totalCommitCount; 178 stats.totalCommitCount = ccStats.totalCommitCount;
180 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; 179 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls;
181 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; 180 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls;
182 } 181 }
183 182
183 void WebLayerTreeViewImpl::setShowFPSCounter(bool show)
184 {
185 m_layerTreeHost->setShowFPSCounter(show);
186 }
187
188 bool WebLayerTreeViewImpl::hasFontAtlas() const
189 {
190 return m_layerTreeHost->hasFontAtlas();
191 }
192
184 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) 193 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight)
185 { 194 {
186 IntRect asciiToRectTable[128]; 195 IntRect asciiToRectTable[128];
187 for (int i = 0; i < 128; ++i) 196 for (int i = 0; i < 128; ++i)
188 asciiToRectTable[i] = convert(asciiToWebRectTable[i]); 197 asciiToRectTable[i] = convert(asciiToWebRectTable[i]);
189 scoped_ptr<CCFontAtlas> fontAtlas = CCFontAtlas::create(bitmap, asciiToRectT able, fontHeight); 198 scoped_ptr<CCFontAtlas> fontAtlas = CCFontAtlas::create(bitmap, asciiToRectT able, fontHeight);
190 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); 199 m_layerTreeHost->setFontAtlas(fontAtlas.Pass());
191 } 200 }
192 201
193 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) 202 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 { 267 {
259 m_client->didCompleteSwapBuffers(); 268 m_client->didCompleteSwapBuffers();
260 } 269 }
261 270
262 void WebLayerTreeViewImpl::scheduleComposite() 271 void WebLayerTreeViewImpl::scheduleComposite()
263 { 272 {
264 m_client->scheduleComposite(); 273 m_client->scheduleComposite();
265 } 274 }
266 275
267 } // namespace WebKit 276 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698