| 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 "cc/heads_up_display_layer_impl.h" | 7 #include "cc/heads_up_display_layer_impl.h" |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "cc/debug_rect_history.h" | 10 #include "cc/debug_rect_history.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 double averageFPS, stdDeviation; | 225 double averageFPS, stdDeviation; |
| 226 fpsCounter->getAverageFPSAndStandardDeviation(averageFPS, stdDeviation); | 226 fpsCounter->getAverageFPSAndStandardDeviation(averageFPS, stdDeviation); |
| 227 | 227 |
| 228 // Draw background. | 228 // Draw background. |
| 229 SkPaint paint = createPaint(); | 229 SkPaint paint = createPaint(); |
| 230 paint.setColor(SK_ColorBLACK); | 230 paint.setColor(SK_ColorBLACK); |
| 231 canvas->drawRect(SkRect::MakeXYWH(2, top, width, height), paint); | 231 canvas->drawRect(SkRect::MakeXYWH(2, top, width, height), paint); |
| 232 | 232 |
| 233 // Draw FPS text. | 233 // Draw FPS text. |
| 234 if (m_fontAtlas.get()) | 234 if (m_fontAtlas.get()) |
| 235 m_fontAtlas->drawText(canvas, createPaint(), base::StringPrintf("FPS: %4
.1f +/- %3.1f", averageFPS, stdDeviation), gfx::Point(10, height / 3), IntSize(w
idth, height)); | 235 m_fontAtlas->drawText(canvas, createPaint(), base::StringPrintf("FPS: %4
.1f +/- %3.1f", averageFPS, stdDeviation), gfx::Point(10, height / 3), gfx::Size
(width, height)); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void HeadsUpDisplayLayerImpl::drawDebugRects(SkCanvas* canvas, DebugRectHistory*
debugRectHistory) | 238 void HeadsUpDisplayLayerImpl::drawDebugRects(SkCanvas* canvas, DebugRectHistory*
debugRectHistory) |
| 239 { | 239 { |
| 240 const std::vector<DebugRect>& debugRects = debugRectHistory->debugRects(); | 240 const std::vector<DebugRect>& debugRects = debugRectHistory->debugRects(); |
| 241 | 241 |
| 242 for (size_t i = 0; i < debugRects.size(); ++i) { | 242 for (size_t i = 0; i < debugRects.size(); ++i) { |
| 243 SkColor strokeColor = 0; | 243 SkColor strokeColor = 0; |
| 244 SkColor fillColor = 0; | 244 SkColor fillColor = 0; |
| 245 | 245 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 canvas->drawRect(skRect, paint); | 288 canvas->drawRect(skRect, paint); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 292 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 293 { | 293 { |
| 294 return "HeadsUpDisplayLayer"; | 294 return "HeadsUpDisplayLayer"; |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace cc | 297 } // namespace cc |
| OLD | NEW |