gtk2/gtk/gtkthemingengineprivate.h
Jasper St. Pierre 9f2e0902f6 gtkcssshadowvalue: Don't double-apply the alpha to shadows
It turns out that when we were painting the shadows, we painted the them
with the base color once, which contained the alpha, and then blurred it
and used it as a mask for the fill, which has the fill again.

To fix this, always paint the base surface with full alpha. The existing
code applies the blur conditionally sometimes in weird ways, so the code
shuffling fix may not look correct, but be assured it is. If the blur
happens, the new cr we return has the *default* color applied, which is
fully opaque black, which works perfectly against the A8 surface.

The fallback spinner code needs some modification, since it is
intentionally using the alpha to paint the lobes which are "in the past".
Since we shouldn't be hitting this fallback path very often, we use a
temporary group and paint it with paint_with_alpha, even though it is
slow.
2014-08-02 18:58:19 -04:00

40 lines
1.5 KiB
C

/* GTK - The GIMP Toolkit
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_THEMING_ENGINE_PRIVATE_H__
#define __GTK_THEMING_ENGINE_PRIVATE_H__
#include <gdk/gdk.h>
#include "gtk/gtkthemingengine.h"
#include "gtk/gtkcssvalueprivate.h"
G_BEGIN_DECLS
void _gtk_theming_engine_paint_spinner (cairo_t *cr,
gdouble radius,
gdouble progress);
GtkCssValue *_gtk_theming_engine_peek_property (GtkThemingEngine *engine,
guint property_id);
void _gtk_theming_engine_set_context (GtkThemingEngine *engine,
GtkStyleContext *context);
GtkStyleContext *_gtk_theming_engine_get_context (GtkThemingEngine *engine);
G_END_DECLS
#endif /* __GTK_THEMING_ENGINE_PRIVATE_H__ */