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

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

Issue 2481943003: Enforce no uncleared OES external textures. Clear in AVDA, not GVD. (Closed)
Patch Set: Fix mismerge. 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 | « media/gpu/avda_picture_buffer_manager.cc ('k') | 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 DCHECK(child_task_runner_->BelongsToCurrentThread()); 512 DCHECK(child_task_runner_->BelongsToCurrentThread());
513 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); 513 DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
514 auto it = uncleared_textures_.find(picture.picture_buffer_id()); 514 auto it = uncleared_textures_.find(picture.picture_buffer_id());
515 if (it == uncleared_textures_.end()) 515 if (it == uncleared_textures_.end())
516 return; // the texture has been cleared 516 return; // the texture has been cleared
517 517
518 for (auto texture_ref : it->second) { 518 for (auto texture_ref : it->second) {
519 GLenum target = texture_ref->texture()->target(); 519 GLenum target = texture_ref->texture()->target();
520 gpu::gles2::TextureManager* texture_manager = 520 gpu::gles2::TextureManager* texture_manager =
521 stub_->decoder()->GetContextGroup()->texture_manager(); 521 stub_->decoder()->GetContextGroup()->texture_manager();
522 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 522
523 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 523 // External textures are a special case and expected to already be cleared.
524 if (target == GL_TEXTURE_EXTERNAL_OES) {
525 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0));
526 } else {
527 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
528 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
529 }
524 } 530 }
525 uncleared_textures_.erase(it); 531 uncleared_textures_.erase(it);
526 } 532 }
527 533
528 } // namespace media 534 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/avda_picture_buffer_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698