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

Side by Side Diff: ui/gl/gl_image_ozone_native_pixmap_drm_unittest.cc

Issue 2148983002: gpu: Take surface handle into account when importing buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid crash in DrmDeviceManager::GetDrmDevice when passed invalid widget Created 4 years, 5 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/gpu/vaapi_drm_picture.cc ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.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 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
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.planes.emplace_back(pitches[i], offsets[i], 0); 92 pixmap_handle.planes.emplace_back(pitches[i], offsets[i], 0);
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
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
OLDNEW
« no previous file with comments | « media/gpu/vaapi_drm_picture.cc ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698