1
0
Fork 0

cogl: Use uint64_t for size params

As we are using a GParamSpecUint64 for that property
which makes it fail under 32bits platforms

Fixes: 6efd4a228 ("cogl/cleanup: Use construct-only properties for
CoglBuffer")
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3408

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3683>
This commit is contained in:
Bilal Elmoussaoui 2024-04-03 15:08:34 +02:00 committed by Marge Bot
parent bc72428a02
commit 260a8d92dc
6 changed files with 19 additions and 18 deletions

View file

@ -51,13 +51,13 @@ cogl_attribute_buffer_init (CoglAttributeBuffer *buffer)
CoglAttributeBuffer *
cogl_attribute_buffer_new_with_size (CoglContext *context,
size_t bytes)
size_t bytes)
{
CoglAttributeBuffer *buffer;
buffer = g_object_new (COGL_TYPE_ATTRIBUTE_BUFFER,
"context", context,
"size", bytes,
"size", (uint64_t) bytes,
"default-target", COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,
"update-hint", COGL_BUFFER_UPDATE_HINT_STATIC,
NULL);
@ -67,8 +67,8 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context,
size_t bytes,
const void *data)
size_t bytes,
const void *data)
{
CoglAttributeBuffer *buffer;

View file

@ -92,7 +92,7 @@ GType cogl_attribute_buffer_get_type (void) G_GNUC_CONST;
*/
COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new_with_size (CoglContext *context,
size_t bytes);
size_t bytes);
/**
* cogl_attribute_buffer_new:
@ -122,7 +122,7 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
*/
COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context,
size_t bytes,
const void *data);
size_t bytes,
const void *data);
G_END_DECLS

View file

@ -53,13 +53,14 @@ cogl_index_buffer_init (CoglIndexBuffer *buffer)
* indices buffer should be able to contain multiple ranges of indices
* which the wiki design doesn't currently consider. */
CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context, size_t bytes)
cogl_index_buffer_new (CoglContext *context,
size_t bytes)
{
CoglIndexBuffer *indices;
indices = g_object_new (COGL_TYPE_INDEX_BUFFER,
"context", context,
"size", bytes,
"size", (uint64_t) bytes,
"default-target", COGL_BUFFER_BIND_TARGET_INDEX_BUFFER,
"update-hint", COGL_BUFFER_UPDATE_HINT_STATIC,
NULL);

View file

@ -78,6 +78,6 @@ GType cogl_index_buffer_get_type (void) G_GNUC_CONST;
*/
COGL_EXPORT CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context,
size_t bytes);
size_t bytes);
G_END_DECLS

View file

@ -63,15 +63,15 @@ cogl_pixel_buffer_init (CoglPixelBuffer *buffer)
static CoglPixelBuffer *
_cogl_pixel_buffer_new (CoglContext *context,
size_t size,
const void *data,
GError **error)
size_t size,
const void *data,
GError **error)
{
CoglPixelBuffer *pixel_buffer;
pixel_buffer = g_object_new (COGL_TYPE_PIXEL_BUFFER,
"context", context,
"size", size,
"size", (uint64_t) size,
"default-target", COGL_BUFFER_BIND_TARGET_PIXEL_UNPACK,
"update-hint", COGL_BUFFER_UPDATE_HINT_STATIC,
NULL);
@ -94,8 +94,8 @@ _cogl_pixel_buffer_new (CoglContext *context,
CoglPixelBuffer *
cogl_pixel_buffer_new (CoglContext *context,
size_t size,
const void *data)
size_t size,
const void *data)
{
GError *ignore_error = NULL;
CoglPixelBuffer *buffer =

View file

@ -87,7 +87,7 @@ GType cogl_pixel_buffer_get_type (void) G_GNUC_CONST;
*/
COGL_EXPORT CoglPixelBuffer *
cogl_pixel_buffer_new (CoglContext *context,
size_t size,
const void *data);
size_t size,
const void *data);
G_END_DECLS