Skip to content

Commit d2072a2

Browse files
committed
[WPEPlatform] Rename WPEBufferDMABufFormats et al. to WPEBufferFormats
https://bugs.webkit.org/show_bug.cgi?id=303474 Reviewed by Carlos Garcia Campos. Platform implementations where DMA-BUF is not available may want to use the existing mechanism to inform WebKit about supported buffer formats e.g. on Android the API does not expose DMA-BUFs directly, therefore it is not really needed to have the "DMA-BUF" term as part of type and symbol names. * Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp: (WKWPE::ViewPlatform::ViewPlatform): * Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::preferredBufferFormats const): * Source/WebKit/WPEPlatform/CMakeLists.txt: * Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormats.h: Removed. * Source/WebKit/WPEPlatform/wpe/WPEBufferFormats.cpp: Renamed from Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormats.cpp. (BufferFormat::BufferFormat): (BufferFormatsGroup::BufferFormatsGroup): (wpe_buffer_formats_class_init): (wpe_buffer_formats_get_device): (wpe_buffer_formats_get_n_groups): (wpe_buffer_formats_get_group_usage): (wpe_buffer_formats_get_group_device): (wpe_buffer_formats_get_group_n_formats): (wpe_buffer_formats_get_format_fourcc): (wpe_buffer_formats_get_format_modifiers): (_WPEBufferFormatsBuilder::_WPEBufferFormatsBuilder): (wpe_buffer_formats_builder_new): (wpe_buffer_formats_builder_ref): (wpe_buffer_formats_builder_unref): (wpe_buffer_formats_builder_append_group): (wpe_buffer_formats_builder_append_format): (wpe_buffer_formats_builder_end): * Source/WebKit/WPEPlatform/wpe/WPEBufferFormats.h: Added. * Source/WebKit/WPEPlatform/wpe/WPEDisplay.cpp: (wpeDisplayPreferredBufferFormats): (wpe_display_get_preferred_buffer_formats): (wpeDisplayPreferredDMABufFormats): Deleted. (wpe_display_get_preferred_dma_buf_formats): Deleted. * Source/WebKit/WPEPlatform/wpe/WPEDisplay.h: * Source/WebKit/WPEPlatform/wpe/WPEToplevel.cpp: (wpe_toplevel_get_preferred_buffer_formats): (wpe_toplevel_preferred_buffer_formats_changed): (wpe_toplevel_get_preferred_dma_buf_formats): Deleted. (wpe_toplevel_preferred_dma_buf_formats_changed): Deleted. * Source/WebKit/WPEPlatform/wpe/WPEToplevel.h: * Source/WebKit/WPEPlatform/wpe/WPEView.cpp: (wpe_view_class_init): (wpeViewPreferredBufferFormatsChanged): (wpe_view_set_toplevel): (wpe_view_get_preferred_buffer_formats): (wpeViewPreferredDMABufFormatsChanged): Deleted. (wpe_view_get_preferred_dma_buf_formats): Deleted. * Source/WebKit/WPEPlatform/wpe/WPEView.h: * Source/WebKit/WPEPlatform/wpe/WPEViewPrivate.h: * Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp: (wpeDisplayDRMGetPreferredBufferFormats): (wpe_display_drm_class_init): (wpeDisplayDRMGetPreferredDMABufFormats): Deleted. * Source/WebKit/WPEPlatform/wpe/headless/WPEDisplayHeadless.cpp: * Source/WebKit/WPEPlatform/wpe/wayland/WPEDisplayWayland.cpp: (wpeDisplayWaylandGetPreferredBufferFormats): (wpe_display_wayland_class_init): (wpeDisplayWaylandGetPreferredDMABufFormats): Deleted. * Source/WebKit/WPEPlatform/wpe/wayland/WPEToplevelWayland.cpp: (wpeToplevelWaylandGetPreferredBufferFormats): (wpe_toplevel_wayland_class_init): (wpeToplevelWaylandGetPreferredDMABufFormats): Deleted. * Source/WebKit/WPEPlatform/wpe/wayland/WPEViewWayland.cpp: * Source/WebKit/WPEPlatform/wpe/wpe-platform.h: * Tools/TestWebKitAPI/Tests/WPEPlatform/TestDisplay.cpp: (TestWebKitAPI::testDisplayBufferFormats): (TestWebKitAPI::beforeAll): (TestWebKitAPI::testDisplayDMABufFormats): Deleted. * Tools/TestWebKitAPI/glib/WPEPlatform/mock/WPEDisplayMock.cpp: (wpeDisplayMockGetPreferredBufferFormats): (wpe_display_mock_class_init): (wpeDisplayMockUseFakeBufferFormats): (wpeDisplayMockGetPreferredDMABufFormats): Deleted. (wpeDisplayMockUseFakeDMABufFormats): Deleted. * Tools/TestWebKitAPI/glib/WPEPlatform/mock/WPEDisplayMock.h: * Tools/TestWebKitAPI/glib/WPEPlatform/mock/WPEToplevelMock.cpp: (wpeToplevelMockGetPreferredBufferFormats): (wpe_toplevel_mock_class_init): (wpeToplevelMockGetPreferredDMABufFormats): Deleted. Canonical link: https://commits.webkit.org/303891@main
1 parent ca64223 commit d2072a2

