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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11189037: toggle FPS counter in compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added check for accelerated compositing, removed 'showFPSCounter' from settings, command-line flag … Created 8 years, 2 months 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
« no previous file with comments | « no previous file | cc/layer_tree_host.h » ('j') | cc/layer_tree_host.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 6
7 #include "CCHeadsUpDisplayLayerImpl.h" 7 #include "CCHeadsUpDisplayLayerImpl.h"
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (settings.showPlatformLayerTree) { 139 if (settings.showPlatformLayerTree) {
140 SkPaint paint = createPaint(); 140 SkPaint paint = createPaint();
141 paint.setColor(SkColorSetARGB(192, 0, 0, 0)); 141 paint.setColor(SkColorSetARGB(192, 0, 0, 0));
142 canvas->drawRect(SkRect::MakeXYWH(0, 0, bounds().width(), bounds().heigh t()), paint); 142 canvas->drawRect(SkRect::MakeXYWH(0, 0, bounds().width(), bounds().heigh t()), paint);
143 } 143 }
144 144
145 int fpsCounterHeight = 40; 145 int fpsCounterHeight = 40;
146 int fpsCounterTop = 2; 146 int fpsCounterTop = 2;
147 int platformLayerTreeTop; 147 int platformLayerTreeTop;
148 148
149 if (settings.showFPSCounter) 149 if (layerTreeHostImpl()->showFPSCounter()) {
150 drawFPSCounter(canvas, layerTreeHostImpl()->fpsCounter(), fpsCounterTop, fpsCounterHeight);
150 platformLayerTreeTop = fpsCounterTop + fpsCounterHeight; 151 platformLayerTreeTop = fpsCounterTop + fpsCounterHeight;
151 else 152 } else
152 platformLayerTreeTop = 0; 153 platformLayerTreeTop = 0;
153 154
154 if (settings.showFPSCounter)
155 drawFPSCounter(canvas, layerTreeHostImpl()->fpsCounter(), fpsCounterTop, fpsCounterHeight);
156
157 if (settings.showPlatformLayerTree && m_fontAtlas.get()) { 155 if (settings.showPlatformLayerTree && m_fontAtlas.get()) {
158 std::string layerTree = layerTreeHostImpl()->layerTreeAsText(); 156 std::string layerTree = layerTreeHostImpl()->layerTreeAsText();
159 m_fontAtlas->drawText(canvas, createPaint(), layerTree, gfx::Point(2, pl atformLayerTreeTop), bounds()); 157 m_fontAtlas->drawText(canvas, createPaint(), layerTree, gfx::Point(2, pl atformLayerTreeTop), bounds());
160 } 158 }
161 159
162 if (settings.showDebugRects()) 160 if (settings.showDebugRects())
163 drawDebugRects(canvas, layerTreeHostImpl()->debugRectHistory()); 161 drawDebugRects(canvas, layerTreeHostImpl()->debugRectHistory());
164 } 162 }
165 163
166 void CCHeadsUpDisplayLayerImpl::drawFPSCounter(SkCanvas* canvas, CCFrameRateCoun ter* fpsCounter, int top, int height) 164 void CCHeadsUpDisplayLayerImpl::drawFPSCounter(SkCanvas* canvas, CCFrameRateCoun ter* fpsCounter, int top, int height)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 canvas->drawRect(skRect, paint); 285 canvas->drawRect(skRect, paint);
288 } 286 }
289 } 287 }
290 288
291 const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const 289 const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const
292 { 290 {
293 return "HeadsUpDisplayLayer"; 291 return "HeadsUpDisplayLayer";
294 } 292 }
295 293
296 } 294 }
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host.h » ('j') | cc/layer_tree_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698