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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1160863007: DCHECK if shader compilation fails that it's due to context loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: glhelperlost: commentintxt Created 5 years, 6 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 4085 matching lines...) Expand 10 before | Expand all | Expand 10 after
4096 WaitForCmd(); 4096 WaitForCmd();
4097 result->CopyResult(params); 4097 result->CopyResult(params);
4098 GPU_CLIENT_LOG_CODE_BLOCK({ 4098 GPU_CLIENT_LOG_CODE_BLOCK({
4099 for (int32 i = 0; i < result->GetNumResults(); ++i) { 4099 for (int32 i = 0; i < result->GetNumResults(); ++i) {
4100 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]); 4100 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
4101 } 4101 }
4102 }); 4102 });
4103 CheckGLError(); 4103 CheckGLError();
4104 } 4104 }
4105 4105
4106 GLenum GLES2Implementation::GetGraphicsResetStatusKHR() {
4107 GPU_CLIENT_SINGLE_THREAD_CHECK();
4108 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetGraphicsResetStatusKHR()");
4109 // If we can't make command buffers then the context is lost.
4110 if (gpu_control_->IsGpuChannelLost())
4111 return GL_UNKNOWN_CONTEXT_RESET_KHR;
4112 // Otherwise, check the command buffer if it is lost.
4113 if (helper_->IsContextLost()) {
4114 // TODO(danakj): We could GetLastState() off the CommandBuffer and return
4115 // the actual reason here if we cared to.
Ken Russell (switch to Gerrit) 2015/06/08 23:08:22 It's a little unfortunate that this can't return t
danakj 2015/06/08 23:09:37 Ya, that's why I left a todo so someone can track
4116 return GL_UNKNOWN_CONTEXT_RESET_KHR;
4117 }
4118 return GL_NO_ERROR;
4119 }
4120
4106 void GLES2Implementation::Swap() { 4121 void GLES2Implementation::Swap() {
4107 SwapBuffers(); 4122 SwapBuffers();
4108 } 4123 }
4109 4124
4110 void GLES2Implementation::PartialSwapBuffers(const gfx::Rect& sub_buffer) { 4125 void GLES2Implementation::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
4111 PostSubBufferCHROMIUM( 4126 PostSubBufferCHROMIUM(
4112 sub_buffer.x(), sub_buffer.y(), sub_buffer.width(), sub_buffer.height()); 4127 sub_buffer.x(), sub_buffer.y(), sub_buffer.width(), sub_buffer.height());
4113 } 4128 }
4114 4129
4115 static GLenum GetGLESOverlayTransform(gfx::OverlayTransform plane_transform) { 4130 static GLenum GetGLESOverlayTransform(gfx::OverlayTransform plane_transform) {
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
5685 CheckGLError(); 5700 CheckGLError();
5686 } 5701 }
5687 5702
5688 // Include the auto-generated part of this file. We split this because it means 5703 // Include the auto-generated part of this file. We split this because it means
5689 // we can easily edit the non-auto generated parts right here in this file 5704 // we can easily edit the non-auto generated parts right here in this file
5690 // instead of having to edit some template or the code generator. 5705 // instead of having to edit some template or the code generator.
5691 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 5706 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
5692 5707
5693 } // namespace gles2 5708 } // namespace gles2
5694 } // namespace gpu 5709 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_c_lib_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698