summaryrefslogtreecommitdiffstats
path: root/ui/gl
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 18:00:22 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 18:00:22 +0000
commit4e0f45f5cc4911b529040c82058b255049426e93 (patch)
tree6535c84613ab4f672f08b27d2b2d36cffa4bce92 /ui/gl
parentf7d2580cf40718cb427f8587e9f1f6f6f837ba39 (diff)
downloadchromium_src-4e0f45f5cc4911b529040c82058b255049426e93.zip
chromium_src-4e0f45f5cc4911b529040c82058b255049426e93.tar.gz
chromium_src-4e0f45f5cc4911b529040c82058b255049426e93.tar.bz2
RefCounted types should not have public destructors, Linux fixes
BUG=123295 TEST=none Review URL: https://chromiumcodereview.appspot.com/10392152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r--ui/gl/gl_context_egl.cc26
-rw-r--r--ui/gl/gl_context_egl.h4
-rw-r--r--ui/gl/gl_context_glx.cc8
-rw-r--r--ui/gl/gl_context_glx.h4
-rw-r--r--ui/gl/gl_surface_egl.cc24
-rw-r--r--ui/gl/gl_surface_egl.h9
-rw-r--r--ui/gl/gl_surface_glx.cc34
-rw-r--r--ui/gl/gl_surface_glx.h10
-rw-r--r--ui/gl/gl_surface_linux.cc12
9 files changed, 70 insertions, 61 deletions
diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc
index fa655a0..f77c9f9 100644
--- a/ui/gl/gl_context_egl.cc
+++ b/ui/gl/gl_context_egl.cc
@@ -24,15 +24,6 @@ extern "C" {
namespace gfx {
-std::string GLContextEGL::GetExtensions() {
- const char* extensions = eglQueryString(display_,
- EGL_EXTENSIONS);
- if (!extensions)
- return GLContext::GetExtensions();
-
- return GLContext::GetExtensions() + " " + extensions;
-}
-
GLContextEGL::GLContextEGL(GLShareGroup* share_group)
: GLContext(share_group),
context_(NULL),
@@ -40,10 +31,6 @@ GLContextEGL::GLContextEGL(GLShareGroup* share_group)
config_(NULL) {
}
-GLContextEGL::~GLContextEGL() {
- Destroy();
-}
-
bool GLContextEGL::Initialize(
GLSurface* compatible_surface, GpuPreference gpu_preference) {
DCHECK(compatible_surface);
@@ -157,4 +144,17 @@ void GLContextEGL::SetSwapInterval(int interval) {
}
}
+std::string GLContextEGL::GetExtensions() {
+ const char* extensions = eglQueryString(display_,
+ EGL_EXTENSIONS);
+ if (!extensions)
+ return GLContext::GetExtensions();
+
+ return GLContext::GetExtensions() + " " + extensions;
+}
+
+GLContextEGL::~GLContextEGL() {
+ Destroy();
+}
+
} // namespace gfx
diff --git a/ui/gl/gl_context_egl.h b/ui/gl/gl_context_egl.h
index 4e98da8..33e8c94 100644
--- a/ui/gl/gl_context_egl.h
+++ b/ui/gl/gl_context_egl.h
@@ -23,7 +23,6 @@ class GLSurface;
class GLContextEGL : public GLContext {
public:
explicit GLContextEGL(GLShareGroup* share_group);
- virtual ~GLContextEGL();
// Implement GLContext.
virtual bool Initialize(
@@ -36,6 +35,9 @@ class GLContextEGL : public GLContext {
virtual void SetSwapInterval(int interval) OVERRIDE;
virtual std::string GetExtensions() OVERRIDE;
+ protected:
+ virtual ~GLContextEGL();
+
private:
EGLContext context_;
EGLDisplay display_;
diff --git a/ui/gl/gl_context_glx.cc b/ui/gl/gl_context_glx.cc
index af94040..b8d13892 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -38,10 +38,6 @@ GLContextGLX::GLContextGLX(GLShareGroup* share_group)
display_(NULL) {
}
-GLContextGLX::~GLContextGLX() {
- Destroy();
-}
-
Display* GLContextGLX::display() {
return display_;
}
@@ -250,4 +246,8 @@ bool GLContextGLX::WasAllocatedUsingARBRobustness() {
return GLSurfaceGLX::IsCreateContextRobustnessSupported();
}
+GLContextGLX::~GLContextGLX() {
+ Destroy();
+}
+
} // namespace gfx
diff --git a/ui/gl/gl_context_glx.h b/ui/gl/gl_context_glx.h
index 60155df..8ddcae7 100644
--- a/ui/gl/gl_context_glx.h
+++ b/ui/gl/gl_context_glx.h
@@ -20,7 +20,6 @@ class GLSurface;
class GLContextGLX : public GLContext {
public:
explicit GLContextGLX(GLShareGroup* share_group);
- virtual ~GLContextGLX();
Display* display();
@@ -36,6 +35,9 @@ class GLContextGLX : public GLContext {
virtual std::string GetExtensions() OVERRIDE;
virtual bool WasAllocatedUsingARBRobustness() OVERRIDE;
+ protected:
+ virtual ~GLContextGLX();
+
private:
void* context_;
Display* display_;
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 4eae2b8..b35806d 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -40,11 +40,7 @@ EGLDisplay g_software_display;
EGLNativeDisplayType g_software_native_display;
}
-GLSurfaceEGL::GLSurfaceEGL() : software_(false) {
-}
-
-GLSurfaceEGL::~GLSurfaceEGL() {
-}
+GLSurfaceEGL::GLSurfaceEGL() : software_(false) {}
bool GLSurfaceEGL::InitializeOneOff() {
static bool initialized = false;
@@ -164,6 +160,8 @@ EGLNativeDisplayType GLSurfaceEGL::GetNativeDisplay() {
return g_native_display;
}
+GLSurfaceEGL::~GLSurfaceEGL() {}
+
NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software,
gfx::AcceleratedWidget window)
: window_(window),
@@ -173,10 +171,6 @@ NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software,
software_ = software;
}
-NativeViewGLSurfaceEGL::~NativeViewGLSurfaceEGL() {
- Destroy();
-}
-
bool NativeViewGLSurfaceEGL::Initialize() {
#if defined(OS_ANDROID)
NOTREACHED();
@@ -358,6 +352,10 @@ bool NativeViewGLSurfaceEGL::PostSubBuffer(
return true;
}
+NativeViewGLSurfaceEGL::~NativeViewGLSurfaceEGL() {
+ Destroy();
+}
+
void NativeViewGLSurfaceEGL::SetHandle(EGLSurface surface) {
surface_ = surface;
}
@@ -368,10 +366,6 @@ PbufferGLSurfaceEGL::PbufferGLSurfaceEGL(bool software, const gfx::Size& size)
software_ = software;
}
-PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() {
- Destroy();
-}
-
bool PbufferGLSurfaceEGL::Initialize() {
DCHECK(!surface_);
@@ -473,4 +467,8 @@ void* PbufferGLSurfaceEGL::GetShareHandle() {
#endif
}
+PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() {
+ Destroy();
+}
+
} // namespace gfx
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h
index dc6f418..bce2206 100644
--- a/ui/gl/gl_surface_egl.h
+++ b/ui/gl/gl_surface_egl.h
@@ -33,7 +33,6 @@ namespace gfx {
class GL_EXPORT GLSurfaceEGL : public GLSurface {
public:
GLSurfaceEGL();
- virtual ~GLSurfaceEGL();
// Implement GLSurface.
virtual EGLDisplay GetDisplay() OVERRIDE;
@@ -44,6 +43,8 @@ class GL_EXPORT GLSurfaceEGL : public GLSurface {
static EGLNativeDisplayType GetNativeDisplay();
protected:
+ virtual ~GLSurfaceEGL();
+
bool software_;
private:
@@ -54,7 +55,6 @@ class GL_EXPORT GLSurfaceEGL : public GLSurface {
class NativeViewGLSurfaceEGL : public GLSurfaceEGL {
public:
NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window);
- virtual ~NativeViewGLSurfaceEGL();
// Implement GLSurface.
virtual EGLConfig GetConfig() OVERRIDE;
@@ -68,6 +68,7 @@ class NativeViewGLSurfaceEGL : public GLSurfaceEGL {
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
protected:
+ virtual ~NativeViewGLSurfaceEGL();
void SetHandle(EGLSurface surface);
private:
@@ -83,7 +84,6 @@ class NativeViewGLSurfaceEGL : public GLSurfaceEGL {
class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL {
public:
PbufferGLSurfaceEGL(bool software, const gfx::Size& size);
- virtual ~PbufferGLSurfaceEGL();
// Implement GLSurface.
virtual EGLConfig GetConfig() OVERRIDE;
@@ -96,6 +96,9 @@ class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL {
virtual EGLSurface GetHandle() OVERRIDE;
virtual void* GetShareHandle() OVERRIDE;
+ protected:
+ virtual ~PbufferGLSurfaceEGL();
+
private:
gfx::Size size_;
EGLSurface surface_;
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index ba8ce92..a5609cd 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -38,11 +38,7 @@ bool g_glx_create_context_robustness_supported = false;
} // namespace anonymous
-GLSurfaceGLX::GLSurfaceGLX() {
-}
-
-GLSurfaceGLX::~GLSurfaceGLX() {
-}
+GLSurfaceGLX::GLSurfaceGLX() {}
bool GLSurfaceGLX::InitializeOneOff() {
static bool initialized = false;
@@ -103,20 +99,13 @@ void* GLSurfaceGLX::GetDisplay() {
return g_display;
}
+GLSurfaceGLX::~GLSurfaceGLX() {}
+
NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window)
: window_(window),
config_(NULL) {
}
-NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX()
- : window_(0),
- config_(NULL) {
-}
-
-NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() {
- Destroy();
-}
-
bool NativeViewGLSurfaceGLX::Initialize() {
XWindowAttributes attributes;
if (!XGetWindowAttributes(g_display, window_, &attributes)) {
@@ -234,16 +223,21 @@ bool NativeViewGLSurfaceGLX::PostSubBuffer(
return true;
}
+NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX()
+ : window_(0),
+ config_(NULL) {
+}
+
+NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() {
+ Destroy();
+}
+
PbufferGLSurfaceGLX::PbufferGLSurfaceGLX(const gfx::Size& size)
: size_(size),
config_(NULL),
pbuffer_(0) {
}
-PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
- Destroy();
-}
-
bool PbufferGLSurfaceGLX::Initialize() {
DCHECK(!pbuffer_);
@@ -323,4 +317,8 @@ void* PbufferGLSurfaceGLX::GetConfig() {
return config_;
}
+PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
+ Destroy();
+}
+
} // namespace gfx
diff --git a/ui/gl/gl_surface_glx.h b/ui/gl/gl_surface_glx.h
index ac4655e..f4416e8 100644
--- a/ui/gl/gl_surface_glx.h
+++ b/ui/gl/gl_surface_glx.h
@@ -19,7 +19,6 @@ namespace gfx {
class GL_EXPORT GLSurfaceGLX : public GLSurface {
public:
GLSurfaceGLX();
- virtual ~GLSurfaceGLX();
static bool InitializeOneOff();
@@ -36,6 +35,9 @@ class GL_EXPORT GLSurfaceGLX : public GLSurface {
// a GLX drawable.
virtual void* GetConfig() = 0;
+ protected:
+ virtual ~GLSurfaceGLX();
+
private:
DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX);
};
@@ -44,7 +46,6 @@ class GL_EXPORT GLSurfaceGLX : public GLSurface {
class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
public:
explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window);
- virtual ~NativeViewGLSurfaceGLX();
// Implement GLSurfaceGLX.
virtual bool Initialize() OVERRIDE;
@@ -60,6 +61,7 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
protected:
NativeViewGLSurfaceGLX();
+ virtual ~NativeViewGLSurfaceGLX();
gfx::AcceleratedWidget window_;
@@ -74,7 +76,6 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX {
public:
explicit PbufferGLSurfaceGLX(const gfx::Size& size);
- virtual ~PbufferGLSurfaceGLX();
// Implement GLSurfaceGLX.
virtual bool Initialize() OVERRIDE;
@@ -85,6 +86,9 @@ class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX {
virtual void* GetHandle() OVERRIDE;
virtual void* GetConfig() OVERRIDE;
+ protected:
+ virtual ~PbufferGLSurfaceGLX();
+
private:
gfx::Size size_;
void* config_;
diff --git a/ui/gl/gl_surface_linux.cc b/ui/gl/gl_surface_linux.cc
index a7dbdf0..d657605 100644
--- a/ui/gl/gl_surface_linux.cc
+++ b/ui/gl/gl_surface_linux.cc
@@ -26,7 +26,6 @@ Display* g_osmesa_display;
class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
public:
explicit NativeViewGLSurfaceOSMesa(gfx::AcceleratedWidget window);
- virtual ~NativeViewGLSurfaceOSMesa();
static bool InitializeOneOff();
@@ -39,6 +38,9 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
virtual std::string GetExtensions() OVERRIDE;
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
+ protected:
+ virtual ~NativeViewGLSurfaceOSMesa();
+
private:
GC window_graphics_context_;
gfx::AcceleratedWidget window_;
@@ -85,10 +87,6 @@ NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
DCHECK(window);
}
-NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
- Destroy();
-}
-
bool NativeViewGLSurfaceOSMesa::InitializeOneOff() {
static bool initialized = false;
if (initialized)
@@ -260,6 +258,10 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
return true;
}
+NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
+ Destroy();
+}
+
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::AcceleratedWidget window) {