| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const { | 364 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const { |
| 365 gfx::GpuMemoryBufferHandle handle; | 365 gfx::GpuMemoryBufferHandle handle; |
| 366 #if defined(USE_OZONE) | 366 #if defined(USE_OZONE) |
| 367 CHECK(pixmap_); | 367 CHECK(pixmap_); |
| 368 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0))); | 368 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0))); |
| 369 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; | 369 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; |
| 370 handle.type = gfx::OZONE_NATIVE_PIXMAP; | 370 handle.type = gfx::OZONE_NATIVE_PIXMAP; |
| 371 handle.native_pixmap_handle.fds.emplace_back( | 371 handle.native_pixmap_handle.fds.emplace_back( |
| 372 base::FileDescriptor(duped_fd, true)); | 372 base::FileDescriptor(duped_fd, true)); |
| 373 handle.native_pixmap_handle.planes.emplace_back( | 373 handle.native_pixmap_handle.strides_and_offsets.emplace_back( |
| 374 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0), | 374 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0)); |
| 375 pixmap_->GetDmaBufModifier(0)); | |
| 376 #endif | 375 #endif |
| 377 return handle; | 376 return handle; |
| 378 } | 377 } |
| 379 | 378 |
| 380 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by | 379 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by |
| 381 // the TESTs below. | 380 // the TESTs below. |
| 382 class GLRenderingVDAClient | 381 class GLRenderingVDAClient |
| 383 : public VideoDecodeAccelerator::Client, | 382 : public VideoDecodeAccelerator::Client, |
| 384 public base::SupportsWeakPtr<GLRenderingVDAClient> { | 383 public base::SupportsWeakPtr<GLRenderingVDAClient> { |
| 385 public: | 384 public: |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 media::VaapiWrapper::PreSandboxInitialization(); | 1779 media::VaapiWrapper::PreSandboxInitialization(); |
| 1781 #endif | 1780 #endif |
| 1782 | 1781 |
| 1783 media::g_env = | 1782 media::g_env = |
| 1784 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1783 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
| 1785 testing::AddGlobalTestEnvironment( | 1784 testing::AddGlobalTestEnvironment( |
| 1786 new media::VideoDecodeAcceleratorTestEnvironment())); | 1785 new media::VideoDecodeAcceleratorTestEnvironment())); |
| 1787 | 1786 |
| 1788 return RUN_ALL_TESTS(); | 1787 return RUN_ALL_TESTS(); |
| 1789 } | 1788 } |
| OLD | NEW |