OLD | NEW |
---|---|
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 Loading... | |
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 (settings.showFPSCounter || layerTreeHostImpl()->showFPSCounter()) { |
brianderson
2012/10/18 00:13:21
How hard would it be to have the command-line flag
egraether
2012/10/18 15:56:30
It would be nice, but I think it's not a real prob
danakj
2012/10/18 16:45:07
I agree with Brian here, having a single point dec
| |
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 Loading... | |
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 } |
OLD | NEW |