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

Unified Diff: cc/test/fake_scrollbar.cc

Issue 1458703010: Mac: Don't repaint scrollbars every frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Rebase and resolve Created 5 years, 1 month 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 | « cc/test/fake_scrollbar.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_scrollbar.cc
diff --git a/cc/test/fake_scrollbar.cc b/cc/test/fake_scrollbar.cc
index 754b6f75997901aad3491a5ef29dc80cdfaa6f4e..80bd44422a301c8fcb595ce64d2b664ad12c20b9 100644
--- a/cc/test/fake_scrollbar.cc
+++ b/cc/test/fake_scrollbar.cc
@@ -15,6 +15,9 @@ FakeScrollbar::FakeScrollbar()
is_overlay_(false),
thumb_thickness_(10),
thumb_length_(5),
+ thumb_opacity_(1),
+ needs_paint_thumb_(true),
+ needs_paint_track_(true),
track_rect_(0, 0, 100, 10),
fill_color_(SK_ColorGREEN) {}
@@ -24,6 +27,9 @@ FakeScrollbar::FakeScrollbar(bool paint, bool has_thumb, bool is_overlay)
is_overlay_(is_overlay),
thumb_thickness_(10),
thumb_length_(5),
+ thumb_opacity_(1),
+ needs_paint_thumb_(true),
+ needs_paint_track_(true),
track_rect_(0, 0, 100, 10),
fill_color_(SK_ColorGREEN) {}
@@ -55,6 +61,16 @@ gfx::Rect FakeScrollbar::TrackRect() const {
return track_rect_;
}
+float FakeScrollbar::ThumbOpacity() const {
+ return thumb_opacity_;
+}
+
+bool FakeScrollbar::NeedsPaintPart(ScrollbarPart part) const {
+ if (part == THUMB)
+ return needs_paint_thumb_;
+ return needs_paint_track_;
+}
+
void FakeScrollbar::PaintPart(SkCanvas* canvas,
ScrollbarPart part,
const gfx::Rect& content_rect) {
« no previous file with comments | « cc/test/fake_scrollbar.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698