Commit 06046d63 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11 and Ozone: make sure gfx::AcceleratedWidget to be uint32_t

Currently, Ozone/X11 defines gfx::AcceleratedWidget as
int32_t whereas non-Ozone/X11 defines that as x11::Window
or uint32_t. To fix the inconsistency and allow use_x11 &&
use_ozone builds, make non-Ozone/X11 uses Ozone's definition
of gfx::AcceleratedWidget.

Also adds missing includes.

Bug: 1098267
Change-Id: If9e98dd440c5d077990e390a0a10855723676b76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2260554Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#782872}
parent 33f18bf2
...@@ -210,7 +210,7 @@ GlobalMenuBarX11::GlobalMenuBarX11(BrowserView* browser_view, ...@@ -210,7 +210,7 @@ GlobalMenuBarX11::GlobalMenuBarX11(BrowserView* browser_view,
: browser_(browser_view->browser()), : browser_(browser_view->browser()),
profile_(browser_->profile()), profile_(browser_->profile()),
browser_view_(browser_view), browser_view_(browser_view),
window_(host->GetAcceleratedWidget()), window_(static_cast<x11::Window>(host->GetAcceleratedWidget())),
tab_restore_service_(nullptr), tab_restore_service_(nullptr),
last_command_id_(kFirstUnreservedCommandId - 1) { last_command_id_(kFirstUnreservedCommandId - 1) {
GlobalMenuBarRegistrarX11::GetInstance()->OnMenuBarCreated(this); GlobalMenuBarRegistrarX11::GetInstance()->OnMenuBarCreated(this);
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "gpu/command_buffer/common/swap_buffers_complete_params.h" #include "gpu/command_buffer/common/swap_buffers_complete_params.h"
#include "gpu/gpu_export.h" #include "gpu/gpu_export.h"
#include "gpu/ipc/common/gpu_command_buffer_traits.h" #include "gpu/ipc/common/gpu_command_buffer_traits.h"
#include "gpu/ipc/common/surface_handle.h"
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
#include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/gfx_param_traits.h"
#include "url/ipc/url_param_traits.h" #include "url/ipc/url_param_traits.h"
...@@ -33,8 +32,4 @@ IPC_STRUCT_TRAITS_END() ...@@ -33,8 +32,4 @@ IPC_STRUCT_TRAITS_END()
IPC_ENUM_TRAITS_MAX_VALUE(viz::ResourceFormat, viz::RESOURCE_FORMAT_MAX) IPC_ENUM_TRAITS_MAX_VALUE(viz::ResourceFormat, viz::RESOURCE_FORMAT_MAX)
#if defined(USE_X11)
IPC_ENUM_TRAITS(gpu::SurfaceHandle)
#endif
#endif // GPU_IPC_COMMON_GPU_PARAM_TRAITS_MACROS_H_ #endif // GPU_IPC_COMMON_GPU_PARAM_TRAITS_MACROS_H_
...@@ -191,7 +191,9 @@ class UIControlsX11 : public UIControlsAura { ...@@ -191,7 +191,9 @@ class UIControlsX11 : public UIControlsAura {
void RunClosureAfterAllPendingUIEvents(base::OnceClosure closure) { void RunClosureAfterAllPendingUIEvents(base::OnceClosure closure) {
if (closure.is_null()) if (closure.is_null())
return; return;
ui::XEventWaiter::Create(host_->GetAcceleratedWidget(), std::move(closure)); ui::XEventWaiter::Create(
static_cast<x11::Window>(host_->GetAcceleratedWidget()),
std::move(closure));
} }
private: private:
......
...@@ -13,7 +13,7 @@ namespace test { ...@@ -13,7 +13,7 @@ namespace test {
void PostEventToWindowTreeHost(const XEvent& xevent, WindowTreeHost* host) { void PostEventToWindowTreeHost(const XEvent& xevent, WindowTreeHost* host) {
XDisplay* xdisplay = gfx::GetXDisplay(); XDisplay* xdisplay = gfx::GetXDisplay();
x11::Window xwindow = host->GetAcceleratedWidget(); x11::Window xwindow = static_cast<x11::Window>(host->GetAcceleratedWidget());
XEvent event = xevent; XEvent event = xevent;
event.xany.display = xdisplay; event.xany.display = xdisplay;
event.xany.window = static_cast<uint32_t>(xwindow); event.xany.window = static_cast<uint32_t>(xwindow);
......
...@@ -77,7 +77,8 @@ void TestCompositorHostX11::Show() { ...@@ -77,7 +77,8 @@ void TestCompositorHostX11::Show() {
// to ensure the map is complete. // to ensure the map is complete.
XSync(display, x11::False); XSync(display, x11::False);
allocator_.GenerateId(); allocator_.GenerateId();
compositor_.SetAcceleratedWidget(window_); compositor_.SetAcceleratedWidget(
static_cast<gfx::AcceleratedWidget>(window_));
compositor_.SetScaleAndSize(1.0f, bounds_.size(), compositor_.SetScaleAndSize(1.0f, bounds_.size(),
allocator_.GetCurrentLocalSurfaceIdAllocation()); allocator_.GetCurrentLocalSurfaceIdAllocation());
compositor_.SetVisible(true); compositor_.SetVisible(true);
......
...@@ -110,12 +110,6 @@ typedef struct _AtkObject AtkObject; ...@@ -110,12 +110,6 @@ typedef struct _AtkObject AtkObject;
} }
#endif #endif
#if defined(USE_X11)
namespace x11 {
enum class Window : uint32_t;
}
#endif
namespace gfx { namespace gfx {
#if defined(USE_AURA) #if defined(USE_AURA)
...@@ -239,10 +233,6 @@ typedef intptr_t NativeViewId; ...@@ -239,10 +233,6 @@ typedef intptr_t NativeViewId;
#if defined(OS_WIN) #if defined(OS_WIN)
typedef HWND AcceleratedWidget; typedef HWND AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = nullptr; constexpr AcceleratedWidget kNullAcceleratedWidget = nullptr;
#elif defined(USE_X11)
typedef x11::Window AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget =
static_cast<x11::Window>(0);
#elif defined(OS_IOS) #elif defined(OS_IOS)
typedef UIView* AcceleratedWidget; typedef UIView* AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0; constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
...@@ -252,8 +242,8 @@ constexpr AcceleratedWidget kNullAcceleratedWidget = 0; ...@@ -252,8 +242,8 @@ constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
typedef ANativeWindow* AcceleratedWidget; typedef ANativeWindow* AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0; constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(USE_OZONE) #elif defined(USE_OZONE) || defined(USE_X11)
typedef int32_t AcceleratedWidget; typedef uint32_t AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0; constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#else #else
#error unknown platform #error unknown platform
......
...@@ -50,8 +50,8 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) { ...@@ -50,8 +50,8 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) {
XSync(xdisplay, x11::False); XSync(xdisplay, x11::False);
GLImageTestSupport::InitializeGL(base::nullopt); GLImageTestSupport::InitializeGL(base::nullopt);
auto surface = auto surface = gl::InitializeGLSurface(base::MakeRefCounted<GLSurfaceGLXX11>(
gl::InitializeGLSurface(base::MakeRefCounted<GLSurfaceGLXX11>(xwindow)); static_cast<gfx::AcceleratedWidget>(xwindow)));
scoped_refptr<GLContext> context = scoped_refptr<GLContext> context =
gl::init::CreateGLContext(nullptr, surface.get(), GLContextAttribs()); gl::init::CreateGLContext(nullptr, surface.get(), GLContextAttribs());
......
...@@ -80,10 +80,12 @@ scoped_refptr<GLSurface> CreateViewGLSurfaceX11(gfx::AcceleratedWidget window) { ...@@ -80,10 +80,12 @@ scoped_refptr<GLSurface> CreateViewGLSurfaceX11(gfx::AcceleratedWidget window) {
case kGLImplementationSwiftShaderGL: case kGLImplementationSwiftShaderGL:
case kGLImplementationEGLGLES2: case kGLImplementationEGLGLES2:
DCHECK(window != gfx::kNullAcceleratedWidget); DCHECK(window != gfx::kNullAcceleratedWidget);
return InitializeGLSurface(new NativeViewGLSurfaceEGLX11GLES2(window)); return InitializeGLSurface(
new NativeViewGLSurfaceEGLX11GLES2(static_cast<x11::Window>(window)));
case kGLImplementationEGLANGLE: case kGLImplementationEGLANGLE:
DCHECK(window != gfx::kNullAcceleratedWidget); DCHECK(window != gfx::kNullAcceleratedWidget);
return InitializeGLSurface(new NativeViewGLSurfaceEGLX11(window)); return InitializeGLSurface(
new NativeViewGLSurfaceEGLX11(static_cast<x11::Window>(window)));
case kGLImplementationMockGL: case kGLImplementationMockGL:
case kGLImplementationStubGL: case kGLImplementationStubGL:
return new GLSurfaceStub; return new GLSurfaceStub;
......
...@@ -89,8 +89,8 @@ void GLOzoneEglCast::TerminateDisplay() { ...@@ -89,8 +89,8 @@ void GLOzoneEglCast::TerminateDisplay() {
scoped_refptr<gl::GLSurface> GLOzoneEglCast::CreateViewGLSurface( scoped_refptr<gl::GLSurface> GLOzoneEglCast::CreateViewGLSurface(
gfx::AcceleratedWidget widget) { gfx::AcceleratedWidget widget) {
// Verify requested widget dimensions match our current display size. // Verify requested widget dimensions match our current display size.
DCHECK_EQ(widget >> 16, display_size_.width()); DCHECK_EQ(static_cast<int>(widget >> 16), display_size_.width());
DCHECK_EQ(widget & 0xffff, display_size_.height()); DCHECK_EQ(static_cast<int>(widget & 0xffff), display_size_.height());
return gl::InitializeGLSurface(new GLSurfaceCast(widget, this)); return gl::InitializeGLSurface(new GLSurfaceCast(widget, this));
} }
......
...@@ -251,9 +251,11 @@ void TestMoveLoop::EndMoveLoop() { ...@@ -251,9 +251,11 @@ void TestMoveLoop::EndMoveLoop() {
SimpleTestDragDropClient::SimpleTestDragDropClient( SimpleTestDragDropClient::SimpleTestDragDropClient(
aura::Window* window, aura::Window* window,
DesktopNativeCursorManager* cursor_manager) DesktopNativeCursorManager* cursor_manager)
: DesktopDragDropClientAuraX11(window, : DesktopDragDropClientAuraX11(
cursor_manager, window,
window->GetHost()->GetAcceleratedWidget()) {} cursor_manager,
static_cast<x11::Window>(window->GetHost()->GetAcceleratedWidget())) {
}
SimpleTestDragDropClient::~SimpleTestDragDropClient() = default; SimpleTestDragDropClient::~SimpleTestDragDropClient() = default;
...@@ -283,7 +285,9 @@ TestDragDropClient::TestDragDropClient( ...@@ -283,7 +285,9 @@ TestDragDropClient::TestDragDropClient(
aura::Window* window, aura::Window* window,
DesktopNativeCursorManager* cursor_manager) DesktopNativeCursorManager* cursor_manager)
: SimpleTestDragDropClient(window, cursor_manager), : SimpleTestDragDropClient(window, cursor_manager),
source_window_(window->GetHost()->GetAcceleratedWidget()) {} source_window_(
static_cast<x11::Window>(window->GetHost()->GetAcceleratedWidget())) {
}
TestDragDropClient::~TestDragDropClient() = default; TestDragDropClient::~TestDragDropClient() = default;
...@@ -591,8 +595,8 @@ void ChromeSourceTargetStep2(SimpleTestDragDropClient* client, ...@@ -591,8 +595,8 @@ void ChromeSourceTargetStep2(SimpleTestDragDropClient* client,
aura::client::SetDragDropDelegate(target_widget->GetNativeWindow(), aura::client::SetDragDropDelegate(target_widget->GetNativeWindow(),
delegate.get()); delegate.get());
client->SetTopmostXWindow( client->SetTopmostXWindow(static_cast<x11::Window>(
target_widget->GetNativeView()->GetHost()->GetAcceleratedWidget()); target_widget->GetNativeView()->GetHost()->GetAcceleratedWidget()));
gfx::Rect target_widget_bounds_in_screen = gfx::Rect target_widget_bounds_in_screen =
target_widget->GetWindowBoundsInScreen(); target_widget->GetWindowBoundsInScreen();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ui/views/widget/desktop_aura/desktop_screen_x11.h" #include "ui/views/widget/desktop_aura/desktop_screen_x11.h"
#include <set>
#include <string>
#include <vector> #include <vector>
#include "base/command_line.h" #include "base/command_line.h"
...@@ -66,7 +68,7 @@ gfx::NativeWindow DesktopScreenX11::GetWindowAtScreenPoint( ...@@ -66,7 +68,7 @@ gfx::NativeWindow DesktopScreenX11::GetWindowAtScreenPoint(
gfx::ConvertPointToPixel(GetXDisplayScaleFactor(), point), {}); gfx::ConvertPointToPixel(GetXDisplayScaleFactor(), point), {});
return window != x11::Window::None return window != x11::Window::None
? views::DesktopWindowTreeHostPlatform::GetContentWindowForWidget( ? views::DesktopWindowTreeHostPlatform::GetContentWindowForWidget(
window) static_cast<gfx::AcceleratedWidget>(window))
: nullptr; : nullptr;
} }
...@@ -81,7 +83,7 @@ gfx::NativeWindow DesktopScreenX11::GetLocalProcessWindowAtPoint( ...@@ -81,7 +83,7 @@ gfx::NativeWindow DesktopScreenX11::GetLocalProcessWindowAtPoint(
ignore_widgets); ignore_widgets);
return window != x11::Window::None return window != x11::Window::None
? views::DesktopWindowTreeHostPlatform::GetContentWindowForWidget( ? views::DesktopWindowTreeHostPlatform::GetContentWindowForWidget(
window) static_cast<gfx::AcceleratedWidget>(window))
: nullptr; : nullptr;
} }
......
...@@ -143,8 +143,8 @@ class DesktopWindowTreeHostX11Test : public test::DesktopWidgetTestInteractive { ...@@ -143,8 +143,8 @@ class DesktopWindowTreeHostX11Test : public test::DesktopWidgetTestInteractive {
TEST_F(DesktopWindowTreeHostX11Test, Deactivate) { TEST_F(DesktopWindowTreeHostX11Test, Deactivate) {
std::unique_ptr<Widget> widget(CreateWidget(gfx::Rect(100, 100, 100, 100))); std::unique_ptr<Widget> widget(CreateWidget(gfx::Rect(100, 100, 100, 100)));
ActivationWaiter waiter( ActivationWaiter waiter(static_cast<x11::Window>(
widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()));
widget->Show(); widget->Show();
widget->Activate(); widget->Activate();
waiter.Wait(); waiter.Wait();
...@@ -244,8 +244,8 @@ TEST_F(DesktopWindowTreeHostX11Test, InputMethodFocus) { ...@@ -244,8 +244,8 @@ TEST_F(DesktopWindowTreeHostX11Test, InputMethodFocus) {
// Waiter should be created as early as possible so that PropertyNotify has // Waiter should be created as early as possible so that PropertyNotify has
// time to be set before widget is activated. // time to be set before widget is activated.
ActivationWaiter waiter( ActivationWaiter waiter(static_cast<x11::Window>(
widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()));
std::unique_ptr<Textfield> textfield(new Textfield); std::unique_ptr<Textfield> textfield(new Textfield);
textfield->SetBounds(0, 0, 200, 20); textfield->SetBounds(0, 0, 200, 20);
......
...@@ -285,7 +285,10 @@ void TestMoveLoop::EndMoveLoop() { ...@@ -285,7 +285,10 @@ void TestMoveLoop::EndMoveLoop() {
SimpleTestDragDropClient::SimpleTestDragDropClient( SimpleTestDragDropClient::SimpleTestDragDropClient(
aura::Window* window, aura::Window* window,
DesktopNativeCursorManager* cursor_manager) DesktopNativeCursorManager* cursor_manager)
: ui::XDragDropClient(this, window->GetHost()->GetAcceleratedWidget()) {} : ui::XDragDropClient(
this,
static_cast<x11::Window>(window->GetHost()->GetAcceleratedWidget())) {
}
SimpleTestDragDropClient::~SimpleTestDragDropClient() = default; SimpleTestDragDropClient::~SimpleTestDragDropClient() = default;
...@@ -390,7 +393,9 @@ TestDragDropClient::TestDragDropClient( ...@@ -390,7 +393,9 @@ TestDragDropClient::TestDragDropClient(
aura::Window* window, aura::Window* window,
DesktopNativeCursorManager* cursor_manager) DesktopNativeCursorManager* cursor_manager)
: SimpleTestDragDropClient(window, cursor_manager), : SimpleTestDragDropClient(window, cursor_manager),
source_window_(window->GetHost()->GetAcceleratedWidget()) {} source_window_(
static_cast<x11::Window>(window->GetHost()->GetAcceleratedWidget())) {
}
TestDragDropClient::~TestDragDropClient() = default; TestDragDropClient::~TestDragDropClient() = default;
......
...@@ -163,11 +163,11 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive { ...@@ -163,11 +163,11 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive {
// NULL if the topmost window does not have an associated aura::Window. // NULL if the topmost window does not have an associated aura::Window.
aura::Window* FindTopmostLocalProcessWindowAt(int screen_x, int screen_y) { aura::Window* FindTopmostLocalProcessWindowAt(int screen_x, int screen_y) {
ui::X11TopmostWindowFinder finder; ui::X11TopmostWindowFinder finder;
auto widget = auto widget = static_cast<gfx::AcceleratedWidget>(
finder.FindLocalProcessWindowAt(gfx::Point(screen_x, screen_y), {}); finder.FindLocalProcessWindowAt(gfx::Point(screen_x, screen_y), {}));
return widget != gfx::kNullAcceleratedWidget return widget != gfx::kNullAcceleratedWidget
? DesktopWindowTreeHostPlatform::GetContentWindowForWidget( ? DesktopWindowTreeHostPlatform::GetContentWindowForWidget(
static_cast<gfx::AcceleratedWidget>(widget)) widget)
: nullptr; : nullptr;
} }
...@@ -182,10 +182,11 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive { ...@@ -182,10 +182,11 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive {
ignore.insert(ignore_window->GetHost()->GetAcceleratedWidget()); ignore.insert(ignore_window->GetHost()->GetAcceleratedWidget());
ui::X11TopmostWindowFinder finder; ui::X11TopmostWindowFinder finder;
auto widget = auto widget =
finder.FindLocalProcessWindowAt(gfx::Point(screen_x, screen_y), ignore); static_cast<gfx::AcceleratedWidget>(finder.FindLocalProcessWindowAt(
gfx::Point(screen_x, screen_y), ignore));
return widget != gfx::kNullAcceleratedWidget return widget != gfx::kNullAcceleratedWidget
? DesktopWindowTreeHostPlatform::GetContentWindowForWidget( ? DesktopWindowTreeHostPlatform::GetContentWindowForWidget(
static_cast<gfx::AcceleratedWidget>(widget)) widget)
: nullptr; : nullptr;
} }
...@@ -200,14 +201,16 @@ TEST_F(X11TopmostWindowFinderTest, Basic) { ...@@ -200,14 +201,16 @@ TEST_F(X11TopmostWindowFinderTest, Basic) {
std::unique_ptr<Widget> widget1( std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 200, 100))); CreateAndShowWidget(gfx::Rect(100, 100, 200, 100)));
aura::Window* window1 = widget1->GetNativeWindow(); aura::Window* window1 = widget1->GetNativeWindow();
x11::Window x11_window1 = window1->GetHost()->GetAcceleratedWidget(); x11::Window x11_window1 =
static_cast<x11::Window>(window1->GetHost()->GetAcceleratedWidget());
x11::Window x11_window2 = CreateAndShowXWindow(gfx::Rect(200, 100, 100, 200)); x11::Window x11_window2 = CreateAndShowXWindow(gfx::Rect(200, 100, 100, 200));
std::unique_ptr<Widget> widget3( std::unique_ptr<Widget> widget3(
CreateAndShowWidget(gfx::Rect(100, 190, 200, 110))); CreateAndShowWidget(gfx::Rect(100, 190, 200, 110)));
aura::Window* window3 = widget3->GetNativeWindow(); aura::Window* window3 = widget3->GetNativeWindow();
x11::Window x11_window3 = window3->GetHost()->GetAcceleratedWidget(); x11::Window x11_window3 =
static_cast<x11::Window>(window3->GetHost()->GetAcceleratedWidget());
x11::Window windows[] = {x11_window1, x11_window2, x11_window3}; x11::Window windows[] = {x11_window1, x11_window2, x11_window3};
StackingClientListWaiter waiter(windows, base::size(windows)); StackingClientListWaiter waiter(windows, base::size(windows));
...@@ -249,7 +252,8 @@ TEST_F(X11TopmostWindowFinderTest, Minimized) { ...@@ -249,7 +252,8 @@ TEST_F(X11TopmostWindowFinderTest, Minimized) {
std::unique_ptr<Widget> widget1( std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100))); CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
aura::Window* window1 = widget1->GetNativeWindow(); aura::Window* window1 = widget1->GetNativeWindow();
x11::Window x11_window1 = window1->GetHost()->GetAcceleratedWidget(); x11::Window x11_window1 =
static_cast<x11::Window>(window1->GetHost()->GetAcceleratedWidget());
x11::Window x11_window2 = CreateAndShowXWindow(gfx::Rect(300, 100, 100, 100)); x11::Window x11_window2 = CreateAndShowXWindow(gfx::Rect(300, 100, 100, 100));
x11::Window windows[] = {x11_window1, x11_window2}; x11::Window windows[] = {x11_window1, x11_window2};
...@@ -287,8 +291,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangular) { ...@@ -287,8 +291,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangular) {
std::unique_ptr<Widget> widget1( std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100))); CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
x11::Window window1 = x11::Window window1 = static_cast<x11::Window>(
widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget(); widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget());
auto shape1 = std::make_unique<Widget::ShapeRects>(); auto shape1 = std::make_unique<Widget::ShapeRects>();
shape1->emplace_back(0, 10, 10, 90); shape1->emplace_back(0, 10, 10, 90);
shape1->emplace_back(10, 0, 90, 100); shape1->emplace_back(10, 0, 90, 100);
...@@ -331,8 +335,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularEmptyShape) { ...@@ -331,8 +335,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularEmptyShape) {
std::unique_ptr<Widget> widget1( std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100))); CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
x11::Window window1 = x11::Window window1 = static_cast<x11::Window>(
widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget(); widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget());
auto shape1 = std::make_unique<Widget::ShapeRects>(); auto shape1 = std::make_unique<Widget::ShapeRects>();
shape1->emplace_back(); shape1->emplace_back();
// Widget takes ownership of |shape1|. // Widget takes ownership of |shape1|.
...@@ -353,8 +357,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularNullShape) { ...@@ -353,8 +357,8 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularNullShape) {
std::unique_ptr<Widget> widget1( std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100))); CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
x11::Window window1 = x11::Window window1 = static_cast<x11::Window>(
widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget(); widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget());
auto shape1 = std::make_unique<Widget::ShapeRects>(); auto shape1 = std::make_unique<Widget::ShapeRects>();
shape1->emplace_back(); shape1->emplace_back();
widget1->SetShape(std::move(shape1)); widget1->SetShape(std::move(shape1));
......
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