diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 22:26:48 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 22:26:48 +0000 |
commit | ce383f32a1bfbe4ca33b88a0cbbb79c7f077428d (patch) | |
tree | ff8effb0f58e6f1b0395a0c98f7e385e43cc1f23 /gpu/command_buffer/service | |
parent | e667807890b931d41a4529165bedef5203382bbd (diff) | |
download | chromium_src-ce383f32a1bfbe4ca33b88a0cbbb79c7f077428d.zip chromium_src-ce383f32a1bfbe4ca33b88a0cbbb79c7f077428d.tar.gz chromium_src-ce383f32a1bfbe4ca33b88a0cbbb79c7f077428d.tar.bz2 |
Revert 67293 BrowserTestCanLaunchWithOSMesa was consistently failing - Initialize destinations variables before calling GL functions
because if the context is lost those variables will
be uninitialized.
TEST=ran chrome, conformance tests, unit tests and hand edited gles2_demo to test
BUG=none
Review URL: http://codereview.chromium.org/5305005
TBR=gman@chromium.org
Review URL: http://codereview.chromium.org/5383001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service')
-rw-r--r-- | gpu/command_buffer/service/common_decoder.cc | 11 | ||||
-rw-r--r-- | gpu/command_buffer/service/common_decoder.h | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 10 |
3 files changed, 9 insertions, 14 deletions
diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc index a116d04..ce45422 100644 --- a/gpu/command_buffer/service/common_decoder.cc +++ b/gpu/command_buffer/service/common_decoder.cc @@ -35,16 +35,11 @@ bool CommonDecoder::Bucket::SetData( return false; } -void CommonDecoder::Bucket::SetFromString(const char* str) { +void CommonDecoder::Bucket::SetFromString(const std::string& str) { // Strings are passed NULL terminated to distinguish between empty string // and no string. - if (!str) { - SetSize(0); - } else { - size_t size = strlen(str) + 1; - SetSize(size); - SetData(str, 0, size); - } + SetSize(str.size() + 1); + SetData(str.c_str(), 0, str.size() + 1); } bool CommonDecoder::Bucket::GetAsString(std::string* str) { diff --git a/gpu/command_buffer/service/common_decoder.h b/gpu/command_buffer/service/common_decoder.h index ea4e520..7abc016 100644 --- a/gpu/command_buffer/service/common_decoder.h +++ b/gpu/command_buffer/service/common_decoder.h @@ -73,7 +73,7 @@ class CommonDecoder : public AsyncAPIInterface { // Sets the bucket data from a string. Strings are passed NULL terminated to // distinguish between empty string and no string. - void SetFromString(const char* str); + void SetFromString(const std::string& str); // Gets the bucket data as a string. Strings are passed NULL terminated to // distrinquish between empty string and no string. Returns False if there diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 17d1f09..fbb6ca4 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -4313,7 +4313,7 @@ error::Error GLES2DecoderImpl::HandleGetShaderSource( bucket->SetSize(0); return error::kNoError; } - bucket->SetFromString(info->source().c_str()); + bucket->SetFromString(info->source()); return error::kNoError; } @@ -4327,7 +4327,7 @@ error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( if (!info) { return error::kNoError; } - bucket->SetFromString(info->log_info().c_str()); + bucket->SetFromString(info->log_info()); return error::kNoError; } @@ -4342,7 +4342,7 @@ error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( bucket->SetSize(0); return error::kNoError; } - bucket->SetFromString(info->log_info().c_str()); + bucket->SetFromString(info->log_info()); return error::kNoError; } @@ -5739,7 +5739,7 @@ error::Error GLES2DecoderImpl::HandleGetActiveUniform( result->size = uniform_info->size; result->type = uniform_info->type; Bucket* bucket = CreateBucket(name_bucket_id); - bucket->SetFromString(uniform_info->name.c_str()); + bucket->SetFromString(uniform_info->name); return error::kNoError; } @@ -5773,7 +5773,7 @@ error::Error GLES2DecoderImpl::HandleGetActiveAttrib( result->size = attrib_info->size; result->type = attrib_info->type; Bucket* bucket = CreateBucket(name_bucket_id); - bucket->SetFromString(attrib_info->name.c_str()); + bucket->SetFromString(attrib_info->name); return error::kNoError; } |