OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |