| Index: content/common/gpu/image_transport_surface_calayer_mac.mm
|
| diff --git a/content/common/gpu/image_transport_surface_calayer_mac.mm b/content/common/gpu/image_transport_surface_calayer_mac.mm
|
| index bd89912ed3bd39ccf60d8436bc1c86efc7d0f8f3..412dc4f39e2532adaa0b1adccdf0a24969b22c2d 100644
|
| --- a/content/common/gpu/image_transport_surface_calayer_mac.mm
|
| +++ b/content/common/gpu/image_transport_surface_calayer_mac.mm
|
| @@ -55,7 +55,7 @@ const size_t kFramesToKeepCAContextAfterDiscard = 2;
|
| CGLError error = CGLCreateContext(
|
| pixelFormat, storageProvider_->LayerShareGroupContext(), &context);
|
| if (error != kCGLNoError)
|
| - DLOG(ERROR) << "CGLCreateContext failed with CGL error: " << error;
|
| + LOG(ERROR) << "CGLCreateContext failed with CGL error: " << error;
|
| return context;
|
| }
|
|
|
| @@ -121,8 +121,8 @@ bool CALayerStorageProvider::AllocateColorBufferStorage(
|
| // Allocate an ordinary OpenGL texture to back the FBO.
|
| GLenum error;
|
| while ((error = glGetError()) != GL_NO_ERROR) {
|
| - DLOG(ERROR) << "Error found (and ignored) before allocating buffer "
|
| - << "storage: " << error;
|
| + LOG(ERROR) << "OpenGL error hit but ignored before allocating buffer "
|
| + << "storage: " << error;
|
| }
|
| glTexImage2D(GL_TEXTURE_RECTANGLE_ARB,
|
| 0,
|
| @@ -133,13 +133,17 @@ bool CALayerStorageProvider::AllocateColorBufferStorage(
|
| GL_RGBA,
|
| GL_UNSIGNED_BYTE,
|
| NULL);
|
| - error = glGetError();
|
| - if (error != GL_NO_ERROR) {
|
| - DLOG(ERROR) << "glTexImage failed with GL error: " << error;
|
| - return false;
|
| - }
|
| glFlush();
|
|
|
| + bool hit_error = false;
|
| + while ((error = glGetError()) != GL_NO_ERROR) {
|
| + LOG(ERROR) << "OpenGL error hit while trying to allocate buffer storage: "
|
| + << error;
|
| + hit_error = true;
|
| + }
|
| + if (hit_error)
|
| + return false;
|
| +
|
| // Set the parameters that will be used to allocate the CALayer to draw the
|
| // texture into.
|
| share_group_context_.reset(CGLRetainContext(context));
|
| @@ -343,6 +347,11 @@ void CALayerStorageProvider::LayerDoDraw() {
|
| transport_surface_->SetRendererID(current_renderer_id);
|
| }
|
|
|
| + GLenum error;
|
| + while ((error = glGetError()) != GL_NO_ERROR) {
|
| + LOG(ERROR) << "OpenGL error hit while drawing frame: " << error;
|
| + }
|
| +
|
| // Allow forward progress in the context now that the swap is complete.
|
| UnblockBrowserIfNeeded();
|
| }
|
|
|