| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
|
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
|
| index 1060e590d2dab876b05844d87e9f5d6eeab167bf..8ae613de662720bea51cac2128a2f5d9c88fdca9 100644
|
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
|
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
|
| @@ -13,6 +13,7 @@
|
| #include "ui/base/theme_provider.h"
|
| #include "ui/gfx/canvas_skia_paint.h"
|
| #include "ui/gfx/rect.h"
|
| +#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
|
|
|
| const CGFloat kBorderRadius = 3.0;
|
|
|
| @@ -56,7 +57,7 @@ const CGFloat kBorderRadius = 3.0;
|
| return;
|
|
|
| NSGraphicsContext* context = [NSGraphicsContext currentContext];
|
| - [context saveGraphicsState];
|
| + gfx::ScopedNSGraphicsContextSaveGState scopedGState(context);
|
|
|
| // Draw the background.
|
| {
|
| @@ -101,15 +102,16 @@ const CGFloat kBorderRadius = 3.0;
|
| [border fill];
|
|
|
| // Fade in/out the background.
|
| - [context saveGraphicsState];
|
| - [border setClip];
|
| - CGContextRef cgContext = (CGContextRef)[context graphicsPort];
|
| - CGContextBeginTransparencyLayer(cgContext, NULL);
|
| - CGContextSetAlpha(cgContext, 1 - morph);
|
| - [context setPatternPhase:[[self window] themePatternPhase]];
|
| - [self drawBackground];
|
| - CGContextEndTransparencyLayer(cgContext);
|
| - [context restoreGraphicsState];
|
| + {
|
| + gfx::ScopedNSGraphicsContextSaveGState bgScopedState(context);
|
| + [border setClip];
|
| + CGContextRef cgContext = (CGContextRef)[context graphicsPort];
|
| + CGContextBeginTransparencyLayer(cgContext, NULL);
|
| + CGContextSetAlpha(cgContext, 1 - morph);
|
| + [context setPatternPhase:[[self window] themePatternPhase]];
|
| + [self drawBackground];
|
| + CGContextEndTransparencyLayer(cgContext);
|
| + }
|
|
|
| // Draw the border of the rounded rectangle.
|
| NSColor* borderColor = themeProvider->GetNSColor(
|
| @@ -133,9 +135,6 @@ const CGFloat kBorderRadius = 3.0;
|
| [divider moveToPoint:dividerStart];
|
| [divider relativeLineToPoint:NSMakePoint(dividerWidth, 0)];
|
| [divider stroke];
|
| -
|
| - // Restore the graphics context.
|
| - [context restoreGraphicsState];
|
| }
|
|
|
| @end // @implementation BookmarkBarToolbarView
|
|
|