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

Unified Diff: chrome/browser/ui/cocoa/download/download_item_cell.mm

Issue 7572031: Always call the class methods to save/restore contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ensure saving before context access Created 9 years, 4 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
Index: chrome/browser/ui/cocoa/download/download_item_cell.mm
diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm
index ee2a597c3497e642a1681dd8c3052e91c5e10942..d35d27540c695f07561aada89a40384cb6fa867b 100644
--- a/chrome/browser/ui/cocoa/download/download_item_cell.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm
@@ -406,14 +406,14 @@ const int kInterruptedAnimationDuration = 2.5;
nil];
NSPoint secondaryPos =
NSMakePoint(innerFrame.origin.x + kTextPosLeft, kSecondaryTextPosTop);
+
+ gfx::ScopedNSGraphicsContextSaveGState contextSave;
NSGraphicsContext* nsContext = [NSGraphicsContext currentContext];
CGContextRef cgContext = (CGContextRef)[nsContext graphicsPort];
- [nsContext saveGraphicsState];
[nsContext setCompositingOperation:NSCompositeSourceOver];
CGContextSetAlpha(cgContext, statusAlpha_);
[secondaryText drawAtPoint:secondaryPos
withAttributes:secondaryTextAttributes];
- [nsContext restoreGraphicsState];
}
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
@@ -579,8 +579,7 @@ const int kInterruptedAnimationDuration = 2.5;
[triangle lineToPoint:p3];
[triangle closePath];
- NSGraphicsContext* context = [NSGraphicsContext currentContext];
- gfx::ScopedNSGraphicsContextSaveGState scopedGState(context);
+ gfx::ScopedNSGraphicsContextSaveGState scopedGState;
scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]);
[shadow.get() setShadowColor:[NSColor whiteColor]];

Powered by Google App Engine
This is Rietveld 408576698