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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 gles2->TexImage2D(GL_TEXTURE_2D, | 527 gles2->TexImage2D(GL_TEXTURE_2D, |
528 0, | 528 0, |
529 GL_RGBA, | 529 GL_RGBA, |
530 texture_size_.width(), | 530 texture_size_.width(), |
531 texture_size_.height(), | 531 texture_size_.height(), |
532 0, | 532 0, |
533 GL_RGBA, | 533 GL_RGBA, |
534 GL_UNSIGNED_BYTE, | 534 GL_UNSIGNED_BYTE, |
535 &frame->argb_pixels.front()); | 535 &frame->argb_pixels.front()); |
536 | 536 |
537 host_->PictureReady(media::Picture(texture_id, frame->decode_id, | 537 host_->PictureReady( |
538 frame->visible_rect, false)); | 538 media::Picture(texture_id, frame->decode_id, frame->visible_rect)); |
539 pending_frames_.pop(); | 539 pending_frames_.pop(); |
540 } | 540 } |
541 | 541 |
542 FlushCommandBuffer(); | 542 FlushCommandBuffer(); |
543 | 543 |
544 if (pending_frames_.empty()) { | 544 if (pending_frames_.empty()) { |
545 // If frames aren't backing up, notify the host of any completed decodes so | 545 // If frames aren't backing up, notify the host of any completed decodes so |
546 // it can send more buffers. | 546 // it can send more buffers. |
547 NotifyCompletedDecodes(); | 547 NotifyCompletedDecodes(); |
548 | 548 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 588 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
589 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 589 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
590 gles2->DeleteTextures(1, &texture_id); | 590 gles2->DeleteTextures(1, &texture_id); |
591 } | 591 } |
592 | 592 |
593 void VideoDecoderShim::FlushCommandBuffer() { | 593 void VideoDecoderShim::FlushCommandBuffer() { |
594 context_provider_->ContextGL()->Flush(); | 594 context_provider_->ContextGL()->Flush(); |
595 } | 595 } |
596 | 596 |
597 } // namespace content | 597 } // namespace content |
OLD | NEW |