SDL_Window* window = vd->windows;
Tizen_CursorData *data = calloc (1, sizeof (Tizen_CursorData));
- data->win_data = window->driverdata;
- cursor->driverdata = (void *) data;
-
- /* Assume ARGB8888 */
- SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
- SDL_assert(surface->pitch == surface->w * 4);
-
- /* Allocate shared memory buffer for this cursor */
- if (create_buffer_from_shm (data,
- surface->w,
- surface->h,
- WL_SHM_FORMAT_XRGB8888) < 0)
- {
- free (cursor->driverdata);
+ if(data) {
+ data->win_data = window->driverdata;
+ cursor->driverdata = (void *) data;
+
+ /* Assume ARGB8888 */
+ SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
+ SDL_assert(surface->pitch == surface->w * 4);
+
+ /* Allocate shared memory buffer for this cursor */
+ if (create_buffer_from_shm (data,
+ surface->w,
+ surface->h,
+ WL_SHM_FORMAT_XRGB8888) < 0)
+ {
+ free (cursor->driverdata);
+ free (cursor);
+ return NULL;
+ }
+
+ SDL_memcpy(data->shm_data,
+ surface->pixels,
+ surface->h * surface->pitch);
+
+ data->surface = wl_compositor_create_surface(ecore_wl_compositor_get());
+
+ data->hot_x = hot_x;
+ data->hot_y = hot_y;
+ data->w = surface->w;
+ data->h = surface->h;
+ }
+ else {
free (cursor);
return NULL;
}
-
- SDL_memcpy(data->shm_data,
- surface->pixels,
- surface->h * surface->pitch);
-
- data->surface = wl_compositor_create_surface(ecore_wl_compositor_get());
-
- data->hot_x = hot_x;
- data->hot_y = hot_y;
- data->w = surface->w;
- data->h = surface->h;
}
return cursor;
engine = getenv("SDL_ROTATION");
- if (engine)
- {
- if ((!strcasecmp(engine, "normal")))
- type = ROTATION_TYPE_NORMAL_ROTATION;
- else if ((!strcasecmp(engine, "pre_rotation")))
- type = ROTATION_TYPE_PRE_ROTATION;
- else
- type = ROTATION_TYPE_PRE_ROTATION;
- }
+ if (engine && (!strcasecmp(engine, "normal")))
+ type = ROTATION_TYPE_NORMAL_ROTATION;
+
checked = 1;
return type;
}