Commit 345c4481 authored by boliu@chromium.org's avatar boliu@chromium.org

Android GLNonOwnedContext support GLVirtualContext

GLVirtualContext expects the share group to have a "real" context.

BUG=230195
Android only change. Ran through android trybots.
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/14241033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195289 0039d316-1c4b-4281-b951-d872f2087c98
parent 56326708
...@@ -21,7 +21,7 @@ namespace { ...@@ -21,7 +21,7 @@ namespace {
// that we do not have ownership of (draw callback). // that we do not have ownership of (draw callback).
class GLNonOwnedContext : public GLContext { class GLNonOwnedContext : public GLContext {
public: public:
GLNonOwnedContext(); GLNonOwnedContext(GLShareGroup* share_group);
// Implement GLContext. // Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface, virtual bool Initialize(GLSurface* compatible_surface,
...@@ -43,7 +43,8 @@ class GLNonOwnedContext : public GLContext { ...@@ -43,7 +43,8 @@ class GLNonOwnedContext : public GLContext {
DISALLOW_COPY_AND_ASSIGN(GLNonOwnedContext); DISALLOW_COPY_AND_ASSIGN(GLNonOwnedContext);
}; };
GLNonOwnedContext::GLNonOwnedContext() : GLContext(NULL) {} GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group)
: GLContext(share_group) {}
bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) { bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) {
SetCurrent(this, surface); SetCurrent(this, surface);
...@@ -69,7 +70,7 @@ scoped_refptr<GLContext> GLContext::CreateGLContext( ...@@ -69,7 +70,7 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(
if (compatible_surface->GetHandle()) if (compatible_surface->GetHandle())
context = new GLContextEGL(share_group); context = new GLContextEGL(share_group);
else else
context = new GLNonOwnedContext(); context = new GLNonOwnedContext(share_group);
if (!context->Initialize(compatible_surface, gpu_preference)) if (!context->Initialize(compatible_surface, gpu_preference))
return NULL; return NULL;
return context; return context;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment