diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 20:57:09 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 20:57:09 +0000 |
commit | 3480a07b35ce4b407a8924aad62dead625ffb725 (patch) | |
tree | a1d7e62b752fa07cf0db624ccb9c323b0e49040f /ui/gl | |
parent | 3da7ac8f632fba6459fa3d19da0767788125942e (diff) | |
download | chromium_src-3480a07b35ce4b407a8924aad62dead625ffb725.zip chromium_src-3480a07b35ce4b407a8924aad62dead625ffb725.tar.gz chromium_src-3480a07b35ce4b407a8924aad62dead625ffb725.tar.bz2 |
Revert "gpu: Fix Vivante's "hisilicon" GPUs"
Revert "gpu: Fix uninitialized variable."
Reverting these two CLs so they can be landed behind
#ifdef's (for merge safety).
BUG=179250
NOTRY=true
No try since this is just a revert.
Review URL: https://chromiumcodereview.appspot.com/14241009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r-- | ui/gl/gl_context_egl.cc | 36 | ||||
-rw-r--r-- | ui/gl/gl_context_egl.h | 2 | ||||
-rw-r--r-- | ui/gl/gl_surface.cc | 24 | ||||
-rw-r--r-- | ui/gl/gl_surface.h | 11 | ||||
-rw-r--r-- | ui/gl/gl_surface_egl.cc | 25 | ||||
-rw-r--r-- | ui/gl/gl_surface_egl.h | 4 |
6 files changed, 6 insertions, 96 deletions
diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc index c29eb2a..52c60e2 100644 --- a/ui/gl/gl_context_egl.cc +++ b/ui/gl/gl_context_egl.cc @@ -112,9 +112,6 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) { return false; } - if (!RecreateSurfaceIfNeeded(surface)) - return false; - if (!surface->OnMakeCurrent(this)) { LOG(ERROR) << "Could not make current."; return false; @@ -124,39 +121,6 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) { return true; } -bool GLContextEGL::RecreateSurfaceIfNeeded(GLSurface* surface) { - if (!surface || !surface->RecreateOnMakeCurrent()) - return true; - - // This is specifically needed for Vivante GPU's on Android. - // A native view surface will not be configured correctly - // unless we do all of the following steps after making the - // surface current. - GLint fbo = 0; - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbo); - glBindFramebufferEXT(GL_FRAMEBUFFER, 0); - - eglMakeCurrent(display_, - EGL_NO_SURFACE, - EGL_NO_SURFACE, - EGL_NO_CONTEXT); - if (!surface->Recreate()) { - LOG(ERROR) << "Failed to recreate surface"; - return false; - } - if (!eglMakeCurrent(display_, - surface->GetHandle(), - surface->GetHandle(), - context_)) { - LOG(ERROR) << "eglMakeCurrent failed with error " - << GetLastEGLErrorString(); - return false; - } - - glBindFramebufferEXT(GL_FRAMEBUFFER, fbo); - return true; -} - void GLContextEGL::ReleaseCurrent(GLSurface* surface) { if (!IsCurrent(surface)) return; diff --git a/ui/gl/gl_context_egl.h b/ui/gl/gl_context_egl.h index ea61976..e45cc25 100644 --- a/ui/gl/gl_context_egl.h +++ b/ui/gl/gl_context_egl.h @@ -36,8 +36,6 @@ class GLContextEGL : public GLContext { virtual bool WasAllocatedUsingRobustnessExtension() OVERRIDE; virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE; - bool RecreateSurfaceIfNeeded(GLSurface* surface); - protected: virtual ~GLContextEGL(); diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index fc271a2..0feeb34 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc @@ -84,11 +84,6 @@ bool GLSurface::Resize(const gfx::Size& size) { return false; } -bool GLSurface::Recreate() { - NOTIMPLEMENTED(); - return false; -} - bool GLSurface::DeferDraws() { return false; } @@ -150,13 +145,6 @@ VSyncProvider* GLSurface::GetVSyncProvider() { return NULL; } -bool GLSurface::RecreateOnMakeCurrent() { - return false; -} - -void GLSurface::SetRecreateOnMakeCurrent(bool recreate) { -} - GLSurface* GLSurface::GetCurrent() { return current_surface_.Pointer()->Get(); } @@ -197,10 +185,6 @@ bool GLSurfaceAdapter::Resize(const gfx::Size& size) { return surface_->Resize(size); } -bool GLSurfaceAdapter::Recreate() { - return surface_->Recreate(); -} - bool GLSurfaceAdapter::DeferDraws() { return surface_->DeferDraws(); } @@ -265,14 +249,6 @@ VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { return surface_->GetVSyncProvider(); } -bool GLSurfaceAdapter::RecreateOnMakeCurrent() { - return surface_->RecreateOnMakeCurrent(); -} - -void GLSurfaceAdapter::SetRecreateOnMakeCurrent(bool recreate) { - surface_->SetRecreateOnMakeCurrent(recreate); -} - GLSurfaceAdapter::~GLSurfaceAdapter() {} } // namespace gfx diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h index ac2be89..6924685 100644 --- a/ui/gl/gl_surface.h +++ b/ui/gl/gl_surface.h @@ -39,9 +39,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { virtual bool Resize(const gfx::Size& size); - // Recreate the surface without changing the size. - virtual bool Recreate(); - // Unschedule the GpuScheduler and return true to abort the processing of // a GL draw call to this surface and defer it until the GpuScheduler is // rescheduled. @@ -105,11 +102,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { // of screen refresh. If unavailable, returns NULL. virtual VSyncProvider* GetVSyncProvider(); - // Certain surfaces need to be destroyed and recreated - // every time they are made the current surface. - virtual bool RecreateOnMakeCurrent(); - virtual void SetRecreateOnMakeCurrent(bool recreate); - // Create a GL surface that renders directly to a view. static scoped_refptr<GLSurface> CreateViewGLSurface( bool software, @@ -145,7 +137,6 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface { virtual bool Initialize() OVERRIDE; virtual void Destroy() OVERRIDE; virtual bool Resize(const gfx::Size& size) OVERRIDE; - virtual bool Recreate() OVERRIDE; virtual bool DeferDraws() OVERRIDE; virtual bool IsOffscreen() OVERRIDE; virtual bool SwapBuffers() OVERRIDE; @@ -162,8 +153,6 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface { virtual void* GetConfig() OVERRIDE; virtual unsigned GetFormat() OVERRIDE; virtual VSyncProvider* GetVSyncProvider() OVERRIDE; - virtual bool RecreateOnMakeCurrent() OVERRIDE; - virtual void SetRecreateOnMakeCurrent(bool recreate) OVERRIDE; GLSurface* surface() const { return surface_.get(); } diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 98ed4fa..3b81daf 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc @@ -221,8 +221,7 @@ NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software, : window_(window), surface_(NULL), supports_post_sub_buffer_(false), - config_(NULL), - recreate_on_make_current_(false) { + config_(NULL) { software_ = software; #if defined(OS_ANDROID) if (window) @@ -400,28 +399,16 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) { if (was_current) current_context->ReleaseCurrent(this); - Recreate(); - - if (was_current) - return current_context->MakeCurrent(this); - return true; -} - -bool NativeViewGLSurfaceEGL::Recreate() { Destroy(); + if (!Initialize()) { - LOG(ERROR) << "Failed to create surface."; + LOG(ERROR) << "Failed to resize pbuffer."; return false; } - return true; -} - -bool NativeViewGLSurfaceEGL::RecreateOnMakeCurrent() { - return recreate_on_make_current_; -} -void NativeViewGLSurfaceEGL::SetRecreateOnMakeCurrent(bool recreate) { - recreate_on_make_current_ = recreate; + if (was_current) + return current_context->MakeCurrent(this); + return true; } EGLSurface NativeViewGLSurfaceEGL::GetHandle() { diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h index c54fbc0..17e6e94 100644 --- a/ui/gl/gl_surface_egl.h +++ b/ui/gl/gl_surface_egl.h @@ -60,7 +60,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { virtual bool Initialize() OVERRIDE; virtual void Destroy() OVERRIDE; virtual bool Resize(const gfx::Size& size) OVERRIDE; - virtual bool Recreate() OVERRIDE; virtual bool IsOffscreen() OVERRIDE; virtual bool SwapBuffers() OVERRIDE; virtual gfx::Size GetSize() OVERRIDE; @@ -68,8 +67,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { virtual std::string GetExtensions() OVERRIDE; virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; virtual VSyncProvider* GetVSyncProvider() OVERRIDE; - virtual bool RecreateOnMakeCurrent() OVERRIDE; - virtual void SetRecreateOnMakeCurrent(bool recreate) OVERRIDE; protected: virtual ~NativeViewGLSurfaceEGL(); @@ -80,7 +77,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { EGLSurface surface_; bool supports_post_sub_buffer_; EGLConfig config_; - bool recreate_on_make_current_; scoped_ptr<VSyncProvider> vsync_provider_; |