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

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

Issue 2664403004: Use pixel coordinates for shadow underlay bounds (Closed)
Patch Set: update 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 } 1502 }
1503 1503
1504 void remote_surface_set_rectangular_shadow(wl_client* client, 1504 void remote_surface_set_rectangular_shadow(wl_client* client,
1505 wl_resource* resource, 1505 wl_resource* resource,
1506 int32_t x, 1506 int32_t x,
1507 int32_t y, 1507 int32_t y,
1508 int32_t width, 1508 int32_t width,
1509 int32_t height) { 1509 int32_t height) {
1510 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); 1510 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
1511 gfx::Rect content_bounds(x, y, width, height); 1511 gfx::Rect content_bounds(x, y, width, height);
1512 1512 shell_surface->set_shadow_underlay_in_shell_surface(false);
reveman 2017/02/03 02:22:18 We usually try to have the exo interface (ShellSur
oshima 2017/02/03 17:33:15 Done.
1513 shell_surface->SetRectangularShadowContentBounds(content_bounds); 1513 shell_surface->SetRectangularShadowContentBounds(content_bounds);
1514 shell_surface->SetRectangularShadow(!content_bounds.IsEmpty()); 1514 shell_surface->SetRectangularShadow(!content_bounds.IsEmpty());
1515 } 1515 }
1516 1516
1517 void remote_surface_set_rectangular_shadow_background_opacity( 1517 void remote_surface_set_rectangular_shadow_background_opacity(
1518 wl_client* client, 1518 wl_client* client,
1519 wl_resource* resource, 1519 wl_resource* resource,
1520 wl_fixed_t opacity) { 1520 wl_fixed_t opacity) {
1521 GetUserDataAs<ShellSurface>(resource)->SetRectangularShadowBackgroundOpacity( 1521 GetUserDataAs<ShellSurface>(resource)->SetRectangularShadowBackgroundOpacity(
1522 wl_fixed_to_double(opacity)); 1522 wl_fixed_to_double(opacity));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 1573
1574 void remote_surface_set_system_modal(wl_client* client, wl_resource* resource) { 1574 void remote_surface_set_system_modal(wl_client* client, wl_resource* resource) {
1575 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(true); 1575 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(true);
1576 } 1576 }
1577 1577
1578 void remote_surface_unset_system_modal(wl_client* client, 1578 void remote_surface_unset_system_modal(wl_client* client,
1579 wl_resource* resource) { 1579 wl_resource* resource) {
1580 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(false); 1580 GetUserDataAs<ShellSurface>(resource)->SetSystemModal(false);
1581 } 1581 }
1582 1582
1583 void remote_surface_set_rectangular_surface_shadow(wl_client* client,
1584 wl_resource* resource,
1585 int32_t x,
1586 int32_t y,
1587 int32_t width,
1588 int32_t height) {
1589 ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource);
1590 gfx::Rect content_bounds(x, y, width, height);
1591 shell_surface->SetRectangularShadowContentBounds(content_bounds);
1592 shell_surface->SetRectangularShadow(!content_bounds.IsEmpty());
1593 }
1594
1595 void remote_surface_empty_noarg(wl_client* client,
reveman 2017/02/03 02:22:18 Can you add stub functions with the correct names
oshima 2017/02/03 17:33:15 Done.
1596 wl_resource* resource) {
1597 }
1598
1583 const struct zcr_remote_surface_v1_interface remote_surface_implementation = { 1599 const struct zcr_remote_surface_v1_interface remote_surface_implementation = {
1584 remote_surface_destroy, 1600 remote_surface_destroy,
1585 remote_surface_set_app_id, 1601 remote_surface_set_app_id,
1586 remote_surface_set_window_geometry, 1602 remote_surface_set_window_geometry,
1587 remote_surface_set_scale, 1603 remote_surface_set_scale,
1588 remote_surface_set_rectangular_shadow, 1604 remote_surface_set_rectangular_shadow,
reveman 2017/02/03 02:22:18 Please change the name of remote_surface_set_recta
oshima 2017/02/03 17:33:16 Done.
1589 remote_surface_set_rectangular_shadow_background_opacity, 1605 remote_surface_set_rectangular_shadow_background_opacity,
1590 remote_surface_set_title, 1606 remote_surface_set_title,
1591 remote_surface_set_top_inset, 1607 remote_surface_set_top_inset,
1592 remote_surface_activate, 1608 remote_surface_activate,
1593 remote_surface_maximize, 1609 remote_surface_maximize,
1594 remote_surface_minimize, 1610 remote_surface_minimize,
1595 remote_surface_restore, 1611 remote_surface_restore,
1596 remote_surface_fullscreen, 1612 remote_surface_fullscreen,
1597 remote_surface_unfullscreen, 1613 remote_surface_unfullscreen,
1598 remote_surface_pin, 1614 remote_surface_pin,
1599 remote_surface_unpin, 1615 remote_surface_unpin,
1600 remote_surface_set_system_modal, 1616 remote_surface_set_system_modal,
1601 remote_surface_unset_system_modal}; 1617 remote_surface_unset_system_modal,
1618 remote_surface_empty_noarg,
1619 remote_surface_empty_noarg,
1620 remote_surface_set_rectangular_surface_shadow};
1602 1621
1603 //////////////////////////////////////////////////////////////////////////////// 1622 ////////////////////////////////////////////////////////////////////////////////
1604 // notification_surface_interface: 1623 // notification_surface_interface:
1605 1624
1606 void notification_surface_destroy(wl_client* client, wl_resource* resource) { 1625 void notification_surface_destroy(wl_client* client, wl_resource* resource) {
1607 wl_resource_destroy(resource); 1626 wl_resource_destroy(resource);
1608 } 1627 }
1609 1628
1610 const struct zcr_notification_surface_v1_interface 1629 const struct zcr_notification_surface_v1_interface
1611 notification_surface_implementation = {notification_surface_destroy}; 1630 notification_surface_implementation = {notification_surface_destroy};
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 wl_resource_get_version(resource), id); 1897 wl_resource_get_version(resource), id);
1879 SetImplementation(notification_surface_resource, 1898 SetImplementation(notification_surface_resource,
1880 &notification_surface_implementation, 1899 &notification_surface_implementation,
1881 std::move(notification_surface)); 1900 std::move(notification_surface));
1882 } 1901 }
1883 1902
1884 const struct zcr_remote_shell_v1_interface remote_shell_implementation = { 1903 const struct zcr_remote_shell_v1_interface remote_shell_implementation = {
1885 remote_shell_destroy, remote_shell_get_remote_surface, 1904 remote_shell_destroy, remote_shell_get_remote_surface,
1886 remote_shell_get_notification_surface}; 1905 remote_shell_get_notification_surface};
1887 1906
1888 const uint32_t remote_shell_version = 1; 1907 const uint32_t remote_shell_version = 3;
1889 1908
1890 void bind_remote_shell(wl_client* client, 1909 void bind_remote_shell(wl_client* client,
1891 void* data, 1910 void* data,
1892 uint32_t version, 1911 uint32_t version,
1893 uint32_t id) { 1912 uint32_t id) {
1894 wl_resource* resource = 1913 wl_resource* resource =
1895 wl_resource_create(client, &zcr_remote_shell_v1_interface, 1914 wl_resource_create(client, &zcr_remote_shell_v1_interface,
1896 std::min(version, remote_shell_version), id); 1915 std::min(version, remote_shell_version), id);
1897 1916
1898 SetImplementation(resource, &remote_shell_implementation, 1917 SetImplementation(resource, &remote_shell_implementation,
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3333 DCHECK(event_loop); 3352 DCHECK(event_loop);
3334 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3353 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3335 } 3354 }
3336 3355
3337 void Server::Flush() { 3356 void Server::Flush() {
3338 wl_display_flush_clients(wl_display_.get()); 3357 wl_display_flush_clients(wl_display_.get());
3339 } 3358 }
3340 3359
3341 } // namespace wayland 3360 } // namespace wayland
3342 } // namespace exo 3361 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698