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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 15848005: Cleanup: Remove ScopedGenericObj. Use scoped_ptr<type, CustomDeleter> instead. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address mark comments, rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
===================================================================
--- ui/gl/gl_context_cgl.cc (revision 202646)
+++ ui/gl/gl_context_cgl.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_cgl.h"
@@ -17,8 +18,19 @@
namespace gfx {
+namespace {
+
bool g_support_renderer_switching;
+struct CGLRendererInfoObjDeleter {
+ void operator()(CGLRendererInfoObj* x) {
+ if (x)
+ CGLDestroyRendererInfo(*x);
+ }
+};
+
+} // namespace
+
static CGLPixelFormatObj GetPixelFormat() {
static CGLPixelFormatObj format;
if (format)
@@ -245,7 +257,8 @@
&num_renderers) != kCGLNoError)
return false;
- ScopedCGLRendererInfoObj scoper(renderer_info);
+ scoped_ptr<CGLRendererInfoObj,
+ CGLRendererInfoObjDeleter> scoper(&renderer_info);
for (GLint renderer_index = 0;
renderer_index < num_renderers;
@@ -286,8 +299,4 @@
return gpu_preference_;
}
-void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const {
- CGLDestroyRendererInfo(x);
-}
-
} // namespace gfx
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698