From 30ed9c05def50d1875b638c4f7b15396bd35a401 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sun, 20 Oct 2024 08:42:36 +0200 Subject: [PATCH] cogl/primitive: Mark as a final type Also removes a function declaration. Part-of: --- cogl/cogl/cogl-clip-stack.c | 1 - cogl/cogl/cogl-framebuffer.c | 1 - cogl/cogl/cogl-primitive-private.h | 57 ------------------------ cogl/cogl/cogl-primitive.c | 16 ++++++- cogl/cogl/driver/gl/cogl-clip-stack-gl.c | 1 - cogl/cogl/meson.build | 1 - 6 files changed, 14 insertions(+), 63 deletions(-) delete mode 100644 cogl/cogl/cogl-primitive-private.h diff --git a/cogl/cogl/cogl-clip-stack.c b/cogl/cogl/cogl-clip-stack.c index 7be177ee9..e59c04530 100644 --- a/cogl/cogl/cogl-clip-stack.c +++ b/cogl/cogl/cogl-clip-stack.c @@ -44,7 +44,6 @@ #include "cogl/cogl-primitives-private.h" #include "cogl/cogl-private.h" #include "cogl/cogl-attribute-private.h" -#include "cogl/cogl-primitive-private.h" #include "cogl/cogl-offscreen.h" #include "cogl/cogl-matrix-stack.h" #include "mtk/mtk.h" diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c index 88fb364db..3aa950820 100644 --- a/cogl/cogl/cogl-framebuffer.c +++ b/cogl/cogl/cogl-framebuffer.c @@ -43,7 +43,6 @@ #include "cogl/cogl-clip-stack.h" #include "cogl/cogl-journal-private.h" #include "cogl/cogl-pipeline-state-private.h" -#include "cogl/cogl-primitive-private.h" #include "cogl/cogl-offscreen.h" #include "cogl/cogl-private.h" #include "cogl/cogl-primitives-private.h" diff --git a/cogl/cogl/cogl-primitive-private.h b/cogl/cogl/cogl-primitive-private.h deleted file mode 100644 index f2b99d5e5..000000000 --- a/cogl/cogl/cogl-primitive-private.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2010 Intel Corporation. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * - * - * Authors: - * Robert Bragg - */ - -#pragma once - -#include "cogl/cogl-attribute-buffer-private.h" -#include "cogl/cogl-attribute-private.h" -#include "cogl/cogl-framebuffer.h" - -struct _CoglPrimitive -{ - GObject parent_instance; - - CoglIndices *indices; - CoglVerticesMode mode; - int first_vertex; - int n_vertices; - - GPtrArray *attributes; - int n_attributes; -}; - -void -_cogl_primitive_draw (CoglPrimitive *primitive, - CoglFramebuffer *framebuffer, - CoglPipeline *pipeline, - CoglDrawFlags flags); diff --git a/cogl/cogl/cogl-primitive.c b/cogl/cogl/cogl-primitive.c index edc266355..aa340162f 100644 --- a/cogl/cogl/cogl-primitive.c +++ b/cogl/cogl/cogl-primitive.c @@ -35,14 +35,26 @@ #include "cogl/cogl-util.h" #include "cogl/cogl-primitive.h" -#include "cogl/cogl-primitive-private.h" #include "cogl/cogl-attribute-private.h" #include "cogl/cogl-framebuffer-private.h" #include #include -G_DEFINE_TYPE (CoglPrimitive, cogl_primitive, G_TYPE_OBJECT); +typedef struct _CoglPrimitive +{ + GObject parent_instance; + + CoglIndices *indices; + CoglVerticesMode mode; + int first_vertex; + int n_vertices; + + GPtrArray *attributes; + int n_attributes; +} CoglPrimitive; + +G_DEFINE_FINAL_TYPE (CoglPrimitive, cogl_primitive, G_TYPE_OBJECT); static void cogl_primitive_dispose (GObject *object) diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c index 63e27f017..79efd1a61 100644 --- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c +++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c @@ -38,7 +38,6 @@ #include "cogl/cogl-context-private.h" #include "cogl/cogl-graphene.h" #include "cogl/cogl-primitives-private.h" -#include "cogl/cogl-primitive-private.h" #include "cogl/driver/gl/cogl-util-gl-private.h" #include "cogl/driver/gl/cogl-pipeline-opengl-private.h" #include "cogl/driver/gl/cogl-clip-stack-gl-private.h" diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index c29dca724..b9e333b55 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -238,7 +238,6 @@ cogl_sources = [ 'cogl-pixel-format.c', 'cogl-point-in-poly-private.h', 'cogl-point-in-poly.c', - 'cogl-primitive-private.h', 'cogl-primitive.c', 'cogl-primitives-private.h', 'cogl-primitives.c',