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

Unified Diff: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 201037: Fix small pixel glitches in omnibox dropdown corners.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
===================================================================
--- chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (revision 25499)
+++ chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (working copy)
@@ -582,8 +582,11 @@
// Returns the border radius of the edge of the popup.
static int GetBorderRadius() {
- InitClass();
- return dropshadow_topleft_->width() - dropshadow_left_->width() - 1;
+ // We can't safely calculate a border radius by comparing the sizes of the
+ // side and corner images, because either may have been extended in various
+ // directions in order to do more subtle dropshadow fading or other effects.
+ // So we hardcode the most accurate value.
+ return 4;
}
// Overridden from views::Border:
@@ -839,7 +842,7 @@
////////////////////////////////////////////////////////////////////////////////
// AutocompletePopupContentsView, views::View overrides:
-void AutocompletePopupContentsView::PaintChildren(gfx::Canvas* canvas) {
+void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) {
// We paint our children in an unconventional way.
//
// Because the border of this view creates an anti-aliased round-rect region
@@ -873,6 +876,11 @@
gfx::Path path;
MakeContentsPath(&path, GetLocalBounds(false));
canvas->drawPath(path, paint);
+
+ // Now we paint the border, so it will be alpha-blended atop the contents.
+ // This looks slightly better in the corners than drawing the contents atop
+ // the border.
+ PaintBorder(canvas);
}
void AutocompletePopupContentsView::Layout() {
« no previous file with comments | « chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698