Chromium Code Reviews| Index: cc/heads_up_display_layer_impl.h |
| diff --git a/cc/heads_up_display_layer_impl.h b/cc/heads_up_display_layer_impl.h |
| index 70bf03ec867e0da20a2435ab114b426aba737729..6aef447481453e7210e16d5931d1bb0c857f0d3a 100644 |
| --- a/cc/heads_up_display_layer_impl.h |
| +++ b/cc/heads_up_display_layer_impl.h |
| @@ -21,6 +21,7 @@ namespace cc { |
| class DebugRectHistory; |
| class FontAtlas; |
| class FrameRateCounter; |
| +class PaintTimeCounter; |
| class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { |
| public: |
| @@ -42,25 +43,47 @@ public: |
| virtual bool layerIsAlwaysDamaged() const OVERRIDE; |
| private: |
| + struct Graph { |
| + Graph(double indicatorValue, double startHigh); |
| + |
| + // Eases the high value, which is the upper limit of what is currently visible in the graph, |
| + // so that the graph always scales to either it's max or defaultHigh. |
| + static double updateHigh(Graph&); |
|
shawnsingh
2013/01/15 22:48:52
If Graph is supposed to be non-const, let's use a
|
| + |
| + double current; |
| + double min; |
| + double max; |
| + double high; |
| + |
| + const double defaultHigh; |
| + const double indicator; |
| + }; |
| + |
| HeadsUpDisplayLayerImpl(LayerTreeImpl* treeImpl, int id); |
| virtual const char* layerTypeAsString() const OVERRIDE; |
| void drawHudContents(SkCanvas*); |
| - int drawFPSCounter(SkCanvas*, FrameRateCounter*); |
| - void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); |
| - void drawFPSCounterGraphAndHistogram(SkCanvas* canvas, SkPaint& paint, FrameRateCounter* fpsCounter, SkRect graphBounds, SkRect histogramBounds); |
| + |
| + void drawTextLeftAligned(SkCanvas*, SkPaint&, SkRect bounds, std::string text); |
|
shawnsingh
2013/01/15 22:48:52
same here and for all the following functions - ei
|
| + void drawTextRightAligned(SkCanvas*, SkPaint&, SkRect bounds, std::string text); |
| + |
| + void drawGraphBackground(SkCanvas*, SkPaint&, SkRect bounds); |
| + void drawGraphLines(SkCanvas*, SkPaint&, SkRect bounds, Graph&); |
| + |
| + int drawFPSDisplay(SkCanvas*, FrameRateCounter*, int top); |
| + int drawPaintTimeDisplay(SkCanvas*, PaintTimeCounter*, int top); |
| + |
| void drawDebugRects(SkCanvas*, DebugRectHistory*); |
| scoped_ptr<FontAtlas> m_fontAtlas; |
| scoped_ptr<ScopedResource> m_hudTexture; |
| scoped_ptr<SkCanvas> m_hudCanvas; |
| - double m_averageFPS; |
| - double m_minFPS; |
| - double m_maxFPS; |
| + Graph m_fpsGraph; |
| + Graph m_paintTimeGraph; |
| - base::TimeTicks textUpdateTime; |
| + base::TimeTicks m_lastGraphNumbersUpdate; |
|
shawnsingh
2013/01/15 22:48:52
more nitpickyness - perhaps this is more clear na
|
| }; |
| } // namespace cc |