Commit 04da41bf authored by boliu@chromium.org's avatar boliu@chromium.org

[Android WebView] Fix async upload

AsyncPixelTransferManager checks for some EGL specific
extensions that are available on the device, but was not
correctly retrieved by the GLNonOwnedContext.

Note that GLNonOwnedContext is only used on android webview,
not chrome on android.

BUG=287962

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222208 0039d316-1c4b-4281-b951-d872f2087c98
parent ea468c6c
......@@ -20,15 +20,14 @@ namespace {
// Used to render into an already current context+surface,
// that we do not have ownership of (draw callback).
// TODO(boliu): Make this inherit from GLContextEGL.
class GLNonOwnedContext : public GLContextReal {
public:
GLNonOwnedContext(GLShareGroup* share_group);
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
GpuPreference gpu_preference) OVERRIDE {
return true;
}
GpuPreference gpu_preference) OVERRIDE;
virtual void Destroy() OVERRIDE {}
virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE {}
......@@ -42,10 +41,18 @@ class GLNonOwnedContext : public GLContextReal {
private:
DISALLOW_COPY_AND_ASSIGN(GLNonOwnedContext);
EGLDisplay display_;
};
GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group)
: GLContextReal(share_group) {}
: GLContextReal(share_group), display_(NULL) {}
bool GLNonOwnedContext::Initialize(GLSurface* compatible_surface,
GpuPreference gpu_preference) {
display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
return true;
}
bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) {
SetCurrent(surface);
......@@ -54,7 +61,11 @@ bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) {
}
std::string GLNonOwnedContext::GetExtensions() {
return GLContext::GetExtensions();
const char* extensions = eglQueryString(display_, EGL_EXTENSIONS);
if (!extensions)
return GLContext::GetExtensions();
return GLContext::GetExtensions() + " " + extensions;
}
} // anonymous namespace
......
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