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

Side by Side Diff: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.mm

Issue 6927058: Merge 83125 - Add and use gfx::ScopedNSGraphicsContextState (ui/gfx/scoped_ns_graphics_context_st... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h ('k') | ui/ui_gfx.gypi » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 5 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
6 6
7 #include <AppKit/AppKit.h> 7 #include <AppKit/AppKit.h>
8 8
9 namespace gfx { 9 namespace gfx {
10 10
11 ScopedNSGraphicsContextSaveGState::ScopedNSGraphicsContextSaveGState( 11 ScopedNSGraphicsContextSaveGState::ScopedNSGraphicsContextSaveGState(
12 NSGraphicsContext* context) : context_([context retain]) { 12 NSGraphicsContext* context) : context_([context retain]) {
13 if (!context_) 13 if (!context_)
14 context_.reset([[NSGraphicsContext currentContext] retain]); 14 context_.reset([[NSGraphicsContext currentContext] retain]);
15 [context_ saveGraphicsState]; 15 [context_ saveGraphicsState];
16 } 16 }
17 17
18 ScopedNSGraphicsContextSaveGState::~ScopedNSGraphicsContextSaveGState() { 18 ScopedNSGraphicsContextSaveGState::~ScopedNSGraphicsContextSaveGState() {
19 [context_ restoreGraphicsState]; 19 [context_ restoreGraphicsState];
20 } 20 }
21 21
22 } // namespace gfx 22 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h ('k') | ui/ui_gfx.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698