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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.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/ppapi/ppapi_plugin_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index 616fde04f74950bb7e95885f10ab13c85c7f8f06..d492363ccc26e2c2a521de035c83ab3803735310 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/blit.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/gfx_conversion.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -521,7 +522,7 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas,
data_provider, NULL, false, kCGRenderingIntentDefault));
// Flip the transform
- CGContextSaveGState(canvas);
+ gfx::ScopedCGContextSaveGState save_gstate(canvas)
float window_height = static_cast<float>(CGBitmapContextGetHeight(canvas));
CGContextTranslateCTM(canvas, 0, window_height);
CGContextScaleCTM(canvas, 1.0, -1.0);
@@ -554,7 +555,6 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas,
// if the is_always_opaque_ flag is set. Must ensure bitmap is still clipped.
CGContextDrawImage(canvas, bitmap_rect, image);
- CGContextRestoreGState(canvas);
#else
SkRect sk_plugin_rect = SkRect::MakeXYWH(
SkIntToScalar(plugin_rect.origin().x()),
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698