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

Side by Side Diff: components/exo/wayland/server.cc

Issue 2664403004: Use pixel coordinates for shadow underlay bounds (Closed)
Patch Set: addressed comment Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/wayland/server.h" 5 #include "components/exo/wayland/server.h"
6 6
7 #include <alpha-compositing-unstable-v1-server-protocol.h> 7 #include <alpha-compositing-unstable-v1-server-protocol.h>
8 #include <gaming-input-unstable-v1-server-protocol.h> 8 #include <gaming-input-unstable-v1-server-protocol.h>
9 #include <grp.h> 9 #include <grp.h>
10 #include <keyboard-configuration-unstable-v1-server-protocol.h> 10 #include <keyboard-configuration-unstable-v1-server-protocol.h>
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 uint32_t edges) { 871 uint32_t edges) {
872 NOTIMPLEMENTED(); 872 NOTIMPLEMENTED();
873 } 873 }
874 874
875 void shell_surface_set_toplevel(wl_client* client, wl_resource* resource) { 875 void shell_surface_set_toplevel(wl_client* client, wl_resource* resource) {
876 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 876 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
877 if (shell_surface->enabled()) 877 if (shell_surface->enabled())
878 return; 878 return;
879 879
880 shell_surface->SetFrame(true); 880 shell_surface->SetFrame(true);
881 shell_surface->SetRectangularShadow(true); 881 shell_surface->SetRectangularShadowEnabled(true);
882 shell_surface->SetEnabled(true); 882 shell_surface->SetEnabled(true);
883 } 883 }
884 884
885 void shell_surface_set_transient(wl_client* client, 885 void shell_surface_set_transient(wl_client* client,
886 wl_resource* resource, 886 wl_resource* resource,
887 wl_resource* parent_resource, 887 wl_resource* parent_resource,
888 int x, 888 int x,
889 int y, 889 int y,
890 uint32_t flags) { 890 uint32_t flags) {
891 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 891 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 } 923 }
924 924
925 if (flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE) { 925 if (flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE) {
926 shell_surface->SetOrigin(origin); 926 shell_surface->SetOrigin(origin);
927 shell_surface->SetContainer(ash::kShellWindowId_SystemModalContainer); 927 shell_surface->SetContainer(ash::kShellWindowId_SystemModalContainer);
928 shell_surface->SetActivatable(false); 928 shell_surface->SetActivatable(false);
929 } else { 929 } else {
930 shell_surface->SetFrame(true); 930 shell_surface->SetFrame(true);
931 shell_surface->SetParent(parent_shell_surface); 931 shell_surface->SetParent(parent_shell_surface);
932 } 932 }
933 shell_surface->SetRectangularShadow(true); 933 shell_surface->SetRectangularShadowEnabled(true);
934 shell_surface->SetEnabled(true); 934 shell_surface->SetEnabled(true);
935 } 935 }
936 936
937 void shell_surface_set_fullscreen(wl_client* client, 937 void shell_surface_set_fullscreen(wl_client* client,
938 wl_resource* resource, 938 wl_resource* resource,
939 uint32_t method, 939 uint32_t method,
940 uint32_t framerate, 940 uint32_t framerate,
941 wl_resource* output_resource) { 941 wl_resource* output_resource) {
942 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 942 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
943 if (shell_surface->enabled()) 943 if (shell_surface->enabled())
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 GetUserDataAs<ShellSurface>(resource)->SetGeometry( 1881 GetUserDataAs<ShellSurface>(resource)->SetGeometry(
1882 gfx::Rect(x, y, width, height)); 1882 gfx::Rect(x, y, width, height));
1883 } 1883 }
1884 1884
1885 void remote_surface_set_scale(wl_client* client, 1885 void remote_surface_set_scale(wl_client* client,
1886 wl_resource* resource, 1886 wl_resource* resource,
1887 wl_fixed_t scale) { 1887 wl_fixed_t scale) {
1888 GetUserDataAs<ShellSurface>(resource)->SetScale(wl_fixed_to_double(scale)); 1888 GetUserDataAs<ShellSurface>(resource)->SetScale(wl_fixed_to_double(scale));
1889 } 1889 }
1890 1890
1891 void remote_surface_set_rectangular_shadow(wl_client* client, 1891 void remote_surface_set_rectangular_shadow_DEPRECATED(wl_client* client,
1892 wl_resource* resource, 1892 wl_resource* resource,
1893 int32_t x, 1893 int32_t x,
1894 int32_t y, 1894 int32_t y,
1895 int32_t width, 1895 int32_t width,
1896 int32_t height) { 1896 int32_t height) {
1897 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 1897 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
1898 gfx::Rect content_bounds(x, y, width, height); 1898 gfx::Rect content_bounds(x, y, width, height);
1899 1899 shell_surface->SetRectangularShadow_DEPRECATED(content_bounds);
1900 shell_surface->SetRectangularShadowContentBounds(content_bounds);
1901 shell_surface->SetRectangularShadow(!content_bounds.IsEmpty());
1902 } 1900 }
1903 1901
1904 void remote_surface_set_rectangular_shadow_background_opacity( 1902 void remote_surface_set_rectangular_shadow_background_opacity(
1905 wl_client* client, 1903 wl_client* client,
1906 wl_resource* resource, 1904 wl_resource* resource,
1907 wl_fixed_t opacity) { 1905 wl_fixed_t opacity) {
1908 GetUserDataAs<ShellSurface>(resource)->SetRectangularShadowBackgroundOpacity( 1906 GetUserDataAs<ShellSurface>(resource)->SetRectangularShadowBackgroundOpacity(
1909 wl_fixed_to_double(opacity)); 1907 wl_fixed_to_double(opacity));
1910 } 1908 }
1911 1909
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 1958
1961 void remote_surface_set_system_modal(wl_client* client, wl_resource* resource) { 1959 void remote_surface_set_system_modal(wl_client* client, wl_resource* resource) {
1962 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(true); 1960 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(true);
1963 } 1961 }
1964 1962
1965 void remote_surface_unset_system_modal(wl_client* client, 1963 void remote_surface_unset_system_modal(wl_client* client,
1966 wl_resource* resource) { 1964 wl_resource* resource) {
1967 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(false); 1965 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(false);
1968 } 1966 }
1969 1967
1968 void remote_surface_set_rectangular_surface_shadow(wl_client* client,
1969 wl_resource* resource,
1970 int32_t x,
1971 int32_t y,
1972 int32_t width,
1973 int32_t height) {
1974 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
1975 gfx::Rect content_bounds(x, y, width, height);
1976 shell_surface->SetRectangularSurfaceShadow(content_bounds);
1977 }
1978
1979 void remote_surface_ack_configure(wl_client* client,
1980 wl_resource* resource,
1981 uint32_t serial) {
1982 NOTIMPLEMENTED();
1983 }
1984
1985 void remote_surface_set_moving(wl_client* client, wl_resource* resource) {
1986 NOTIMPLEMENTED();
1987 }
1988
1989 void remote_surface_unset_moving(wl_client* client, wl_resource* resource) {
1990 NOTIMPLEMENTED();
1991 }
1992
1970 const struct zcr_remote_surface_v1_interface remote_surface_implementation = { 1993 const struct zcr_remote_surface_v1_interface remote_surface_implementation = {
1971 remote_surface_destroy, 1994 remote_surface_destroy,
1972 remote_surface_set_app_id, 1995 remote_surface_set_app_id,
1973 remote_surface_set_window_geometry, 1996 remote_surface_set_window_geometry,
1974 remote_surface_set_scale, 1997 remote_surface_set_scale,
1975 remote_surface_set_rectangular_shadow, 1998 remote_surface_set_rectangular_shadow_DEPRECATED,
1976 remote_surface_set_rectangular_shadow_background_opacity, 1999 remote_surface_set_rectangular_shadow_background_opacity,
1977 remote_surface_set_title, 2000 remote_surface_set_title,
1978 remote_surface_set_top_inset, 2001 remote_surface_set_top_inset,
1979 remote_surface_activate, 2002 remote_surface_activate,
1980 remote_surface_maximize, 2003 remote_surface_maximize,
1981 remote_surface_minimize, 2004 remote_surface_minimize,
1982 remote_surface_restore, 2005 remote_surface_restore,
1983 remote_surface_fullscreen, 2006 remote_surface_fullscreen,
1984 remote_surface_unfullscreen, 2007 remote_surface_unfullscreen,
1985 remote_surface_pin, 2008 remote_surface_pin,
1986 remote_surface_unpin, 2009 remote_surface_unpin,
1987 remote_surface_set_system_modal, 2010 remote_surface_set_system_modal,
1988 remote_surface_unset_system_modal}; 2011 remote_surface_unset_system_modal,
2012 remote_surface_set_rectangular_surface_shadow,
2013 remote_surface_ack_configure,
2014 remote_surface_set_moving,
2015 remote_surface_unset_moving};
1989 2016
1990 //////////////////////////////////////////////////////////////////////////////// 2017 ////////////////////////////////////////////////////////////////////////////////
1991 // notification_surface_interface: 2018 // notification_surface_interface:
1992 2019
1993 void notification_surface_destroy(wl_client* client, wl_resource* resource) { 2020 void notification_surface_destroy(wl_client* client, wl_resource* resource) {
1994 wl_resource_destroy(resource); 2021 wl_resource_destroy(resource);
1995 } 2022 }
1996 2023
1997 const struct zcr_notification_surface_v1_interface 2024 const struct zcr_notification_surface_v1_interface
1998 notification_surface_implementation = {notification_surface_destroy}; 2025 notification_surface_implementation = {notification_surface_destroy};
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 wl_resource_get_version(resource), id); 2292 wl_resource_get_version(resource), id);
2266 SetImplementation(notification_surface_resource, 2293 SetImplementation(notification_surface_resource,
2267 &notification_surface_implementation, 2294 &notification_surface_implementation,
2268 std::move(notification_surface)); 2295 std::move(notification_surface));
2269 } 2296 }
2270 2297
2271 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { 2298 const struct zcr_remote_shell_v1_interface remote_shell_implementation = {
2272 remote_shell_destroy, remote_shell_get_remote_surface, 2299 remote_shell_destroy, remote_shell_get_remote_surface,
2273 remote_shell_get_notification_surface}; 2300 remote_shell_get_notification_surface};
2274 2301
2275 const uint32_t remote_shell_version = 1; 2302 const uint32_t remote_shell_version = 2;
2276 2303
2277 void bind_remote_shell(wl_client* client, 2304 void bind_remote_shell(wl_client* client,
2278 void* data, 2305 void* data,
2279 uint32_t version, 2306 uint32_t version,
2280 uint32_t id) { 2307 uint32_t id) {
2281 wl_resource* resource = 2308 wl_resource* resource =
2282 wl_resource_create(client, &zcr_remote_shell_v1_interface, 2309 wl_resource_create(client, &zcr_remote_shell_v1_interface,
2283 std::min(version, remote_shell_version), id); 2310 std::min(version, remote_shell_version), id);
2284 2311
2285 SetImplementation(resource, &remote_shell_implementation, 2312 SetImplementation(resource, &remote_shell_implementation,
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3722 DCHECK(event_loop); 3749 DCHECK(event_loop);
3723 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3750 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3724 } 3751 }
3725 3752
3726 void Server::Flush() { 3753 void Server::Flush() {
3727 wl_display_flush_clients(wl_display_.get()); 3754 wl_display_flush_clients(wl_display_.get());
3728 } 3755 }
3729 3756
3730 } // namespace wayland 3757 } // namespace wayland
3731 } // namespace exo 3758 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698