summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/gles2_cmd_decoder.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 21:43:37 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 21:43:37 +0000
commitcf6b8f6638e97929ffb632675a90c50c65446305 (patch)
tree54c1c676efd4c7768c2ecd9e22d8a6590de5582e /gpu/command_buffer/service/gles2_cmd_decoder.cc
parent36d4896f7eda12f16307ac6657f5a682dcae7a4d (diff)
downloadchromium_src-cf6b8f6638e97929ffb632675a90c50c65446305.zip
chromium_src-cf6b8f6638e97929ffb632675a90c50c65446305.tar.gz
chromium_src-cf6b8f6638e97929ffb632675a90c50c65446305.tar.bz2
Defer initializing the CopyTextureCHROMIUMResourceManager
It is takes 10s of milliseconds to initialize. Review URL: https://chromiumcodereview.appspot.com/10450030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/gles2_cmd_decoder.cc')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index d67fe8c..c8cfeff 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2017,10 +2017,6 @@ bool GLES2DecoderImpl::Initialize(
}
CHECK_GL_ERROR();
- copy_texture_CHROMIUM_.reset(new CopyTextureCHROMIUMResourceManager());
- copy_texture_CHROMIUM_->Initialize();
- CHECK_GL_ERROR();
-
disallowed_features_ = disallowed_features;
vertex_attrib_manager_.reset(new VertexAttribManager());
@@ -8506,6 +8502,17 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
return;
}
+ // Defer initializing the CopyTextureCHROMIUMResourceManager until it is
+ // needed because it takes 10s of milliseconds to initialize.
+ if (!copy_texture_CHROMIUM_.get()) {
+ CopyRealGLErrorsToWrapper();
+ copy_texture_CHROMIUM_.reset(new CopyTextureCHROMIUMResourceManager());
+ copy_texture_CHROMIUM_->Initialize();
+ RestoreCurrentFramebufferBindings();
+ if (PeekGLError() != GL_NO_ERROR)
+ return;
+ }
+
GLenum dest_type;
GLenum dest_internal_format;
bool dest_level_defined = dest_info->GetLevelSize(GL_TEXTURE_2D, level,