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

Unified Diff: cc/test/fake_scrollbar_theme_painter.cc

Issue 11609002: cc: Create a cc::ScrollbarThemePainter and an adapter class in compositor bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: notry Created 8 years 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_theme_painter.h ('k') | cc/test/fake_web_scrollbar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_scrollbar_theme_painter.cc
diff --git a/cc/test/fake_scrollbar_theme_painter.cc b/cc/test/fake_scrollbar_theme_painter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..19f97f89f5720472d2e7ff86ea5a9b25e82dc7e0
--- /dev/null
+++ b/cc/test/fake_scrollbar_theme_painter.cc
@@ -0,0 +1,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
« no previous file with comments | « cc/test/fake_scrollbar_theme_painter.h ('k') | cc/test/fake_web_scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698