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 * CoglAttributeBuffer *
cogl_attribute_buffer_new_with_size (CoglContext *context, cogl_attribute_buffer_new_with_size (CoglContext *context,
size_t bytes) size_t bytes)
{ {
CoglAttributeBuffer *buffer; CoglAttributeBuffer *buffer;
buffer = g_object_new (COGL_TYPE_ATTRIBUTE_BUFFER, buffer = g_object_new (COGL_TYPE_ATTRIBUTE_BUFFER,
"context", context, "context", context,
"size", bytes, "size", (uint64_t) bytes,
"default-target", COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER, "default-target", COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,
"update-hint", COGL_BUFFER_UPDATE_HINT_STATIC, "update-hint", COGL_BUFFER_UPDATE_HINT_STATIC,
NULL); NULL);
@ -67,8 +67,8 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
CoglAttributeBuffer * CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context, cogl_attribute_buffer_new (CoglContext *context,
size_t bytes, size_t bytes,
const void *data) const void *data)
{ {
CoglAttributeBuffer *buffer; CoglAttributeBuffer *buffer;

View File

@ -92,7 +92,7 @@ GType cogl_attribute_buffer_get_type (void) G_GNUC_CONST;
*/ */
COGL_EXPORT CoglAttributeBuffer * COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new_with_size (CoglContext *context, cogl_attribute_buffer_new_with_size (CoglContext *context,
size_t bytes); size_t bytes);
/** /**
* cogl_attribute_buffer_new: * cogl_attribute_buffer_new:
@ -122,7 +122,7 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
*/ */
COGL_EXPORT CoglAttributeBuffer * COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context, cogl_attribute_buffer_new (CoglContext *context,
size_t bytes, size_t bytes,
const void *data); const void *data);
G_END_DECLS 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 * indices buffer should be able to contain multiple ranges of indices
* which the wiki design doesn't currently consider. */ * which the wiki design doesn't currently consider. */
CoglIndexBuffer * CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context, size_t bytes) cogl_index_buffer_new (CoglContext *context,
size_t bytes)
{ {
CoglIndexBuffer *indices; CoglIndexBuffer *indices;
indices = g_object_new (COGL_TYPE_INDEX_BUFFER, indices = g_object_new (COGL_TYPE_INDEX_BUFFER,
"context", context, "context", context,
"size", bytes, "size", (uint64_t) bytes,
"default-target", COGL_BUFFER_BIND_TARGET_INDEX_BUFFER, "default-target", COGL_BUFFER_BIND_TARGET_INDEX_BUFFER,
"update-hint", COGL_BUFFER_UPDATE_HINT_STATIC, "update-hint", COGL_BUFFER_UPDATE_HINT_STATIC,
NULL); NULL);

View File

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

View File

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

View File

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