1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/test/fake_scrollbar_theme_painter.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/rect.h"
namespace cc {
void FakeScrollbarThemePainter::PaintScrollbarBackground(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintTrackBackground(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintBackTrackPart(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintForwardTrackPart(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintBackButtonStart(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintBackButtonEnd(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintForwardButtonStart(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintForwardButtonEnd(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintTickmarks(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::PaintThumb(
SkCanvas* canvas, const gfx::Rect& rect) {
Paint(canvas, rect);
}
void FakeScrollbarThemePainter::Paint(SkCanvas* canvas, gfx::Rect rect) {
if (!paint_)
return;
// Fill the scrollbar with a different color each time.
++fill_color_;
canvas->clear(SK_ColorBLACK | fill_color_);
}
} // namespace cc
|