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

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

Issue 6904026: Add and use gfx::ScopedNSGraphicsContextState (ui/gfx/scoped_ns_graphics_context_state_mac.h). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 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 cb18b487c3c19551cc30f70663222a034eb8926b..4cf4fdf59370509962fd5bba8c510fce62e3c902 100644
--- a/chrome/browser/ui/cocoa/download/download_item_cell.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm
@@ -19,6 +19,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas_skia_paint.h"
+#include "ui/gfx/scoped_ns_graphics_context_state_mac.h"
namespace {
@@ -653,7 +654,7 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
[triangle closePath];
NSGraphicsContext* context = [NSGraphicsContext currentContext];
- [context saveGraphicsState];
+ gfx::ScopedNSGraphicsContextState scopedGState(context);
scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]);
[shadow.get() setShadowColor:[NSColor whiteColor]];
@@ -665,8 +666,6 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
[fill setFill];
[triangle fill];
-
- [context restoreGraphicsState];
}
- (NSRect)imageRectForBounds:(NSRect)cellFrame {

Powered by Google App Engine
This is Rietveld 408576698