[gimp/wip/passthrough: 23/26] app: use {begin, end}_render() and GimpTileHandlerProjectable ...
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/passthrough: 23/26] app: use {begin, end}_render() and GimpTileHandlerProjectable ...
- Date: Tue, 2 May 2017 15:14:56 +0000 (UTC)
commit ee0d252ba73808514abfddc05825b88e816635ea
Author: Ell <ell_se yahoo com>
Date: Sat Apr 22 14:22:06 2017 -0400
app: use {begin,end}_render() and GimpTileHandlerProjectable ...
... in GimpProjection and gimp_display_shell_render() (the latter
is not really necessary, but whatever.)
app/core/gimpprojection.c | 19 +++++++++++++++----
app/display/gimpdisplayshell-render.c | 6 ++++++
2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 58bb61b..7d98ed8 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -30,7 +30,6 @@
#include "gegl/gimp-babl.h"
#include "gegl/gimp-gegl-utils.h"
-#include "gegl/gimptilehandlervalidate.h"
#include "gimp.h"
#include "gimp-memsize.h"
@@ -39,6 +38,7 @@
#include "gimppickable.h"
#include "gimpprojectable.h"
#include "gimpprojection.h"
+#include "gimptilehandlerprojectable.h"
#include "gimp-log.h"
#include "gimp-priorities.h"
@@ -389,12 +389,10 @@ gimp_projection_get_buffer (GimpPickable *pickable)
if (! proj->priv->buffer)
{
- GeglNode *graph;
const Babl *format;
gint width;
gint height;
- graph = gimp_projectable_get_graph (proj->priv->projectable);
format = gimp_projection_get_format (GIMP_PICKABLE (proj));
gimp_projectable_get_size (proj->priv->projectable, &width, &height);
@@ -402,7 +400,8 @@ gimp_projection_get_buffer (GimpPickable *pickable)
format);
proj->priv->validate_handler =
- GIMP_TILE_HANDLER_VALIDATE (gimp_tile_handler_validate_new (graph));
+ GIMP_TILE_HANDLER_VALIDATE (
+ gimp_tile_handler_projectable_new (proj->priv->projectable));
gimp_tile_handler_validate_assign (proj->priv->validate_handler,
proj->priv->buffer);
@@ -609,7 +608,11 @@ gimp_projection_finish_draw (GimpProjection *proj)
{
gimp_projection_chunk_render_stop (proj);
+ gimp_projectable_begin_render (proj->priv->projectable);
+
while (gimp_projection_chunk_render_iteration (proj));
+
+ gimp_projectable_end_render (proj->priv->projectable);
}
}
@@ -694,6 +697,8 @@ gimp_projection_flush_whenever (GimpProjection *proj,
gint n_rects = cairo_region_num_rectangles (proj->priv->update_region);
gint i;
+ gimp_projectable_begin_render (proj->priv->projectable);
+
for (i = 0; i < n_rects; i++)
{
cairo_rectangle_int_t rect;
@@ -708,6 +713,8 @@ gimp_projection_flush_whenever (GimpProjection *proj,
rect.width,
rect.height);
}
+
+ gimp_projectable_end_render (proj->priv->projectable);
}
else /* Asynchronous */
{
@@ -757,6 +764,8 @@ gimp_projection_chunk_render_callback (gpointer data)
gint chunks = 0;
gboolean retval = TRUE;
+ gimp_projectable_begin_render (proj->priv->projectable);
+
do
{
if (! gimp_projection_chunk_render_iteration (proj))
@@ -772,6 +781,8 @@ gimp_projection_chunk_render_callback (gpointer data)
}
while (g_timer_elapsed (timer, NULL) < GIMP_PROJECTION_CHUNK_TIME);
+ gimp_projectable_end_render (proj->priv->projectable);
+
GIMP_LOG (PROJECTION, "%d chunks in %f seconds\n",
chunks, g_timer_elapsed (timer, NULL));
g_timer_destroy (timer);
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index f59e0e5..399aa37 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -89,6 +89,8 @@ gimp_display_shell_render (GimpDisplayShell *shell,
buffer = gimp_pickable_get_buffer (GIMP_PICKABLE (image));
#ifdef USE_NODE_BLIT
node = gimp_projectable_get_graph (GIMP_PROJECTABLE (image));
+
+ gimp_projectable_begin_render (GIMP_PROJECTABLE (image));
#endif
#ifdef GIMP_DISPLAY_RENDER_ENABLE_SCALING
@@ -321,6 +323,10 @@ gimp_display_shell_render (GimpDisplayShell *shell,
g_object_unref (cairo_buffer);
+#ifdef USE_NODE_BLIT
+ gimp_projectable_end_render (GIMP_PROJECTABLE (image));
+#endif
+
if (shell->mask)
{
if (! shell->mask_surface)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]