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

Side by Side Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 937413002: Fix VideoDecoderShim to dimiss textures after the stream is resized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/pepper/video_decoder_shim.h" 5 #include "content/renderer/pepper/video_decoder_shim.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 10
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 DCHECK(host_); 476 DCHECK(host_);
477 477
478 if (!frame->argb_pixels.empty()) { 478 if (!frame->argb_pixels.empty()) {
479 if (texture_size_ != frame->coded_size) { 479 if (texture_size_ != frame->coded_size) {
480 // If the size has changed, all current textures must be dismissed. Add 480 // If the size has changed, all current textures must be dismissed. Add
481 // all textures to |textures_to_dismiss_| and dismiss any that aren't in 481 // all textures to |textures_to_dismiss_| and dismiss any that aren't in
482 // use by the plugin. We will dismiss the rest as they are recycled. 482 // use by the plugin. We will dismiss the rest as they are recycled.
483 for (TextureIdMap::const_iterator it = texture_id_map_.begin(); 483 for (TextureIdMap::const_iterator it = texture_id_map_.begin();
484 it != texture_id_map_.end(); 484 it != texture_id_map_.end();
485 ++it) { 485 ++it) {
486 textures_to_dismiss_.insert(it->second); 486 textures_to_dismiss_.insert(it->first);
487 } 487 }
488 for (TextureIdSet::const_iterator it = available_textures_.begin(); 488 for (TextureIdSet::const_iterator it = available_textures_.begin();
489 it != available_textures_.end(); 489 it != available_textures_.end();
490 ++it) { 490 ++it) {
491 DismissTexture(*it); 491 DismissTexture(*it);
492 } 492 }
493 available_textures_.clear(); 493 available_textures_.clear();
494 FlushCommandBuffer(); 494 FlushCommandBuffer();
495 495
496 DCHECK(pending_texture_mailboxes_.empty()); 496 DCHECK(pending_texture_mailboxes_.empty());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { 593 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) {
594 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 594 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
595 gles2->DeleteTextures(1, &texture_id); 595 gles2->DeleteTextures(1, &texture_id);
596 } 596 }
597 597
598 void VideoDecoderShim::FlushCommandBuffer() { 598 void VideoDecoderShim::FlushCommandBuffer() {
599 context_provider_->ContextGL()->Flush(); 599 context_provider_->ContextGL()->Flush();
600 } 600 }
601 601
602 } // namespace content 602 } // namespace content
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