23 files changed

+469
-470
lines changed

‎Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ViewPlatform::ViewPlatform(WPEDisplay* display, const API::PageConfiguration& co
125125
webView.toplevelStateChanged(previousState, wpe_view_get_toplevel_state(view));
126126
}), this);
127127
#if USE(GBM)
128-
g_signal_connect(m_wpeView.get(), "preferred-dma-buf-formats-changed", G_CALLBACK(+[](WPEView*, gpointer userData) {
128+
g_signal_connect(m_wpeView.get(), "preferred-buffer-formats-changed", G_CALLBACK(+[](WPEView*, gpointer userData) {
129129
auto& webView = *reinterpret_cast<ViewPlatform*>(userData);
130130
webView.page().preferredBufferFormatsDidChange();
131131
}), this);

‎Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,39 +131,39 @@ Vector<RendererBufferFormat> WebPageProxy::preferredBufferFormats() const
131131
if (!view)
132132
return { };
133133

134-
auto* formats = wpe_view_get_preferred_dma_buf_formats(view);
134+
auto* formats = wpe_view_get_preferred_buffer_formats(view);
135135
if (!formats)
136136
return { };
137137

138138
Vector<RendererBufferFormat> bufferFormats;
139-
WPEDRMDevice* mainDevice = wpe_buffer_dma_buf_formats_get_device(formats);
140-
auto groupCount = wpe_buffer_dma_buf_formats_get_n_groups(formats);
139+
WPEDRMDevice* mainDevice = wpe_buffer_formats_get_device(formats);
140+
auto groupCount = wpe_buffer_formats_get_n_groups(formats);
141141
for (unsigned i = 0; i < groupCount; ++i) {
142142
RendererBufferFormat bufferFormat;
143-
switch (wpe_buffer_dma_buf_formats_get_group_usage(formats, i)) {
144-
case WPE_BUFFER_DMA_BUF_FORMAT_USAGE_RENDERING:
143+
switch (wpe_buffer_formats_get_group_usage(formats, i)) {
144+
case WPE_BUFFER_FORMAT_USAGE_RENDERING:
145145
bufferFormat.usage = RendererBufferFormat::Usage::Rendering;
146146
break;
147-
case WPE_BUFFER_DMA_BUF_FORMAT_USAGE_MAPPING:
147+
case WPE_BUFFER_FORMAT_USAGE_MAPPING:
148148
bufferFormat.usage = RendererBufferFormat::Usage::Mapping;
149149
break;
150-
case WPE_BUFFER_DMA_BUF_FORMAT_USAGE_SCANOUT:
150+
case WPE_BUFFER_FORMAT_USAGE_SCANOUT:
151151
bufferFormat.usage = RendererBufferFormat::Usage::Scanout;
152152
break;
153153
}
154154

155-
WPEDRMDevice* targetDevice = wpe_buffer_dma_buf_formats_get_group_device(formats, i);
155+
WPEDRMDevice* targetDevice = wpe_buffer_formats_get_group_device(formats, i);
156156
if (!targetDevice)
157157
targetDevice = mainDevice;
158158
if (targetDevice)
159159
bufferFormat.drmDevice = { CString(wpe_drm_device_get_primary_node(targetDevice)), CString(wpe_drm_device_get_render_node(targetDevice)) };
160160

161-
auto formatsCount = wpe_buffer_dma_buf_formats_get_group_n_formats(formats, i);
161+
auto formatsCount = wpe_buffer_formats_get_group_n_formats(formats, i);
162162
bufferFormat.formats.reserveInitialCapacity(formatsCount);
163163
for (unsigned j = 0; j < formatsCount; ++j) {
164164
RendererBufferFormat::Format format;
165-
format.fourcc = wpe_buffer_dma_buf_formats_get_format_fourcc(formats, i, j);
166-
auto* modifiers = wpe_buffer_dma_buf_formats_get_format_modifiers(formats, i, j);
165+
format.fourcc = wpe_buffer_formats_get_format_fourcc(formats, i, j);
166+
auto* modifiers = wpe_buffer_formats_get_format_modifiers(formats, i, j);
167167
format.modifiers.reserveInitialCapacity(modifiers->len);
168168
for (unsigned k = 0; k < modifiers->len; ++k) {
169169
WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN // WPE port

‎Source/WebKit/WPEPlatform/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(WPEPlatform_SOURCES
1414
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBuffer.cpp
1515
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferAndroid.cpp
1616
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABuf.cpp
17-
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABufFormats.cpp
17+
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferFormats.cpp
1818
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferSHM.cpp
1919
${WEBKIT_DIR}/WPEPlatform/wpe/WPEClipboard.cpp
2020
${WEBKIT_DIR}/WPEPlatform/wpe/WPEColor.cpp
@@ -49,7 +49,7 @@ set(WPEPlatform_INSTALLED_HEADERS
4949
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBuffer.h
5050
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferAndroid.h
5151
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABuf.h
52-
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABufFormats.h
52+
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferFormats.h
5353
${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferSHM.h
5454
${WEBKIT_DIR}/WPEPlatform/wpe/WPEClipboard.h
5555
${WEBKIT_DIR}/WPEPlatform/wpe/WPEColor.h

‎Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormats.h‎

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)