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

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

Issue 2005103004: AVDACodecImages keep their backing SurfaceTexture alive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@neverdetach
Patch Set: Created 4 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
Index: gpu/command_buffer/service/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 61f2acc5d188873b7d6731f18e5e8e2c801f7c1f..040e15f31fd80974e9e5be9ff1e6dc5cb1addd9a 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1487,10 +1487,17 @@ void Texture::SetLevelImageInternal(GLenum target,
face_infos_[face_index].level_infos[level];
DCHECK_EQ(info.target, target);
DCHECK_EQ(info.level, level);
+ bool image_previously_bound = !!info.image;
info.image = image;
info.stream_texture_image = stream_texture_image;
info.image_state = state;
+
+ // Clear the unowned service id because the previous image might own it, in
+ // which case it's no longer valid.
+ if (image_previously_bound && level == 0)
liberato (no reviews please) 2016/05/26 16:59:19 i don't think that one needs to check if an image
+ SetUnownedServiceId(0);
+
UpdateCanRenderCondition();
UpdateHasImages();
UpdateEmulatingRGB();
« no previous file with comments | « no previous file | media/gpu/android_copying_backing_strategy.cc » ('j') | media/gpu/android_video_decode_accelerator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698