diff --git a/cogl/cogl/cogl-color-private.h b/cogl/cogl/cogl-color-private.h deleted file mode 100644 index 3dfe862bf..000000000 --- a/cogl/cogl/cogl-color-private.h +++ /dev/null @@ -1,48 +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-color.h" - -#include - -/* cogl-pipeline.c wants to be able to hash CoglColor data so it needs - * the exact data size to be able to avoid reading the padding bytes. - */ -#define _COGL_COLOR_DATA_SIZE 4 - -void -_cogl_color_get_rgba_4ubv (const CoglColor *color, - uint8_t *dest); - diff --git a/cogl/cogl/cogl-color.c b/cogl/cogl/cogl-color.c index 793b015b1..1b7b2d729 100644 --- a/cogl/cogl/cogl-color.c +++ b/cogl/cogl/cogl-color.c @@ -34,7 +34,6 @@ #include "cogl/cogl-util.h" #include "cogl/cogl-color.h" -#include "cogl/cogl-color-private.h" static void cogl_value_transform_color_string (const GValue *src, @@ -430,13 +429,6 @@ cogl_color_hash (gconstpointer v) color->red << 24); } -void -_cogl_color_get_rgba_4ubv (const CoglColor *color, - uint8_t *dest) -{ - memcpy (dest, color, 4); -} - void cogl_color_to_hsl (const CoglColor *color, float *hue, diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c index fa67358d9..f4651bac1 100644 --- a/cogl/cogl/cogl-journal.c +++ b/cogl/cogl/cogl-journal.c @@ -1526,7 +1526,7 @@ _cogl_journal_log_quad (CoglJournal *journal, int next_entry; uint32_t disable_layers; CoglJournalEntry *entry; - CoglPipeline *final_pipeline; + CoglPipeline *final_pipeline, *color_authority; CoglClipStack *clip_stack; CoglPipelineFlushOptions flush_options; CoglMatrixStack *modelview_stack; @@ -1561,7 +1561,9 @@ _cogl_journal_log_quad (CoglJournal *journal, /* FIXME: This is a hacky optimization, since it will break if we * change the definition of CoglColor: */ - _cogl_pipeline_get_colorubv (pipeline, (uint8_t *) v); + color_authority = _cogl_pipeline_get_authority (pipeline, + COGL_PIPELINE_STATE_COLOR); + memcpy ((uint8_t *) v, &color_authority->color, sizeof (CoglColor)); v++; memcpy (v, position, sizeof (float) * 2); diff --git a/cogl/cogl/cogl-pipeline-private.h b/cogl/cogl/cogl-pipeline-private.h index 7a6bffac5..f36cba22d 100644 --- a/cogl/cogl/cogl-pipeline-private.h +++ b/cogl/cogl/cogl-pipeline-private.h @@ -669,10 +669,6 @@ _cogl_pipeline_weak_copy (CoglPipeline *pipeline, CoglPipelineDestroyCallback callback, void *user_data); -void -_cogl_pipeline_get_colorubv (CoglPipeline *pipeline, - uint8_t *color); - /* XXX: At some point it could be good for this to accept a mask of * the state groups we are interested in comparing since we can * probably use that information in a number situations to reduce diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c index 2e879fbdc..102cf922e 100644 --- a/cogl/cogl/cogl-pipeline-state.c +++ b/cogl/cogl/cogl-pipeline-state.c @@ -34,7 +34,7 @@ #include "config.h" #include "cogl/cogl-context-private.h" -#include "cogl/cogl-color-private.h" +#include "cogl/cogl-color.h" #include "cogl/cogl-blend-string.h" #include "cogl/cogl-util.h" #include "cogl/cogl-depth-state-private.h" @@ -328,17 +328,6 @@ cogl_pipeline_get_color (CoglPipeline *pipeline, *color = authority->color; } -/* This is used heavily by the cogl journal when logging quads */ -void -_cogl_pipeline_get_colorubv (CoglPipeline *pipeline, - uint8_t *color) -{ - CoglPipeline *authority = - _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_COLOR); - - _cogl_color_get_rgba_4ubv (&authority->color, color); -} - void cogl_pipeline_set_color (CoglPipeline *pipeline, const CoglColor *color) @@ -1248,7 +1237,7 @@ _cogl_pipeline_hash_color_state (CoglPipeline *authority, CoglPipelineHashState *state) { state->hash = _cogl_util_one_at_a_time_hash (state->hash, &authority->color, - _COGL_COLOR_DATA_SIZE); + sizeof (CoglColor)); } void diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c index f5a48b9f4..fcd2580d5 100644 --- a/cogl/cogl/cogl-pipeline.c +++ b/cogl/cogl/cogl-pipeline.c @@ -41,7 +41,7 @@ #include "cogl/cogl-texture-private.h" #include "cogl/cogl-blend-string.h" #include "cogl/cogl-journal-private.h" -#include "cogl/cogl-color-private.h" +#include "cogl/cogl-color.h" #include "cogl/cogl-util.h" #include "cogl/cogl-profile.h" #include "cogl/cogl-depth-state-private.h" diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index c1b79c798..443605e9a 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -170,7 +170,6 @@ cogl_sources = [ 'cogl-clip-stack.h', 'cogl-closure-list-private.h', 'cogl-closure-list.c', - 'cogl-color-private.h', 'cogl-color.c', 'cogl-context-private.h', 'cogl-context.c',