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

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: Uploading same set once again. Created 6 years, 9 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..eea788728ddcc721222249fa537e5ed45694fae3 100644
--- a/cc/layers/heads_up_display_layer_impl.h
+++ b/cc/layers/heads_up_display_layer_impl.h
@@ -6,10 +6,12 @@
#define CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_
#include <string>
+#include <vector>
#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 +23,6 @@ struct SkRect;
namespace cc {
-class DebugRectHistory;
class FrameRateCounter;
class PaintTimeCounter;
@@ -47,6 +48,8 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
virtual bool LayerIsAlwaysDamaged() const OVERRIDE;
+ bool NeedsUpdate() const { return fade_step_ > 0; }
+
private:
class Graph {
public:
@@ -73,7 +76,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 +111,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,
caseq 2014/03/06 11:48:37 No need to specify const for anything passed by va
malch 2014/03/06 12:06:23 Done.
+ const SkColor fill_color,
+ const float stroke_width,
+ const std::string label_text) const;
caseq 2014/03/06 11:48:37 This should by passed by reference.
malch 2014/03/06 12:06:23 Done.
+ void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history);
scoped_ptr<ScopedResource> hud_resource_;
scoped_ptr<SkCanvas> hud_canvas_;
@@ -119,6 +127,8 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
Graph fps_graph_;
Graph paint_time_graph_;
MemoryHistory::Entry memory_entry_;
+ int fade_step_;
+ std::vector<DebugRect> paint_rects_;
base::TimeTicks time_of_last_graph_update_;

Powered by Google App Engine
This is Rietveld 408576698