forked from AuroraMiddleware/gtk
csscolorvalue: check for singletons in new_literal
Gets rid of another ~400 GtkCssValue instances in the widget-factory.
This commit is contained in:
parent
0b2a6e34c4
commit
96143548ac
@ -507,6 +507,12 @@ _gtk_css_color_value_new_literal (const GdkRGBA *color)
|
|||||||
|
|
||||||
g_return_val_if_fail (color != NULL, NULL);
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
|
||||||
|
if (gdk_rgba_equal (color, &white_singleton.sym_col.rgba))
|
||||||
|
return _gtk_css_value_ref (&white_singleton);
|
||||||
|
|
||||||
|
if (gdk_rgba_equal (color, &transparent_black_singleton.sym_col.rgba))
|
||||||
|
return _gtk_css_value_ref (&transparent_black_singleton);
|
||||||
|
|
||||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||||
value->type = COLOR_TYPE_LITERAL;
|
value->type = COLOR_TYPE_LITERAL;
|
||||||
value->is_computed = TRUE;
|
value->is_computed = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user