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

Side by Side Diff: media/renderers/skcanvas_video_renderer_unittest.cc

Issue 1960563002: Add media::VideoFrame::WrapNativeTextures() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « media/filters/gpu_video_decoder.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gpu/GLES2/gl2extchromium.h" 9 #include "gpu/GLES2/gl2extchromium.h"
10 #include "gpu/command_buffer/client/gles2_interface_stub.h" 10 #include "gpu/command_buffer/client/gles2_interface_stub.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 auto gr_context = skia::AdoptRef(GrContext::Create( 524 auto gr_context = skia::AdoptRef(GrContext::Create(
525 kOpenGL_GrBackend, 525 kOpenGL_GrBackend,
526 reinterpret_cast<GrBackendContext>(null_interface.get()))); 526 reinterpret_cast<GrBackendContext>(null_interface.get())));
527 gr_context->abandonContext(); 527 gr_context->abandonContext();
528 528
529 SkCanvas canvas(AllocBitmap(kWidth, kHeight)); 529 SkCanvas canvas(AllocBitmap(kWidth, kHeight));
530 530
531 TestGLES2Interface gles2; 531 TestGLES2Interface gles2;
532 Context3D context_3d(&gles2, gr_context.get()); 532 Context3D context_3d(&gles2, gr_context.get());
533 gfx::Size size(kWidth, kHeight); 533 gfx::Size size(kWidth, kHeight);
534 gpu::MailboxHolder mailbox(gpu::Mailbox::Generate(), gpu::SyncToken(), 534 gpu::MailboxHolder holders[VideoFrame::kMaxPlanes] = {gpu::MailboxHolder(
535 GL_TEXTURE_RECTANGLE_ARB); 535 gpu::Mailbox::Generate(), gpu::SyncToken(), GL_TEXTURE_RECTANGLE_ARB)};
536 auto video_frame = VideoFrame::WrapNativeTexture( 536 auto video_frame = VideoFrame::WrapNativeTextures(
537 PIXEL_FORMAT_UYVY, mailbox, base::Bind(MailboxHoldersReleased), size, 537 PIXEL_FORMAT_UYVY, holders, base::Bind(MailboxHoldersReleased), size,
538 gfx::Rect(size), size, kNoTimestamp()); 538 gfx::Rect(size), size, kNoTimestamp());
539 539
540 renderer_.Paint(video_frame, &canvas, kNaturalRect, 0xFF, 540 renderer_.Paint(video_frame, &canvas, kNaturalRect, 0xFF,
541 SkXfermode::kSrcOver_Mode, VIDEO_ROTATION_90, context_3d); 541 SkXfermode::kSrcOver_Mode, VIDEO_ROTATION_90, context_3d);
542 } 542 }
543 } // namespace media 543 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698