| 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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
| 6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
| 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
| 8 // Win/EGL. | 8 // Win/EGL. |
| 9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
| 10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const { | 365 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const { |
| 366 gfx::GpuMemoryBufferHandle handle; | 366 gfx::GpuMemoryBufferHandle handle; |
| 367 #if defined(USE_OZONE) | 367 #if defined(USE_OZONE) |
| 368 CHECK(pixmap_); | 368 CHECK(pixmap_); |
| 369 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0))); | 369 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0))); |
| 370 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; | 370 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; |
| 371 handle.type = gfx::OZONE_NATIVE_PIXMAP; | 371 handle.type = gfx::OZONE_NATIVE_PIXMAP; |
| 372 handle.native_pixmap_handle.fds.emplace_back( | 372 handle.native_pixmap_handle.fds.emplace_back( |
| 373 base::FileDescriptor(duped_fd, true)); | 373 base::FileDescriptor(duped_fd, true)); |
| 374 handle.native_pixmap_handle.strides_and_offsets.emplace_back( | 374 handle.native_pixmap_handle.planes.emplace_back( |
| 375 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0)); | 375 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0), |
| 376 pixmap_->GetDmaBufModifier(0)); |
| 376 #endif | 377 #endif |
| 377 return handle; | 378 return handle; |
| 378 } | 379 } |
| 379 | 380 |
| 380 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by | 381 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by |
| 381 // the TESTs below. | 382 // the TESTs below. |
| 382 class GLRenderingVDAClient | 383 class GLRenderingVDAClient |
| 383 : public VideoDecodeAccelerator::Client, | 384 : public VideoDecodeAccelerator::Client, |
| 384 public base::SupportsWeakPtr<GLRenderingVDAClient> { | 385 public base::SupportsWeakPtr<GLRenderingVDAClient> { |
| 385 public: | 386 public: |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 media::VaapiWrapper::PreSandboxInitialization(); | 1784 media::VaapiWrapper::PreSandboxInitialization(); |
| 1784 #endif | 1785 #endif |
| 1785 | 1786 |
| 1786 media::g_env = | 1787 media::g_env = |
| 1787 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1788 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
| 1788 testing::AddGlobalTestEnvironment( | 1789 testing::AddGlobalTestEnvironment( |
| 1789 new media::VideoDecodeAcceleratorTestEnvironment())); | 1790 new media::VideoDecodeAcceleratorTestEnvironment())); |
| 1790 | 1791 |
| 1791 return RUN_ALL_TESTS(); | 1792 return RUN_ALL_TESTS(); |
| 1792 } | 1793 } |
| OLD | NEW |