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

Unified Diff: cc/test/fake_scrollbar.cc

Issue 150603004: Fixed rounding issue on scrollbar rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« cc/test/fake_scrollbar.h ('K') | « cc/test/fake_scrollbar.h ('k') | no next file » | 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 7285660f17016fc5be6e56070a40a817d7dfe0e2..f500a2a2861e99b17f2c832f1f89db7cd7af2a41 100644
--- a/cc/test/fake_scrollbar.cc
+++ b/cc/test/fake_scrollbar.cc
@@ -5,6 +5,7 @@
#include "cc/test/fake_scrollbar.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/gfx/skia_util.h"
namespace cc {
@@ -62,7 +63,16 @@ void FakeScrollbar::PaintPart(SkCanvas* canvas,
// Fill the scrollbar with a different color each time.
fill_color_++;
- canvas->clear(SK_ColorBLACK | fill_color_);
+
+ if (part == TRACK) {
+ SkPaint paint;
+ paint.setAntiAlias(false);
+ paint.setColor(get_color());
+ paint.setStyle(SkPaint::kFill_Style);
+ canvas->drawRect(RectToSkRect(TrackRect()), paint);
danakj 2014/02/18 20:43:30 Hm.. why isn't this able to just paint the |conten
bokan 2014/02/18 21:48:15 The real ScrollbarImpl's PaintPart method only use
+ } else {
+ canvas->clear(get_color());
+ }
}
} // namespace cc
« cc/test/fake_scrollbar.h ('K') | « cc/test/fake_scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698