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

Side by Side Diff: media/gpu/ipc/service/gpu_video_decode_accelerator.cc

Issue 2490183003: Always clear textures in GVDA::SetTextureCleared(). Don't check. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h" 5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 DCHECK(child_task_runner_->BelongsToCurrentThread()); 518 DCHECK(child_task_runner_->BelongsToCurrentThread());
519 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); 519 DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
520 auto it = uncleared_textures_.find(picture.picture_buffer_id()); 520 auto it = uncleared_textures_.find(picture.picture_buffer_id());
521 if (it == uncleared_textures_.end()) 521 if (it == uncleared_textures_.end())
522 return; // the texture has been cleared 522 return; // the texture has been cleared
523 523
524 for (auto texture_ref : it->second) { 524 for (auto texture_ref : it->second) {
525 GLenum target = texture_ref->texture()->target(); 525 GLenum target = texture_ref->texture()->target();
526 gpu::gles2::TextureManager* texture_manager = 526 gpu::gles2::TextureManager* texture_manager =
527 stub_->decoder()->GetContextGroup()->texture_manager(); 527 stub_->decoder()->GetContextGroup()->texture_manager();
528 528 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
529 // External textures are a special case and expected to already be cleared.
530 if (target == GL_TEXTURE_EXTERNAL_OES) {
531 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0));
532 } else {
533 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
534 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
535 }
536 } 529 }
537 uncleared_textures_.erase(it); 530 uncleared_textures_.erase(it);
538 } 531 }
539 532
540 } // namespace media 533 } // namespace media
OLDNEW
« 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