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

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: Fixed break on Android tests 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
« no previous file with comments | « 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..754b6f75997901aad3491a5ef29dc80cdfaa6f4e 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_);
+ SkPaint paint;
+ paint.setAntiAlias(false);
+ paint.setColor(paint_fill_color());
+ paint.setStyle(SkPaint::kFill_Style);
+
+ // Emulate the how the real scrollbar works by using scrollbar's rect for
+ // TRACK and the given content_rect for the THUMB
+ SkRect rect = part == TRACK ? RectToSkRect(TrackRect())
+ : RectToSkRect(content_rect);
+ canvas->drawRect(rect, paint);
}
} // namespace cc
« no previous file with comments | « cc/test/fake_scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698