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

Unified Diff: cc/layers/heads_up_display_layer_impl.h

Issue 187343007: Adding fading effect for paint rectangles in HUD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
Index: cc/layers/heads_up_display_layer_impl.h
diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h
index 47afa1fd73af2ba4d28b6bf9128be34a06bca650..2a81ded56c8ea1657340f5ce6ed1884f55235429 100644
--- a/cc/layers/heads_up_display_layer_impl.h
+++ b/cc/layers/heads_up_display_layer_impl.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "cc/base/cc_export.h"
+#include "cc/debug/debug_rect_history.h"
#include "cc/layers/layer_impl.h"
#include "cc/resources/memory_history.h"
#include "cc/resources/scoped_resource.h"
@@ -21,7 +22,6 @@ struct SkRect;
namespace cc {
-class DebugRectHistory;
class FrameRateCounter;
class PaintTimeCounter;
@@ -47,6 +47,8 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
virtual bool LayerIsAlwaysDamaged() const OVERRIDE;
+ bool NeedsUpdate() const { return needs_update_; }
+
private:
class Graph {
public:
@@ -73,7 +75,7 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE;
void UpdateHudContents();
- void DrawHudContents(SkCanvas* canvas) const;
+ void DrawHudContents(SkCanvas* canvas);
void DrawText(SkCanvas* canvas,
SkPaint* paint,
@@ -108,8 +110,13 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
const PaintTimeCounter* paint_time_counter,
int top,
int right) const;
- void DrawDebugRects(SkCanvas* canvas,
- DebugRectHistory* debug_rect_history) const;
+ void DrawDebugRect(SkCanvas* canvas,
+ const DebugRect& rect,
+ const SkColor stroke_color,
+ const SkColor fill_color,
+ const float stroke_width,
+ const std::string label_text) const;
+ void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history);
scoped_ptr<ScopedResource> hud_resource_;
scoped_ptr<SkCanvas> hud_canvas_;
@@ -119,6 +126,7 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
Graph fps_graph_;
Graph paint_time_graph_;
MemoryHistory::Entry memory_entry_;
+ bool needs_update_;
base::TimeTicks time_of_last_graph_update_;

Powered by Google App Engine
This is Rietveld 408576698