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