diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-22 21:49:22 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-22 21:49:22 +0000 |
commit | cdb467cb842b9e3f66fc42e3b9c09b13f1cbf7db (patch) | |
tree | e7264034a3fcc639dc3fa3d110b51e337aed63db /gpu | |
parent | 92c8c3b5089c5c6abb4def474ade7681e2bf0266 (diff) | |
download | chromium_src-cdb467cb842b9e3f66fc42e3b9c09b13f1cbf7db.zip chromium_src-cdb467cb842b9e3f66fc42e3b9c09b13f1cbf7db.tar.gz chromium_src-cdb467cb842b9e3f66fc42e3b9c09b13f1cbf7db.tar.bz2 |
Work around NVIDIA driver bug on Mac OS X 10.6 causing GPU process
crashes during resizing. Explicitly delete and re-create the FBO
associated with the "saved texture", to give the driver a hint that
drawing commands targeting the old texture must be flushed.
BUG=89557
TEST=none (manually resized window with test case from bug; no crashes)
Review URL: http://codereview.chromium.org/7685024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 5e500bb..5ea25fc 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -15,6 +15,9 @@ #include "base/atomicops.h" #include "base/at_exit.h" #include "base/callback.h" +#if defined(OS_MACOSX) +#include "base/mac/mac_util.h" +#endif #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" @@ -1319,6 +1322,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, bool has_arb_robustness_; GLenum reset_status_; + bool needs_mac_nvidia_driver_workaround_; + DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl); }; @@ -1680,7 +1685,8 @@ GLES2DecoderImpl::GLES2DecoderImpl(SurfaceManager* surface_manager, tex_image_2d_failed_(false), frame_number_(0), has_arb_robustness_(false), - reset_status_(GL_NO_ERROR) { + reset_status_(GL_NO_ERROR), + needs_mac_nvidia_driver_workaround_(false) { DCHECK(group); attrib_0_value_.v[0] = 0.0f; @@ -1934,6 +1940,13 @@ bool GLES2DecoderImpl::Initialize( has_arb_robustness_ = context->HasExtension("GL_ARB_robustness"); +#if defined(OS_MACOSX) + const char* vendor_str = reinterpret_cast<const char*>( + glGetString(GL_VENDOR)); + needs_mac_nvidia_driver_workaround_ = + strstr(vendor_str, "NVIDIA") && base::mac::IsOSSnowLeopardOrEarlier(); +#endif + if (!InitializeShaderTranslator()) { return false; } @@ -2516,6 +2529,10 @@ bool GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) { RestoreClearState(); } + // Workaround for driver bug on OS X 10.6.x and earlier; crbug.com/89557 + if (needs_mac_nvidia_driver_workaround_) + offscreen_saved_frame_buffer_->Create(); + // Allocate the offscreen saved color texture. DCHECK(offscreen_saved_color_format_); offscreen_saved_color_texture_->AllocateStorage( |