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

Unified Diff: ui/gfx/gl/gl_context_win.cc

Issue 6839008: Split EGLContext in GLContextEGL and GLSurfaceEGL. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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/gfx/gl/gl_context_linux.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_context_win.cc
===================================================================
--- ui/gfx/gl/gl_context_win.cc (revision 81471)
+++ ui/gfx/gl/gl_context_win.cc (working copy)
@@ -17,6 +17,7 @@
#include "ui/gfx/gl/gl_context_osmesa.h"
#include "ui/gfx/gl/gl_context_stub.h"
#include "ui/gfx/gl/gl_implementation.h"
+#include "ui/gfx/gl/gl_surface_egl.h"
namespace gfx {
@@ -132,10 +133,6 @@
static int g_regular_pixel_format = 0;
static int g_multisampled_pixel_format = 0;
-// When using ANGLE we still need a window for D3D. This context creates the
-// D3D device.
-static BaseEGLContext* g_default_context;
-
const PIXELFORMATDESCRIPTOR kPixelFormatDescriptor = {
sizeof(kPixelFormatDescriptor), // Size of structure.
1, // Default version.
@@ -313,8 +310,8 @@
break;
}
case kGLImplementationEGLGLES2:
- if (!BaseEGLContext::InitializeOneOff()) {
- LOG(ERROR) << "BaseEGLContext::InitializeOneOff failed.";
+ if (!GLSurfaceEGL::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
return false;
}
break;
@@ -551,11 +548,16 @@
return context.release();
}
case kGLImplementationEGLGLES2: {
- scoped_ptr<NativeViewEGLContext> context(
- new NativeViewEGLContext(window));
- if (!context->Initialize())
+ scoped_ptr<NativeViewGLSurfaceEGL> surface(new NativeViewGLSurfaceEGL(
+ window));
+ if (!surface->Initialize())
return NULL;
+ scoped_ptr<GLContextEGL> context(
+ new GLContextEGL(surface.release()));
+ if (!context->Initialize(NULL))
+ return NULL;
+
return context.release();
}
case kGLImplementationDesktopGL: {
@@ -706,20 +708,12 @@
return context.release();
}
case kGLImplementationEGLGLES2: {
- if (!shared_context) {
- if (!g_default_context) {
- scoped_ptr<NativeViewEGLContext> default_context(
- new NativeViewEGLContext(g_window));
- if (!default_context->Initialize())
- return NULL;
+ scoped_ptr<PbufferGLSurfaceEGL> surface(new PbufferGLSurfaceEGL(
+ gfx::Size(1, 1)));
+ if (!surface->Initialize())
+ return NULL;
- g_default_context = default_context.release();
- }
- shared_context = g_default_context;
- }
-
- scoped_ptr<SecondaryEGLContext> context(
- new SecondaryEGLContext());
+ scoped_ptr<GLContextEGL> context(new GLContextEGL(surface.release()));
if (!context->Initialize(shared_context))
return NULL;
« no previous file with comments | « ui/gfx/gl/gl_context_linux.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698