surface: Pass weston_surface_state into attach

attach needs to consider the viewport as well, so it makes more sense
for attach to consistently access the weston_surface_state, rather than
part from the surface and part from a function argument.

Signed-off-by: Daniel Stone <daniels@collabora.com>
diff --git a/libweston/compositor.c b/libweston/compositor.c
index a4b08be..df5b58f 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -2643,11 +2643,12 @@
 
 static enum weston_surface_status
 weston_surface_attach(struct weston_surface *surface,
-		      struct weston_buffer *buffer)
+		      struct weston_surface_state *state)
 {
-	struct weston_buffer_viewport *vp = &surface->buffer_viewport;
+	struct weston_buffer_viewport *vp = &state->buffer_viewport;
 	int32_t old_width = surface->width_from_buffer;
 	int32_t old_height = surface->height_from_buffer;
+	struct weston_buffer *buffer = state->buffer;
 	enum weston_surface_status status = WESTON_SURFACE_CLEAN;
 
 	if (!buffer) {
@@ -4052,7 +4053,7 @@
 		/* wp_presentation.feedback */
 		weston_presentation_feedback_discard_list(&surface->feedback_list);
 
-		status |= weston_surface_attach(surface, state->buffer);
+		status |= weston_surface_attach(surface, state);
 	}
 	weston_surface_state_set_buffer(state, NULL);
 	assert(state->acquire_fence_fd == -1);