| Index: gpu/command_buffer/client/program_info_manager.cc
|
| diff --git a/gpu/command_buffer/client/program_info_manager.cc b/gpu/command_buffer/client/program_info_manager.cc
|
| index d854aa01f75065353e52a97b1adc91cef2a65e76..7f103416929f4165a2fe9f8160fd47d73b465ec5 100644
|
| --- a/gpu/command_buffer/client/program_info_manager.cc
|
| +++ b/gpu/command_buffer/client/program_info_manager.cc
|
| @@ -195,7 +195,11 @@ class CachedProgramInfoManager : public ProgramInfoManager {
|
| bool GetProgramiv(GLenum pname, GLint* params);
|
|
|
| // Updates the program info after a successful link.
|
| - void Update(GLES2Implementation* gl, GLuint program);
|
| + void Update(GLES2Implementation* gl,
|
| + GLuint program,
|
| + const std::vector<int8>& result);
|
| +
|
| + bool cached() const { return cached_; }
|
|
|
| private:
|
| bool cached_;
|
| @@ -316,12 +320,12 @@ template<typename T> static T LocalGetAs(
|
| }
|
|
|
| void CachedProgramInfoManager::Program::Update(
|
| - GLES2Implementation* gl, GLuint program) {
|
| + GLES2Implementation* gl,
|
| + GLuint program,
|
| + const std::vector<int8>& result) {
|
| if (cached_) {
|
| return;
|
| }
|
| - std::vector<int8> result;
|
| - gl->GetProgramInfoCHROMIUMHelper(program, &result);
|
| if (result.empty()) {
|
| // This should only happen on a lost context.
|
| return;
|
| @@ -389,7 +393,22 @@ CachedProgramInfoManager::Program*
|
| return NULL;
|
| }
|
| Program* info = &it->second;
|
| - info->Update(gl, program);
|
| + if (info->cached())
|
| + return info;
|
| + std::vector<int8> result;
|
| + {
|
| + base::AutoUnlock unlock(lock_);
|
| + // lock_ can't be held across IPC call or else it may deadlock in pepper.
|
| + // http://crbug.com/418651
|
| + gl->GetProgramInfoCHROMIUMHelper(program, &result);
|
| + }
|
| +
|
| + it = program_infos_.find(program);
|
| + if (it == program_infos_.end()) {
|
| + return NULL;
|
| + }
|
| + info = &it->second;
|
| + info->Update(gl, program, result);
|
| return info;
|
| }
|
|
|
|
|