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

Unified Diff: content/common/gpu/image_transport_surface_calayer_mac.mm

Issue 783713002: Log serious OpenGL errors in remote CoreAnimation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: 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();
}
« 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