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

Unified Diff: ui/gl/gl_fence.cc

Issue 2447533002: ui: Add ref-counting to GLFence class.
Patch Set: rebase Created 4 years, 2 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_fence.h ('k') | ui/gl/gl_fence_apple.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_fence.cc
diff --git a/ui/gl/gl_fence.cc b/ui/gl/gl_fence.cc
index 126aa4ca517666b11b9200e49557b4294de88f23..e69d4cf144dca6c4e298885b29e6cd8accd317c3 100644
--- a/ui/gl/gl_fence.cc
+++ b/ui/gl/gl_fence.cc
@@ -39,35 +39,35 @@ bool GLFence::IsSupported() {
g_driver_gl.ext.b_GL_NV_fence;
}
-GLFence* GLFence::Create() {
+scoped_refptr<GLFence> GLFence::Create() {
DCHECK(GLContext::GetCurrent())
<< "Trying to create fence with no context";
- std::unique_ptr<GLFence> fence;
+ scoped_refptr<GLFence> fence;
#if !defined(OS_MACOSX)
if (g_driver_egl.ext.b_EGL_KHR_fence_sync &&
g_driver_egl.ext.b_EGL_KHR_wait_sync) {
// Prefer GLFenceEGL which doesn't require GL context switching.
- fence.reset(new GLFenceEGL);
+ fence = make_scoped_refptr(new GLFenceEGL);
} else
#endif
if (g_driver_gl.ext.b_GL_ARB_sync || GetGLVersionInfo()->is_es3 ||
GetGLVersionInfo()->is_desktop_core_profile) {
// Prefer ARB_sync which supports server-side wait.
- fence.reset(new GLFenceARB);
+ fence = make_scoped_refptr(new GLFenceARB);
#if defined(OS_MACOSX)
} else if (g_driver_gl.ext.b_GL_APPLE_fence) {
- fence.reset(new GLFenceAPPLE);
+ fence = make_scoped_refptr(new GLFenceAPPLE);
#else
} else if (g_driver_egl.ext.b_EGL_KHR_fence_sync) {
- fence.reset(new GLFenceEGL);
+ fence = make_scoped_refptr(new GLFenceEGL);
#endif
} else if (g_driver_gl.ext.b_GL_NV_fence) {
- fence.reset(new GLFenceNV);
+ fence = make_scoped_refptr(new GLFenceNV);
}
DCHECK_EQ(!!fence.get(), GLFence::IsSupported());
- return fence.release();
+ return fence;
}
bool GLFence::ResetSupported() {
« no previous file with comments | « ui/gl/gl_fence.h ('k') | ui/gl/gl_fence_apple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698