cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / cc / test / fake_scrollbar.cc
blob67166f629999dc46344b6c34a3ae2e9b237a3615
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/test/fake_scrollbar.h"
7 #include "third_party/skia/include/core/SkCanvas.h"
9 namespace cc {
11 FakeScrollbar::FakeScrollbar()
12 : paint_(false),
13 has_thumb_(false),
14 is_overlay_(false),
15 thumb_thickness_(10),
16 thumb_length_(5),
17 track_rect_(0, 0, 100, 10),
18 fill_color_(SK_ColorGREEN) {}
20 FakeScrollbar::FakeScrollbar(bool paint, bool has_thumb, bool is_overlay)
21 : paint_(paint),
22 has_thumb_(has_thumb),
23 is_overlay_(is_overlay),
24 thumb_thickness_(10),
25 thumb_length_(5),
26 track_rect_(0, 0, 100, 10),
27 fill_color_(SK_ColorGREEN) {}
29 FakeScrollbar::~FakeScrollbar() {}
31 ScrollbarOrientation FakeScrollbar::Orientation() const {
32 return HORIZONTAL;
35 gfx::Point FakeScrollbar::Location() const { return location_; }
37 bool FakeScrollbar::IsOverlay() const { return is_overlay_; }
39 bool FakeScrollbar::HasThumb() const { return has_thumb_; }
41 int FakeScrollbar::ThumbThickness() const {
42 return thumb_thickness_;
45 int FakeScrollbar::ThumbLength() const {
46 return thumb_length_;
49 gfx::Rect FakeScrollbar::TrackRect() const {
50 return track_rect_;
53 void FakeScrollbar::PaintPart(SkCanvas* canvas,
54 ScrollbarPart part,
55 gfx::Rect content_rect) {
56 if (!paint_)
57 return;
59 // Fill the scrollbar with a different color each time.
60 fill_color_++;
61 canvas->clear(SK_ColorBLACK | fill_color_);
64 } // namespace cc