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

Unified Diff: chrome/default_plugin/plugin_impl_mac.mm

Issue 7572031: Always call the class methods to save/restore contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reword 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/default_plugin/plugin_impl_mac.mm
diff --git a/chrome/default_plugin/plugin_impl_mac.mm b/chrome/default_plugin/plugin_impl_mac.mm
index eb0ee08e711d3f92541e02df7b24de1aab43a223..b6deb280604a019a7d1bb8af9baecea5ed231825 100644
--- a/chrome/default_plugin/plugin_impl_mac.mm
+++ b/chrome/default_plugin/plugin_impl_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,6 +17,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "unicode/locid.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/default_plugin_shared.h"
@@ -139,7 +140,7 @@ void PluginInstallerImpl::DownloadCancelled() {
}
int16 PluginInstallerImpl::OnDrawRect(CGContextRef context, CGRect dirty_rect) {
- [NSGraphicsContext saveGraphicsState];
+ gfx::ScopedNSGraphicsContextSaveGState scoped_state;
NSGraphicsContext* ns_context = [NSGraphicsContext
graphicsContextWithGraphicsPort:context flipped:YES];
[NSGraphicsContext setCurrentContext:ns_context];
@@ -183,7 +184,6 @@ int16 PluginInstallerImpl::OnDrawRect(CGContextRef context, CGRect dirty_rect) {
label_point = NSMakePoint(roundf(label_point.x), roundf(label_point.y));
[command_ drawAtPoint:label_point withAttributes:attributes];
- [NSGraphicsContext restoreGraphicsState];
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698