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

Side by Side Diff: webkit/port/platform/chromium/ScrollbarThemeChromiumLinux.cpp

Issue 14477: It appears that the GTK theme doesn't always draw the full rectangle (Closed)
Patch Set: Created 12 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 const GtkThemeWidgetType track_type = 119 const GtkThemeWidgetType track_type =
120 horz ? MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL : MOZ_GTK_SCROLLBAR_TRACK_VERT ICAL; 120 horz ? MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL : MOZ_GTK_SCROLLBAR_TRACK_VERT ICAL;
121 paintScrollbarWidget(gc, rect, track_type, 0); 121 paintScrollbarWidget(gc, rect, track_type, 0);
122 122
123 return; 123 return;
124 } 124 }
125 125
126 void ScrollbarThemeChromium::paintButton(GraphicsContext* gc, Scrollbar* scrollb ar, 126 void ScrollbarThemeChromium::paintButton(GraphicsContext* gc, Scrollbar* scrollb ar,
127 const IntRect& rect, ScrollbarPart part) 127 const IntRect& rect, ScrollbarPart part)
128 { 128 {
129 // TODO(port): It appears the either we're upsetting GTK by forcing WebKit
130 // sizes on it, or the buttons expect the track to be drawn under them.
131 // Either way, we end up with unpainted pixels which are upsetting the
132 // pixel tests. Thus we paint green under the buttons to, at least, make
133 // the pixel output the same between debug and opt builds.
134 SkPaint paint;
135 paint.setARGB(255, 0, 255, 128);
136 SkRect skrect;
137 skrect.set(rect.x(), rect.y(), rect.x() + rect.width() - 1, rect.y() + rect. height() + 1);
138 gc->platformContext()->canvas()->drawRect(skrect, paint);
139
129 const bool horz = scrollbar->orientation() == HorizontalScrollbar; 140 const bool horz = scrollbar->orientation() == HorizontalScrollbar;
130 gint flags = horz ? 0 : MOZ_GTK_STEPPER_VERTICAL; 141 gint flags = horz ? 0 : MOZ_GTK_STEPPER_VERTICAL;
131 flags |= ForwardButtonEndPart == part ? MOZ_GTK_STEPPER_DOWN : 0; 142 flags |= ForwardButtonEndPart == part ? MOZ_GTK_STEPPER_DOWN : 0;
132 paintScrollbarWidget(gc, rect, MOZ_GTK_SCROLLBAR_BUTTON, flags); 143 paintScrollbarWidget(gc, rect, MOZ_GTK_SCROLLBAR_BUTTON, flags);
133 } 144 }
134 145
135 void ScrollbarThemeChromium::paintThumb(GraphicsContext* gc, Scrollbar* scrollba r, const IntRect& rect) 146 void ScrollbarThemeChromium::paintThumb(GraphicsContext* gc, Scrollbar* scrollba r, const IntRect& rect)
136 { 147 {
137 const bool horz = scrollbar->orientation() == HorizontalScrollbar; 148 const bool horz = scrollbar->orientation() == HorizontalScrollbar;
138 const GtkThemeWidgetType thumb_type = 149 const GtkThemeWidgetType thumb_type =
139 horz ? MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL : MOZ_GTK_SCROLLBAR_THUMB_VERT ICAL; 150 horz ? MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL : MOZ_GTK_SCROLLBAR_THUMB_VERT ICAL;
140 paintScrollbarWidget(gc, rect, thumb_type, 0); 151 paintScrollbarWidget(gc, rect, thumb_type, 0);
141 } 152 }
142 153
143 } // namespace WebCore 154 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698