Normalize indentation

This commit is contained in:
Drew DeVault 2015-11-18 08:44:08 -05:00
parent 9a1e95b7da
commit 665d4baaf1
2 changed files with 57 additions and 57 deletions

View file

@ -8,36 +8,36 @@
#include "list.h" #include "list.h"
struct output_state { struct output_state {
struct wl_output *output; struct wl_output *output;
uint32_t flags; uint32_t flags;
uint32_t width, height; uint32_t width, height;
}; };
struct buffer { struct buffer {
struct wl_buffer *buffer; struct wl_buffer *buffer;
int fd; int fd;
cairo_surface_t *surface; cairo_surface_t *surface;
cairo_t *cairo; cairo_t *cairo;
PangoContext *pango; PangoContext *pango;
uint32_t width, height; uint32_t width, height;
bool busy; bool busy;
}; };
struct client_state { struct client_state {
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_display *display; struct wl_display *display;
struct wl_pointer *pointer; struct wl_pointer *pointer;
struct wl_seat *seat; struct wl_seat *seat;
struct wl_shell *shell; struct wl_shell *shell;
struct wl_shm *shm; struct wl_shm *shm;
struct buffer buffers[2]; struct buffer buffers[2];
struct buffer *buffer; struct buffer *buffer;
struct wl_surface *surface; struct wl_surface *surface;
struct wl_shell_surface *shell_surface; struct wl_shell_surface *shell_surface;
struct wl_callback *frame_cb; struct wl_callback *frame_cb;
uint32_t width, height; uint32_t width, height;
cairo_t *cairo; cairo_t *cairo;
list_t *outputs; list_t *outputs;
}; };
struct client_state *client_setup(uint32_t width, uint32_t height); struct client_state *client_setup(uint32_t width, uint32_t height);

View file

@ -75,44 +75,44 @@ static struct buffer *create_buffer(struct client_state *state, struct buffer *b
} }
static void destroy_buffer(struct buffer *buffer) { static void destroy_buffer(struct buffer *buffer) {
if (buffer->buffer) { if (buffer->buffer) {
wl_buffer_destroy(buffer->buffer); wl_buffer_destroy(buffer->buffer);
} }
if (buffer->cairo) { if (buffer->cairo) {
cairo_destroy(buffer->cairo); cairo_destroy(buffer->cairo);
} }
if (buffer->surface) { if (buffer->surface) {
cairo_surface_destroy(buffer->surface); cairo_surface_destroy(buffer->surface);
} }
memset(buffer, 0, sizeof(struct buffer)); memset(buffer, 0, sizeof(struct buffer));
} }
struct buffer *get_next_buffer(struct client_state *state) { struct buffer *get_next_buffer(struct client_state *state) {
struct buffer *buffer = NULL; struct buffer *buffer = NULL;
int i; int i;
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
if (state->buffers[i].busy) { if (state->buffers[i].busy) {
continue; continue;
}
buffer = &state->buffers[i];
} }
buffer = &state->buffers[i];
}
if (!buffer) { if (!buffer) {
return NULL; return NULL;
}
if (buffer->width != state->width || buffer->height != state->height) {
destroy_buffer(buffer);
}
if (!buffer->buffer) {
if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) {
return NULL;
} }
}
if (buffer->width != state->width || buffer->height != state->height) {
state->cairo = buffer->cairo; destroy_buffer(buffer);
state->buffer = buffer; }
return buffer;
if (!buffer->buffer) {
if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) {
return NULL;
}
}
state->cairo = buffer->cairo;
state->buffer = buffer;
return buffer;
} }