| OLD | NEW |
| 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 <linux/input.h> | 7 #include <linux/input.h> |
| 8 #include <wayland-server-core.h> | 8 #include <wayland-server-core.h> |
| 9 #include <wayland-server-protocol-core.h> | 9 #include <wayland-server-protocol-core.h> |
| 10 #include <xdg-shell-unstable-v5-server-protocol.h> | 10 #include <xdg-shell-unstable-v5-server-protocol.h> |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 void surface_set_buffer_transform(wl_client* client, | 169 void surface_set_buffer_transform(wl_client* client, |
| 170 wl_resource* resource, | 170 wl_resource* resource, |
| 171 int transform) { | 171 int transform) { |
| 172 NOTIMPLEMENTED(); | 172 NOTIMPLEMENTED(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void surface_set_buffer_scale(wl_client* client, | 175 void surface_set_buffer_scale(wl_client* client, |
| 176 wl_resource* resource, | 176 wl_resource* resource, |
| 177 int32_t scale) { | 177 int32_t scale) { |
| 178 NOTIMPLEMENTED(); | 178 if (scale < 1) { |
| 179 wl_resource_post_error(resource, WL_SURFACE_ERROR_INVALID_SCALE, |
| 180 "buffer scale must be at least one " |
| 181 "('%d' specified)", |
| 182 scale); |
| 183 return; |
| 184 } |
| 185 |
| 186 GetUserDataAs<Surface>(resource)->SetBufferScale(scale); |
| 179 } | 187 } |
| 180 | 188 |
| 181 const struct wl_surface_interface surface_implementation = { | 189 const struct wl_surface_interface surface_implementation = { |
| 182 surface_destroy, | 190 surface_destroy, |
| 183 surface_attach, | 191 surface_attach, |
| 184 surface_damage, | 192 surface_damage, |
| 185 surface_frame, | 193 surface_frame, |
| 186 surface_set_opaque_region, | 194 surface_set_opaque_region, |
| 187 surface_set_input_region, | 195 surface_set_input_region, |
| 188 surface_commit, | 196 surface_commit, |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 DCHECK(event_loop); | 1450 DCHECK(event_loop); |
| 1443 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 1451 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 1444 } | 1452 } |
| 1445 | 1453 |
| 1446 void Server::Flush() { | 1454 void Server::Flush() { |
| 1447 wl_display_flush_clients(wl_display_.get()); | 1455 wl_display_flush_clients(wl_display_.get()); |
| 1448 } | 1456 } |
| 1449 | 1457 |
| 1450 } // namespace wayland | 1458 } // namespace wayland |
| 1451 } // namespace exo | 1459 } // namespace exo |
| OLD | NEW |