Changeset 294803 in webkit
- Timestamp:
- May 25, 2022 10:22:59 AM (2 years ago)
- Location:
- trunk/Source/WebCore/platform/graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp
r294100 r294803 49 49 // If the description of the requested buffers has changed, update the description to the new one and wreck the existing buffers. 50 50 // This should handle changes in format or dimension of the buffers. 51 if (description.format.fourcc != m_array.description.format.fourcc || description.width != m_array.description.width || description.height != m_array.description.height ) {51 if (description.format.fourcc != m_array.description.format.fourcc || description.width != m_array.description.width || description.height != m_array.description.height || description.flags != m_array.description.flags) { 52 52 m_array.description = description; 53 53 m_array.object = { }; … … 96 96 } 97 97 98 uint32_t boFlags = 0; 99 if (description.flags & BufferDescription::LinearStorage) 100 boFlags |= GBM_BO_USE_LINEAR; 101 98 102 // For each plane, we spawn a gbm_bo object of the appropriate size and format. 99 103 // TODO: GBM_BO_USE_LINEAR will be needed when transferring memory into the bo (e.g. copying … … 101 105 for (unsigned i = 0; i < buffer->m_description.format.numPlanes; ++i) { 102 106 auto& plane = buffer->m_planes[i]; 103 plane.bo = gbm_bo_create(device.device(), plane.width, plane.height, uint32_t(plane.fourcc), GBM_BO_USE_LINEAR);107 plane.bo = gbm_bo_create(device.device(), plane.width, plane.height, uint32_t(plane.fourcc), boFlags); 104 108 plane.stride = gbm_bo_get_stride(plane.bo); 105 109 } -
trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.h
r291392 r294803 65 65 66 66 struct BufferDescription { 67 enum Flags : uint32_t { 68 NoFlags = 0, 69 LinearStorage = 1 << 0, 70 }; 71 67 72 DMABufFormat format { }; 68 73 uint32_t width { 0 }; 69 74 uint32_t height { 0 }; 75 uint32_t flags { NoFlags }; 70 76 }; 71 77 -
trunk/Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp
r294290 r294803 99 99 .width = std::clamp<uint32_t>(size.width(), 0, UINT_MAX), 100 100 .height = std::clamp<uint32_t>(size.height(), 0, UINT_MAX), 101 .flags = GBMBufferSwapchain::BufferDescription::NoFlags, 101 102 }); 102 103 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r294468 r294803 3141 3141 3142 3142 // If the decoder is exporting raw memory, we have to use the swapchain to allocate appropriate buffers 3143 // and copy over the data for each plane. 3143 // and copy over the data for each plane. For that to work, linear-storage buffer is required. 3144 3144 GBMBufferSwapchain::BufferDescription bufferDescription { 3145 DMABufFormat::create(fourccValue(GST_VIDEO_INFO_FORMAT(&videoInfo))), 3146 static_cast<uint32_t>GST_VIDEO_INFO_WIDTH(&videoInfo), static_cast<uint32_t>GST_VIDEO_INFO_HEIGHT(&videoInfo), 3145 .format = DMABufFormat::create(fourccValue(GST_VIDEO_INFO_FORMAT(&videoInfo))), 3146 .width = static_cast<uint32_t>GST_VIDEO_INFO_WIDTH(&videoInfo), 3147 .height = static_cast<uint32_t>GST_VIDEO_INFO_HEIGHT(&videoInfo), 3148 .flags = GBMBufferSwapchain::BufferDescription::LinearStorage, 3147 3149 }; 3148 3150 if (bufferDescription.format.fourcc == DMABufFormat::FourCC::Invalid)
Note: See TracChangeset
for help on using the changeset viewer.