summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc12
-rw-r--r--content/common/gpu/image_transport_surface_android.cc9
-rw-r--r--content/gpu/gpu_info_collector_android.cc4
-rw-r--r--gpu/command_buffer/service/feature_info.cc5
-rw-r--r--gpu/command_buffer/service/gpu_driver_bug_workaround_type.h2
-rw-r--r--ui/gl/gl_context_egl.cc36
-rw-r--r--ui/gl/gl_context_egl.h2
-rw-r--r--ui/gl/gl_surface.cc24
-rw-r--r--ui/gl/gl_surface.h11
-rw-r--r--ui/gl/gl_surface_egl.cc25
-rw-r--r--ui/gl/gl_surface_egl.h4
11 files changed, 7 insertions, 127 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index beb51a6..ceecbe4 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -507,18 +507,6 @@ void GpuCommandBufferStub::OnInitialize(
return;
}
- // TODO(epenner): If we can initialize the feature-info earlier,
- // this code can be removed and done only during surface creation.
- // This code is only needed for the very first surface, which is
- // created before the ContextGroup is initialized.
- if (context_group_->feature_info()->workarounds()
- .makecurrent_recreates_surfaces) {
- // This only works with virtual contexts!
- DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableVirtualGLContexts));
- surface_->SetRecreateOnMakeCurrent(true);
- }
-
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUServiceLogging)) {
decoder_->set_log_commands(true);
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc
index e1b5018..2d8ee43 100644
--- a/content/common/gpu/image_transport_surface_android.cc
+++ b/content/common/gpu/image_transport_surface_android.cc
@@ -29,15 +29,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
if (!initialize_success)
return scoped_refptr<gfx::GLSurface>();
- if (stub->decoder()
- ->GetContextGroup()
- ->feature_info()
- ->workarounds()
- .makecurrent_recreates_surfaces) {
- static_cast<gfx::NativeViewGLSurfaceEGL*>
- (surface.get())->SetRecreateOnMakeCurrent(true);
- }
-
return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface(
manager, stub, surface.get(), false));
}
diff --git a/content/gpu/gpu_info_collector_android.cc b/content/gpu/gpu_info_collector_android.cc
index 902bc8c..3197414 100644
--- a/content/gpu/gpu_info_collector_android.cc
+++ b/content/gpu/gpu_info_collector_android.cc
@@ -74,7 +74,6 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) {
bool is_arm = vendor.find("arm") != std::string::npos;
bool is_qualcomm = vendor.find("qualcomm") != std::string::npos;
bool is_mali_t604 = is_arm && renderer.find("mali-t604") != std::string::npos;
- bool is_hisilicon = vendor.find("hisilicon") != std::string::npos;
base::android::BuildInfo* build_info =
base::android::BuildInfo::GetInstance();
@@ -92,8 +91,7 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) {
// IMG: avoid context switching perf problems, crashes with share groups
// Mali-T604: http://crbug.com/154715
// QualComm, NVIDIA: Crashes with share groups
- if (is_hisilicon || is_img || is_mali_t604 || is_nexus7
- || (is_qualcomm && sdk_int != 16)) {
+ if (is_img || is_mali_t604 || is_nexus7 || (is_qualcomm && sdk_int != 16)) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableVirtualGLContexts);
}
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index aad133e..d9df6f6 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -191,7 +191,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
bool is_qualcomm = false;
bool is_imagination = false;
bool is_arm = false;
- bool is_hisilicon = false;
const char* gl_strings[2];
gl_strings[0] = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
gl_strings[1] = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
@@ -209,7 +208,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
is_qualcomm |= string_set.Contains("qualcomm");
is_imagination |= string_set.Contains("imagination");
is_arm |= string_set.Contains("arm");
- is_hisilicon |= string_set.Contains("hisilicon");
}
}
@@ -223,9 +221,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
workarounds_.flush_on_context_switch = true;
workarounds_.delete_instead_of_resize_fbo = true;
}
- if (is_hisilicon) {
- workarounds_.makecurrent_recreates_surfaces = true;
- }
#if defined(OS_MACOSX)
workarounds_.needs_offscreen_buffer_workaround = is_nvidia;
workarounds_.needs_glsl_built_in_function_emulation = is_amd;
diff --git a/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h b/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
index fa71504..0478b28 100644
--- a/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
+++ b/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
@@ -28,8 +28,6 @@
exit_on_context_lost) \
GPU_OP(FLUSH_ON_CONTEXT_SWITCH, \
flush_on_context_switch) \
- GPU_OP(MAKECURRENT_RECREATES_SURFACES, \
- makecurrent_recreates_surfaces) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024, \
max_cube_map_texture_size_limit_1024) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096, \
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_;