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

Unified Diff: cc/heads_up_display_layer_impl.h

Issue 11820014: cc: PaintTimeCounter display on the HudLayer in continuous painting mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@paint
Patch Set: updated to base::TimeDelta APIs in PaintTimeCounter Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..67b277981bf8558bef1f89a51f5d402c272af5bc 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 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 value;
+ double min;
+ double max;
+
+ double currentUpperBound;
+ const double defaultUpperBound;
+ 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*, const SkRect& bounds, const std::string& text);
+ void drawTextRightAligned(SkCanvas*, SkPaint*, const SkRect& bounds, const std::string& text);
+
+ void drawGraphBackground(SkCanvas*, SkPaint*, const SkRect& bounds);
+ void drawGraphLines(SkCanvas*, SkPaint*, const SkRect& bounds, const Graph&);
+
+ int drawFPSDisplay(SkCanvas*, FrameRateCounter*, const int& top);
+ int drawPaintTimeDisplay(SkCanvas*, PaintTimeCounter*, const 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_timeOfLastGraphUpdate;
};
} // namespace cc
« no previous file with comments | « no previous file | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698