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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10869031: mac: Use ScopedCGContextSaveGState in a few more places (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « webkit/plugins/npapi/webplugin_delegate_impl_mac.mm ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 11378904d637a7e86fd18a7db0a6c42dd43b9cca..d1a1a1d2899bf4c38ef3db790c7d3824b1220d81 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -60,6 +60,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "ui/base/range/range.h"
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "webkit/plugins/plugin_constants.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/event_conversion.h"
@@ -1620,7 +1621,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
if (metafile.InitFromData(mapper.data(), mapper.size())) {
// Flip the transform.
CGContextRef cgContext = canvas;
- CGContextSaveGState(cgContext);
+ gfx::ScopedCGContextSaveGState save_gstate(cgContext)
CGContextTranslateCTM(cgContext, 0,
current_print_settings_.printable_area.size.height);
CGContextScaleCTM(cgContext, 1.0, -1.0);
@@ -1631,7 +1632,6 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
page_rect.size.height = current_print_settings_.printable_area.size.height;
ret = metafile.RenderPage(1, cgContext, page_rect, true, false, true, true);
- CGContextRestoreGState(cgContext);
}
#elif defined(OS_WIN)
printing::Metafile* metafile =
« no previous file with comments | « webkit/plugins/npapi/webplugin_delegate_impl_mac.mm ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698