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

Side by Side Diff: media/video/gpu_memory_buffer_video_frame_pool.cc

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/video/gpu_memory_buffer_video_frame_pool.h" 5 #include "media/video/gpu_memory_buffer_video_frame_pool.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 <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 coded_size.width()); 626 coded_size.width());
627 const size_t height = 627 const size_t height =
628 VideoFrame::Rows(i, VideoFormat(output_format_), coded_size.height()); 628 VideoFrame::Rows(i, VideoFormat(output_format_), coded_size.height());
629 plane_resource.image_id = gles2->CreateImageCHROMIUM( 629 plane_resource.image_id = gles2->CreateImageCHROMIUM(
630 plane_resource.gpu_memory_buffer->AsClientBuffer(), width, height, 630 plane_resource.gpu_memory_buffer->AsClientBuffer(), width, height,
631 ImageInternalFormat(output_format_, i)); 631 ImageInternalFormat(output_format_, i));
632 } else if (plane_resource.image_id) { 632 } else if (plane_resource.image_id) {
633 gles2->ReleaseTexImage2DCHROMIUM(texture_target, plane_resource.image_id); 633 gles2->ReleaseTexImage2DCHROMIUM(texture_target, plane_resource.image_id);
634 } 634 }
635 if (plane_resource.image_id) 635 if (plane_resource.image_id)
636 gles2->BindTexImage2DCHROMIUM(texture_target, plane_resource.image_id); 636 gles2->BindTexImage2DCHROMIUM(texture_target, plane_resource.image_id, 0);
637 mailbox_holders[i] = gpu::MailboxHolder(plane_resource.mailbox, 637 mailbox_holders[i] = gpu::MailboxHolder(plane_resource.mailbox,
638 gpu::SyncToken(), texture_target); 638 gpu::SyncToken(), texture_target);
639 } 639 }
640 640
641 // Insert a sync_token, this is needed to make sure that the textures the 641 // Insert a sync_token, this is needed to make sure that the textures the
642 // mailboxes refer to will be used only after all the previous commands posted 642 // mailboxes refer to will be used only after all the previous commands posted
643 // in the command buffer have been processed. 643 // in the command buffer have been processed.
644 const GLuint64 fence_sync = gles2->InsertFenceSyncCHROMIUM(); 644 const GLuint64 fence_sync = gles2->InsertFenceSyncCHROMIUM();
645 gles2->OrderingBarrierCHROMIUM(); 645 gles2->OrderingBarrierCHROMIUM();
646 646
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 826 }
827 827
828 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( 828 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame(
829 const scoped_refptr<VideoFrame>& video_frame, 829 const scoped_refptr<VideoFrame>& video_frame,
830 const FrameReadyCB& frame_ready_cb) { 830 const FrameReadyCB& frame_ready_cb) {
831 DCHECK(video_frame); 831 DCHECK(video_frame);
832 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); 832 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb);
833 } 833 }
834 834
835 } // namespace media 835 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/video_overlay_factory.cc ('k') | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698