[gimp] app: lose "default" from protected GimpViewRenderer rendering API
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: lose "default" from protected GimpViewRenderer rendering API
- Date: Tue, 8 Mar 2011 16:13:29 +0000 (UTC)
commit b1d6f1b0fd9a240f2500e4ac4cc7485ea82c0e6c
Author: Michael Natterer <mitch gimp org>
Date: Tue Mar 8 17:12:39 2011 +0100
app: lose "default" from protected GimpViewRenderer rendering API
and rename render_surface() to render_temp_buf().
app/widgets/gimpviewrenderer.c | 139 ++++++++++++++++---------------
app/widgets/gimpviewrenderer.h | 11 +--
app/widgets/gimpviewrendererbrush.c | 18 ++--
app/widgets/gimpviewrendererbuffer.c | 4 +-
app/widgets/gimpviewrendererdrawable.c | 8 +-
app/widgets/gimpviewrendererimage.c | 10 +-
app/widgets/gimpviewrendererimagefile.c | 2 +-
app/widgets/gimpviewrendererlayer.c | 2 +-
8 files changed, 97 insertions(+), 97 deletions(-)
---
diff --git a/app/widgets/gimpviewrenderer.c b/app/widgets/gimpviewrenderer.c
index fbe225f..1852e95 100644
--- a/app/widgets/gimpviewrenderer.c
+++ b/app/widgets/gimpviewrenderer.c
@@ -73,7 +73,7 @@ static cairo_pattern_t *
gimp_view_renderer_create_background (GimpViewRenderer *renderer,
GtkWidget *widget);
-static void gimp_view_render_to_surface (TempBuf *temp_buf,
+static void gimp_view_render_temp_buf_to_surface (TempBuf *temp_buf,
gint channel,
GimpViewBG inside_bg,
GimpViewBG outside_bg,
@@ -615,9 +615,9 @@ gimp_view_renderer_draw (GimpViewRenderer *renderer,
viewable_class = g_type_class_ref (renderer->viewable_type);
- gimp_view_renderer_default_render_stock (renderer,
- widget,
- viewable_class->default_stock_id);
+ gimp_view_renderer_render_stock (renderer,
+ widget,
+ viewable_class->default_stock_id);
g_type_class_unref (viewable_class);
@@ -766,12 +766,12 @@ gimp_view_renderer_real_render (GimpViewRenderer *renderer,
renderer->height);
if (temp_buf)
{
- gimp_view_renderer_default_render_surface (renderer, temp_buf);
+ gimp_view_renderer_render_temp_buf_simple (renderer, temp_buf);
return;
}
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
}
static void
@@ -789,7 +789,7 @@ gimp_view_renderer_size_changed (GimpViewRenderer *renderer,
/* protected functions */
void
-gimp_view_renderer_default_render_surface (GimpViewRenderer *renderer,
+gimp_view_renderer_render_temp_buf_simple (GimpViewRenderer *renderer,
TempBuf *temp_buf)
{
g_return_if_fail (GIMP_IS_VIEW_RENDERER (renderer));
@@ -801,15 +801,65 @@ gimp_view_renderer_default_render_surface (GimpViewRenderer *renderer,
if (temp_buf->height < renderer->height)
temp_buf->y = (renderer->height - temp_buf->height) / 2;
- gimp_view_renderer_render_surface (renderer, temp_buf, -1,
- GIMP_VIEW_BG_CHECKS,
- GIMP_VIEW_BG_WHITE);
+ gimp_view_renderer_render_temp_buf (renderer, temp_buf, -1,
+ GIMP_VIEW_BG_CHECKS,
+ GIMP_VIEW_BG_WHITE);
}
void
-gimp_view_renderer_default_render_stock (GimpViewRenderer *renderer,
- GtkWidget *widget,
- const gchar *stock_id)
+gimp_view_renderer_render_temp_buf (GimpViewRenderer *renderer,
+ TempBuf *temp_buf,
+ gint channel,
+ GimpViewBG inside_bg,
+ GimpViewBG outside_bg)
+{
+ if (renderer->pixbuf)
+ {
+ g_object_unref (renderer->pixbuf);
+ renderer->pixbuf = NULL;
+ }
+
+ if (! renderer->surface)
+ renderer->surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+ renderer->width,
+ renderer->height);
+
+ gimp_view_render_temp_buf_to_surface (temp_buf,
+ channel,
+ inside_bg,
+ outside_bg,
+ renderer->surface,
+ renderer->width,
+ renderer->height);
+
+ renderer->needs_render = FALSE;
+}
+
+
+void
+gimp_view_renderer_render_pixbuf (GimpViewRenderer *renderer,
+ GdkPixbuf *pixbuf)
+{
+ if (renderer->surface)
+ {
+ cairo_surface_destroy (renderer->surface);
+ renderer->surface = NULL;
+ }
+
+ g_object_ref (pixbuf);
+
+ if (renderer->pixbuf)
+ g_object_unref (renderer->pixbuf);
+
+ renderer->pixbuf = pixbuf;
+
+ renderer->needs_render = FALSE;
+}
+
+void
+gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
+ GtkWidget *widget,
+ const gchar *stock_id)
{
GdkPixbuf *pixbuf = NULL;
GtkIconSize icon_size;
@@ -865,43 +915,14 @@ gimp_view_renderer_default_render_stock (GimpViewRenderer *renderer,
renderer->needs_render = FALSE;
}
-void
-gimp_view_renderer_render_surface (GimpViewRenderer *renderer,
- TempBuf *temp_buf,
- gint channel,
- GimpViewBG inside_bg,
- GimpViewBG outside_bg)
-{
- if (renderer->pixbuf)
- {
- g_object_unref (renderer->pixbuf);
- renderer->pixbuf = NULL;
- }
-
- if (! renderer->surface)
- renderer->surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
- renderer->width,
- renderer->height);
-
- gimp_view_render_to_surface (temp_buf,
- channel,
- inside_bg,
- outside_bg,
- renderer->surface,
- renderer->width,
- renderer->height);
-
- renderer->needs_render = FALSE;
-}
-
static void
-gimp_view_render_to_surface (TempBuf *temp_buf,
- gint channel,
- GimpViewBG inside_bg,
- GimpViewBG outside_bg,
- cairo_surface_t *surface,
- gint dest_width,
- gint dest_height)
+gimp_view_render_temp_buf_to_surface (TempBuf *temp_buf,
+ gint channel,
+ GimpViewBG inside_bg,
+ GimpViewBG outside_bg,
+ cairo_surface_t *surface,
+ gint dest_width,
+ gint dest_height)
{
const guchar *src;
const guchar *pad_buf;
@@ -1088,26 +1109,6 @@ gimp_view_render_to_surface (TempBuf *temp_buf,
cairo_surface_mark_dirty (surface);
}
-void
-gimp_view_renderer_render_pixbuf (GimpViewRenderer *renderer,
- GdkPixbuf *pixbuf)
-{
- if (renderer->surface)
- {
- cairo_surface_destroy (renderer->surface);
- renderer->surface = NULL;
- }
-
- g_object_ref (pixbuf);
-
- if (renderer->pixbuf)
- g_object_unref (renderer->pixbuf);
-
- renderer->pixbuf = pixbuf;
-
- renderer->needs_render = FALSE;
-}
-
/* This function creates a background pattern from a stock icon
* if renderer->bg_stock_id is set.
*/
diff --git a/app/widgets/gimpviewrenderer.h b/app/widgets/gimpviewrenderer.h
index 9e1a430..ac451eb 100644
--- a/app/widgets/gimpviewrenderer.h
+++ b/app/widgets/gimpviewrenderer.h
@@ -140,19 +140,18 @@ void gimp_view_renderer_draw (GimpViewRenderer *renderer,
/* protected */
-void gimp_view_renderer_default_render_surface (GimpViewRenderer *renderer,
+void gimp_view_renderer_render_temp_buf_simple (GimpViewRenderer *renderer,
TempBuf *temp_buf);
-void gimp_view_renderer_default_render_stock (GimpViewRenderer *renderer,
- GtkWidget *widget,
- const gchar *stock_id);
-void gimp_view_renderer_render_surface (GimpViewRenderer *renderer,
+void gimp_view_renderer_render_temp_buf (GimpViewRenderer *renderer,
TempBuf *temp_buf,
gint channel,
GimpViewBG inside_bg,
GimpViewBG outside_bg);
-
void gimp_view_renderer_render_pixbuf (GimpViewRenderer *renderer,
GdkPixbuf *pixbuf);
+void gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
+ GtkWidget *widget,
+ const gchar *stock_id);
diff --git a/app/widgets/gimpviewrendererbrush.c b/app/widgets/gimpviewrendererbrush.c
index 01033a0..809f577 100644
--- a/app/widgets/gimpviewrendererbrush.c
+++ b/app/widgets/gimpviewrendererbrush.c
@@ -109,9 +109,9 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
if (renderer->is_popup)
{
- gimp_view_renderer_render_surface (renderer, temp_buf, -1,
- GIMP_VIEW_BG_WHITE,
- GIMP_VIEW_BG_WHITE);
+ gimp_view_renderer_render_temp_buf (renderer, temp_buf, -1,
+ GIMP_VIEW_BG_WHITE,
+ GIMP_VIEW_BG_WHITE);
temp_buf_free (temp_buf);
@@ -126,9 +126,9 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
return;
}
- gimp_view_renderer_render_surface (renderer, temp_buf, -1,
- GIMP_VIEW_BG_WHITE,
- GIMP_VIEW_BG_WHITE);
+ gimp_view_renderer_render_temp_buf (renderer, temp_buf, -1,
+ GIMP_VIEW_BG_WHITE,
+ GIMP_VIEW_BG_WHITE);
temp_buf_free (temp_buf);
}
@@ -171,9 +171,9 @@ gimp_view_renderer_brush_render_timeout (gpointer data)
if (temp_buf->height < renderer->height)
temp_buf->y = (renderer->height - temp_buf->height) / 2;
- gimp_view_renderer_render_surface (renderer, temp_buf, -1,
- GIMP_VIEW_BG_WHITE,
- GIMP_VIEW_BG_WHITE);
+ gimp_view_renderer_render_temp_buf (renderer, temp_buf, -1,
+ GIMP_VIEW_BG_WHITE,
+ GIMP_VIEW_BG_WHITE);
temp_buf_free (temp_buf);
diff --git a/app/widgets/gimpviewrendererbuffer.c b/app/widgets/gimpviewrendererbuffer.c
index 35efcde..2a783f5 100644
--- a/app/widgets/gimpviewrendererbuffer.c
+++ b/app/widgets/gimpviewrendererbuffer.c
@@ -102,7 +102,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
if (render_buf)
{
- gimp_view_renderer_default_render_surface (renderer, render_buf);
+ gimp_view_renderer_render_temp_buf_simple (renderer, render_buf);
temp_buf_free (render_buf);
}
@@ -112,6 +112,6 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
}
}
diff --git a/app/widgets/gimpviewrendererdrawable.c b/app/widgets/gimpviewrendererdrawable.c
index 6b47960..ad6885f 100644
--- a/app/widgets/gimpviewrendererdrawable.c
+++ b/app/widgets/gimpviewrendererdrawable.c
@@ -226,9 +226,9 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
render_buf->y = (height - view_height) / 2;
}
- gimp_view_renderer_render_surface (renderer, render_buf, -1,
- GIMP_VIEW_BG_CHECKS,
- GIMP_VIEW_BG_CHECKS);
+ gimp_view_renderer_render_temp_buf (renderer, render_buf, -1,
+ GIMP_VIEW_BG_CHECKS,
+ GIMP_VIEW_BG_CHECKS);
temp_buf_free (render_buf);
}
@@ -238,6 +238,6 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
}
}
diff --git a/app/widgets/gimpviewrendererimage.c b/app/widgets/gimpviewrendererimage.c
index 6edb6ff..24bb098 100644
--- a/app/widgets/gimpviewrendererimage.c
+++ b/app/widgets/gimpviewrendererimage.c
@@ -145,10 +145,10 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
component_index =
gimp_image_get_component_index (image, rendererimage->channel);
- gimp_view_renderer_render_surface (renderer, render_buf,
- component_index,
- GIMP_VIEW_BG_CHECKS,
- GIMP_VIEW_BG_WHITE);
+ gimp_view_renderer_render_temp_buf (renderer, render_buf,
+ component_index,
+ GIMP_VIEW_BG_CHECKS,
+ GIMP_VIEW_BG_WHITE);
temp_buf_free (render_buf);
@@ -170,5 +170,5 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
break;
}
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
}
diff --git a/app/widgets/gimpviewrendererimagefile.c b/app/widgets/gimpviewrendererimagefile.c
index 01e4ec4..bae6a93 100644
--- a/app/widgets/gimpviewrendererimagefile.c
+++ b/app/widgets/gimpviewrendererimagefile.c
@@ -89,7 +89,7 @@ gimp_view_renderer_imagefile_render (GimpViewRenderer *renderer,
{
const gchar *stock_id = gimp_viewable_get_stock_id (renderer->viewable);
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
}
}
diff --git a/app/widgets/gimpviewrendererlayer.c b/app/widgets/gimpviewrendererlayer.c
index 1ca7533..a37b085 100644
--- a/app/widgets/gimpviewrendererlayer.c
+++ b/app/widgets/gimpviewrendererlayer.c
@@ -80,7 +80,7 @@ gimp_view_renderer_layer_render (GimpViewRenderer *renderer,
}
if (stock_id)
- gimp_view_renderer_default_render_stock (renderer, widget, stock_id);
+ gimp_view_renderer_render_stock (renderer, widget, stock_id);
else
GIMP_VIEW_RENDERER_CLASS (parent_class)->render (renderer, widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]