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

Unified Diff: ui/gl/gl_surface_egl.h

Issue 49533003: Add support for Khr_surfaceless_context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Fix: Use SurfacelessEGL only if requested size is 0,0. Created 7 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 | « no previous file | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.h
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h
index 68a99af0e06b8a8cff81f5b7b6e51e70fb2a7006..6cdaf5d2620c0614cdecd8b19fed95d3945256a3 100644
--- a/ui/gl/gl_surface_egl.h
+++ b/ui/gl/gl_surface_egl.h
@@ -111,6 +111,32 @@ class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL {
DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL);
};
+// SurfacelessEGL is used as Offscreen surface when platform supports
+// KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the
+// need to create a dummy EGLsurface in case we render to client API targets.
+class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL {
+ public:
+ explicit SurfacelessEGL(const gfx::Size& size);
+
+ // Implement GLSurface.
+ virtual EGLConfig GetConfig() OVERRIDE;
+ virtual bool Initialize() OVERRIDE;
+ virtual void Destroy() OVERRIDE;
+ virtual bool IsOffscreen() OVERRIDE;
+ virtual bool SwapBuffers() OVERRIDE;
+ virtual gfx::Size GetSize() OVERRIDE;
+ virtual bool Resize(const gfx::Size& size) OVERRIDE;
+ virtual EGLSurface GetHandle() OVERRIDE;
+ virtual void* GetShareHandle() OVERRIDE;
+
+ protected:
+ virtual ~SurfacelessEGL();
+
+ private:
+ gfx::Size size_;
+ DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL);
+};
+
} // namespace gfx
#endif // UI_GL_GL_SURFACE_EGL_H_
« no previous file with comments | « no previous file | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698