Commit 6630cda5 authored by Igor Britsky's avatar Igor Britsky Committed by Commit Bot

Fix GCC incomplete designated initialization bug

For GCC 8.4.0 is important to get all the first initializer in
designated init-list in case of implicit construction. Correct compile
if use explicit construction.

Error example (GCC 8.4.0):
In file included from ../../gpu/vulkan/x/vulkan_surface_x11.cc:9:
../../ui/base/x/x11_util.h: In function 'bool ui::GetArrayProperty(
x11::Window, x11::Atom, std::__1::vector<_Tp>*, x11::Atom*, size_t)':
../../ui/base/x/x11_util.h:149:73: error: no matching function for call
to 'x11::Connection::GetProperty(<brace-enclosed initializer list>)'

Bug: 819294
Change-Id: I1f10321d1c162d955c5a85834bf5878a3cfa3d80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505978Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#822606}
parent b660aba3
...@@ -20,7 +20,8 @@ class VulkanSurfaceX11::ExposeEventForwarder : public ui::XEventDispatcher { ...@@ -20,7 +20,8 @@ class VulkanSurfaceX11::ExposeEventForwarder : public ui::XEventDispatcher {
explicit ExposeEventForwarder(VulkanSurfaceX11* surface) : surface_(surface) { explicit ExposeEventForwarder(VulkanSurfaceX11* surface) : surface_(surface) {
if (auto* event_source = ui::X11EventSource::GetInstance()) { if (auto* event_source = ui::X11EventSource::GetInstance()) {
x11::Connection::Get()->ChangeWindowAttributes( x11::Connection::Get()->ChangeWindowAttributes(
{.window = static_cast<x11::Window>(surface_->window_), x11::ChangeWindowAttributesRequest{
.window = static_cast<x11::Window>(surface_->window_),
.event_mask = x11::EventMask::Exposure}); .event_mask = x11::EventMask::Exposure});
event_source->AddXEventDispatcher(this); event_source->AddXEventDispatcher(this);
} }
...@@ -57,7 +58,7 @@ std::unique_ptr<VulkanSurfaceX11> VulkanSurfaceX11::Create( ...@@ -57,7 +58,7 @@ std::unique_ptr<VulkanSurfaceX11> VulkanSurfaceX11::Create(
} }
auto window = connection->GenerateId<x11::Window>(); auto window = connection->GenerateId<x11::Window>();
connection->CreateWindow({ connection->CreateWindow(x11::CreateWindowRequest{
.wid = window, .wid = window,
.parent = parent_window, .parent = parent_window,
.width = geometry->width, .width = geometry->width,
...@@ -114,8 +115,8 @@ bool VulkanSurfaceX11::Reshape(const gfx::Size& size, ...@@ -114,8 +115,8 @@ bool VulkanSurfaceX11::Reshape(const gfx::Size& size,
DCHECK_EQ(pre_transform, gfx::OVERLAY_TRANSFORM_NONE); DCHECK_EQ(pre_transform, gfx::OVERLAY_TRANSFORM_NONE);
auto* connection = x11::Connection::Get(); auto* connection = x11::Connection::Get();
connection->ConfigureWindow( connection->ConfigureWindow(x11::ConfigureWindowRequest{
{.window = window_, .width = size.width(), .height = size.height()}); .window = window_, .width = size.width(), .height = size.height()});
connection->Flush(); connection->Flush();
return VulkanSurface::Reshape(size, pre_transform); return VulkanSurface::Reshape(size, pre_transform);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment