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

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

Issue 1159293002: Avoid unncessary EGLImageTargetTexture calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_definition.cc
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index 7b38f86f3000ea82e1f31be294a84ac4f8bc9109..0c50a2217621bdd39ce5c48e8dbf249234688615 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -405,8 +405,14 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t_);
- if (image_buffer_.get())
- image_buffer_->BindToTexture(target_);
+
+ if (image_buffer_.get()) {
+ gfx::GLImage* existing_image = texture->GetLevelImage(target_, 0);
+ // Don't need to re-bind if already bound before.
+ if (!existing_image || !image_buffer_->IsClient(existing_image)) {
+ image_buffer_->BindToTexture(target_);
+ }
+ }
if (defined_) {
texture->face_infos_.resize(1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698