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

Unified Diff: ui/gl/gl_context_android.cc

Issue 23460026: [Android WebView] Fix async upload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetDispaly once Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_android.cc
diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc
index d8238db54b6b7e1f7e197779e1cac80401ac2df8..7e750c6cd33e19518ef92e8b56360aa284681554 100644
--- a/ui/gl/gl_context_android.cc
+++ b/ui/gl/gl_context_android.cc
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698