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

Unified Diff: ui/base/cocoa/controls/blue_label_button.mm

Issue 1368883002: Mac: restore subpixel AA in the find bar when it doesn't have focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments Created 5 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 | « ui/base/BUILD.gn ('k') | ui/base/cocoa/scoped_cg_context_smooth_fonts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/controls/blue_label_button.mm
diff --git a/ui/base/cocoa/controls/blue_label_button.mm b/ui/base/cocoa/controls/blue_label_button.mm
index d6021460b4622022d257c94b0d11d7094d06bc7f..319fff85a54fb51fcb4a35c48bf87f2e48156876 100644
--- a/ui/base/cocoa/controls/blue_label_button.mm
+++ b/ui/base/cocoa/controls/blue_label_button.mm
@@ -7,6 +7,7 @@
#include "base/mac/foundation_util.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/base/cocoa/scoped_cg_context_smooth_fonts.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
@@ -93,13 +94,7 @@ const SkColor kPressOuterRingColor = SkColorSetRGB(0x23, 0x52, 0xa2);
// Fuzz factor to adjust for the drop shadow. Based on visual inspection.
frame.origin.y -= 1;
- // Ensure LCD font smoothing is enabled when layer backed.
- // This is safe to do because we know we are drawing on an opaque background.
- gfx::ScopedNSGraphicsContextSaveGState scopedGState;
- NSGraphicsContext* context = [NSGraphicsContext currentContext];
- CGContextRef cgContext = static_cast<CGContextRef>([context graphicsPort]);
- CGContextSetShouldSmoothFonts(cgContext, true);
-
+ ui::ScopedCGContextSmoothFonts fontSmoothing;
NSAttributedString* attributedTitle =
[[self class] generateAttributedString:[self title]];
[attributedTitle drawInRect:frame];
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/cocoa/scoped_cg_context_smooth_fonts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698