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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm

Issue 240093006: CoreAnimation: Fix text anti-aliasing in download shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_omnibox_aa
Patch Set: Fix typo Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_button.mm » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } else { 398 } else {
399 // Mouse tracked out of button during menu track. Hide menus. 399 // Mouse tracked out of button during menu track. Hide menus.
400 if (!wasInside) 400 if (!wasInside)
401 [delegate_ bookmarkDragDidEnd:self 401 [delegate_ bookmarkDragDidEnd:self
402 operation:NSDragOperationNone]; 402 operation:NSDragOperationNone];
403 } 403 }
404 return kDraggableButtonMixinDidWork; 404 return kDraggableButtonMixinDidWork;
405 } 405 }
406 406
407 - (BOOL)isOpaque { 407 - (BOOL)isOpaque {
408 // Make this control opaque so that sub pixel anti aliasing works when core 408 // Make this control opaque so that sub-pixel anti-aliasing works when
409 // animation is enabled. 409 // CoreAnimation is enabled.
410 return YES; 410 return YES;
411 } 411 }
412 412
413 - (void)drawRect:(NSRect)rect { 413 - (void)drawRect:(NSRect)rect {
414 NSView* toolbarView = [[self superview] superview]; 414 NSView* bookmarkBarToolbarView = [[self superview] superview];
415 [self cr_drawUsingAncestor:toolbarView inRect:(NSRect)rect]; 415 [self cr_drawUsingAncestor:bookmarkBarToolbarView inRect:(NSRect)rect];
416 [super drawRect:rect]; 416 [super drawRect:rect];
417 } 417 }
418 418
419 @end 419 @end
420 420
421 @implementation BookmarkButton(Private) 421 @implementation BookmarkButton(Private)
422 422
423 423
424 - (void)installCustomTrackingArea { 424 - (void)installCustomTrackingArea {
425 const NSTrackingAreaOptions options = 425 const NSTrackingAreaOptions options =
(...skipping 30 matching lines...) Expand all
456 [[cell clipPathForFrame:bounds inView:self] setClip]; 456 [[cell clipPathForFrame:bounds inView:self] setClip];
457 [cell drawWithFrame:bounds inView:self]; 457 [cell drawWithFrame:bounds inView:self];
458 458
459 CGContextEndTransparencyLayer(cgContext); 459 CGContextEndTransparencyLayer(cgContext);
460 [image unlockFocus]; 460 [image unlockFocus];
461 461
462 return image.autorelease(); 462 return image.autorelease();
463 } 463 }
464 464
465 @end // @implementation BookmarkButton(Private) 465 @end // @implementation BookmarkButton(Private)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698