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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 10822029: Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed GL interface mock. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index ec799ea81e924e695fedd504d177641fc2cc0d20..a8dbd82ee00edbaa7dedb8fc8cff3df23748c40b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1543,6 +1543,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
int frame_number_;
bool has_arb_robustness_;
+ bool has_ext_robustness_;
GLenum reset_status_;
bool needs_mac_nvidia_driver_workaround_;
@@ -1964,6 +1965,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
tex_image_2d_failed_(false),
frame_number_(0),
has_arb_robustness_(false),
+ has_ext_robustness_(false),
reset_status_(GL_NO_ERROR),
needs_mac_nvidia_driver_workaround_(false),
needs_glsl_built_in_function_emulation_(false),
@@ -2251,6 +2253,7 @@ bool GLES2DecoderImpl::Initialize(
}
has_arb_robustness_ = context->HasExtension("GL_ARB_robustness");
+ has_ext_robustness_ = context->HasExtension("GL_EXT_robustness");
if (!feature_info_->feature_flags().disable_workarounds) {
#if defined(OS_MACOSX)
@@ -8532,13 +8535,20 @@ error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() {
}
bool GLES2DecoderImpl::WasContextLost() {
- if (context_->WasAllocatedUsingARBRobustness() && has_arb_robustness_) {
- GLenum status = glGetGraphicsResetStatusARB();
+ if (context_->WasAllocatedUsingRobustnessExtension()) {
+ GLenum status = GL_NO_ERROR;
+ if (has_arb_robustness_) {
+ status = glGetGraphicsResetStatusARB();
apatrick_chromium 2012/07/26 22:12:38 You could make ARB alias to EXT in generate_bindin
+ } else if (has_ext_robustness_) {
+ status = glGetGraphicsResetStatusEXT();
+ }
if (status != GL_NO_ERROR) {
// The graphics card was reset. Signal a lost context to the application.
reset_status_ = status;
LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen")
- << " context lost via ARB_robustness. Reset status = 0x"
+ << " context lost via "
+ << (has_arb_robustness_ ? "ARB_" : "EXT_")
+ << "robustness. Reset status = 0x"
<< std::hex << status << std::dec;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698