| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <fcntl.h> | 5 #include <fcntl.h> |
| 6 #include <libdrm/i915_drm.h> | 6 #include <libdrm/i915_drm.h> |
| 7 #include <linux/types.h> | 7 #include <linux/types.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 DCHECK(!ret) << "Problems with drmIoctl when writing data."; | 87 DCHECK(!ret) << "Problems with drmIoctl when writing data."; |
| 88 | 88 |
| 89 gfx::NativePixmapHandle pixmap_handle; | 89 gfx::NativePixmapHandle pixmap_handle; |
| 90 pixmap_handle.fds.emplace_back(fd, false); | 90 pixmap_handle.fds.emplace_back(fd, false); |
| 91 for (int i = 0; i < 3; i++) { | 91 for (int i = 0; i < 3; i++) { |
| 92 pixmap_handle.strides_and_offsets.emplace_back(pitches[i], offsets[i]); | 92 pixmap_handle.strides_and_offsets.emplace_back(pitches[i], offsets[i]); |
| 93 } | 93 } |
| 94 ui::SurfaceFactoryOzone* surface_factory = | 94 ui::SurfaceFactoryOzone* surface_factory = |
| 95 ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); | 95 ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); |
| 96 return surface_factory->CreateNativePixmapFromHandle( | 96 return surface_factory->CreateNativePixmapFromHandle( |
| 97 size, gfx::BufferFormat::YVU_420, pixmap_handle); | 97 gfx::kNullAcceleratedWidget, size, gfx::BufferFormat::YVU_420, |
| 98 pixmap_handle); |
| 98 } | 99 } |
| 99 | 100 |
| 100 // Delegate to test EGL images created directly using drm. | 101 // Delegate to test EGL images created directly using drm. |
| 101 // YVU420 buffers can't be created yet via Ozone, we still | 102 // YVU420 buffers can't be created yet via Ozone, we still |
| 102 // want to test them since they can be imported and displayed | 103 // want to test them since they can be imported and displayed |
| 103 // via exo. | 104 // via exo. |
| 104 // TODO(dcastagna): once it's possible to allocate and map YV12 format | 105 // TODO(dcastagna): once it's possible to allocate and map YV12 format |
| 105 // using Ozone merge this test with GLImageOzoneNativePixmapTestDelegate. | 106 // using Ozone merge this test with GLImageOzoneNativePixmapTestDelegate. |
| 106 class GLImageOzoneNativePixmapDrmTestDelegate { | 107 class GLImageOzoneNativePixmapDrmTestDelegate { |
| 107 public: | 108 public: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 130 INSTANTIATE_TYPED_TEST_CASE_P(DISABLED_GLImageOzoneNativePixmapDrm, | 131 INSTANTIATE_TYPED_TEST_CASE_P(DISABLED_GLImageOzoneNativePixmapDrm, |
| 131 GLImageTest, | 132 GLImageTest, |
| 132 GLImageOzoneNativePixmapDrmTestDelegate); | 133 GLImageOzoneNativePixmapDrmTestDelegate); |
| 133 | 134 |
| 134 INSTANTIATE_TYPED_TEST_CASE_P(DISABLED_GLImageOzoneNativePixmapDrm, | 135 INSTANTIATE_TYPED_TEST_CASE_P(DISABLED_GLImageOzoneNativePixmapDrm, |
| 135 GLImageBindTest, | 136 GLImageBindTest, |
| 136 GLImageOzoneNativePixmapDrmTestDelegate); | 137 GLImageOzoneNativePixmapDrmTestDelegate); |
| 137 | 138 |
| 138 } // namespace | 139 } // namespace |
| 139 } // namespace gl | 140 } // namespace gl |
| OLD | NEW |