diff options
Diffstat (limited to 'cc/heads_up_display_layer_impl.h')
-rw-r--r-- | cc/heads_up_display_layer_impl.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/cc/heads_up_display_layer_impl.h b/cc/heads_up_display_layer_impl.h index e45cc24..94c3400 100644 --- a/cc/heads_up_display_layer_impl.h +++ b/cc/heads_up_display_layer_impl.h @@ -9,6 +9,7 @@ #include "base/time.h" #include "cc/cc_export.h" #include "cc/layer_impl.h" +#include "cc/memory_history.h" #include "cc/scoped_resource.h" class SkCanvas; @@ -20,7 +21,6 @@ namespace cc { class DebugRectHistory; class FrameRateCounter; -class MemoryHistory; class PaintTimeCounter; class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { @@ -43,12 +43,13 @@ public: virtual bool layerIsAlwaysDamaged() const OVERRIDE; private: - struct Graph { + class Graph { + public: Graph(double indicatorValue, double startUpperBound); // Eases the upper bound, which limits what is currently visible in the graph, // so that the graph always scales to either it's max or defaultUpperBound. - static double updateUpperBound(Graph*); + double updateUpperBound(); double value; double min; @@ -63,19 +64,19 @@ private: virtual const char* layerTypeAsString() const OVERRIDE; - void drawHudContents(SkCanvas*); + void updateHudContents(); + void drawHudContents(SkCanvas* canvas) const; - void drawText(SkCanvas*, SkPaint*, const std::string&, const SkPaint::Align&, const int& size, const int& x, const int& y); - void drawText(SkCanvas*, SkPaint*, const std::string&, const SkPaint::Align&, const int& size, const SkPoint& pos); - void drawGraphBackground(SkCanvas*, SkPaint*, const SkRect& bounds); - void drawGraphLines(SkCanvas*, SkPaint*, const SkRect& bounds, const Graph&); + void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkPaint::Align align, int size, int x, int y) const; + void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkPaint::Align align, int size, const SkPoint& pos) const; + void drawGraphBackground(SkCanvas* canvas, SkPaint* paint, const SkRect& bounds) const; + void drawGraphLines(SkCanvas* canvas, SkPaint* paint, const SkRect& bounds, const Graph& graph) const; - void drawPlaformLayerTree(SkCanvas*); - int drawFPSDisplay(SkCanvas*, FrameRateCounter*, const int& top); - int drawMemoryDisplay(SkCanvas*, MemoryHistory*, const int& top); - int drawPaintTimeDisplay(SkCanvas*, PaintTimeCounter*, const int& top); - - void drawDebugRects(SkCanvas*, DebugRectHistory*); + void drawPlatformLayerTree(SkCanvas* canvas) const; + SkRect drawFPSDisplay(SkCanvas* canvas, const FrameRateCounter* fpsCounter, int right, int top) const; + SkRect drawMemoryDisplay(SkCanvas* canvas, int top, int right, int width) const; + SkRect drawPaintTimeDisplay(SkCanvas* canvas, const PaintTimeCounter* paintTimeCounter, int top, int right) const; + void drawDebugRects(SkCanvas* canvas, DebugRectHistory* debugRectHistory) const; scoped_ptr<ScopedResource> m_hudTexture; scoped_ptr<SkCanvas> m_hudCanvas; @@ -84,6 +85,7 @@ private: Graph m_fpsGraph; Graph m_paintTimeGraph; + MemoryHistory::Entry m_memoryEntry; base::TimeTicks m_timeOfLastGraphUpdate; }; |