mirror of https://github.com/GNOME/gimp.git
app: use {begin,end}_render() and GimpTileHandlerProjectable ...
... in GimpProjection and gimp_display_shell_render() (the latter is not really necessary, but whatever.)
This commit is contained in:
parent
426bc371cd
commit
1c68617302
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include "gegl/gimp-babl.h"
|
#include "gegl/gimp-babl.h"
|
||||||
#include "gegl/gimp-gegl-utils.h"
|
#include "gegl/gimp-gegl-utils.h"
|
||||||
#include "gegl/gimptilehandlervalidate.h"
|
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimp-memsize.h"
|
#include "gimp-memsize.h"
|
||||||
|
@ -39,6 +38,7 @@
|
||||||
#include "gimppickable.h"
|
#include "gimppickable.h"
|
||||||
#include "gimpprojectable.h"
|
#include "gimpprojectable.h"
|
||||||
#include "gimpprojection.h"
|
#include "gimpprojection.h"
|
||||||
|
#include "gimptilehandlerprojectable.h"
|
||||||
|
|
||||||
#include "gimp-log.h"
|
#include "gimp-log.h"
|
||||||
#include "gimp-priorities.h"
|
#include "gimp-priorities.h"
|
||||||
|
@ -389,12 +389,10 @@ gimp_projection_get_buffer (GimpPickable *pickable)
|
||||||
|
|
||||||
if (! proj->priv->buffer)
|
if (! proj->priv->buffer)
|
||||||
{
|
{
|
||||||
GeglNode *graph;
|
|
||||||
const Babl *format;
|
const Babl *format;
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
|
|
||||||
graph = gimp_projectable_get_graph (proj->priv->projectable);
|
|
||||||
format = gimp_projection_get_format (GIMP_PICKABLE (proj));
|
format = gimp_projection_get_format (GIMP_PICKABLE (proj));
|
||||||
gimp_projectable_get_size (proj->priv->projectable, &width, &height);
|
gimp_projectable_get_size (proj->priv->projectable, &width, &height);
|
||||||
|
|
||||||
|
@ -402,7 +400,8 @@ gimp_projection_get_buffer (GimpPickable *pickable)
|
||||||
format);
|
format);
|
||||||
|
|
||||||
proj->priv->validate_handler =
|
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,
|
gimp_tile_handler_validate_assign (proj->priv->validate_handler,
|
||||||
proj->priv->buffer);
|
proj->priv->buffer);
|
||||||
|
@ -608,7 +607,11 @@ gimp_projection_finish_draw (GimpProjection *proj)
|
||||||
{
|
{
|
||||||
gimp_projection_chunk_render_stop (proj);
|
gimp_projection_chunk_render_stop (proj);
|
||||||
|
|
||||||
|
gimp_projectable_begin_render (proj->priv->projectable);
|
||||||
|
|
||||||
while (gimp_projection_chunk_render_iteration (proj));
|
while (gimp_projection_chunk_render_iteration (proj));
|
||||||
|
|
||||||
|
gimp_projectable_end_render (proj->priv->projectable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,6 +682,8 @@ gimp_projection_flush_whenever (GimpProjection *proj,
|
||||||
gint n_rects = cairo_region_num_rectangles (proj->priv->update_region);
|
gint n_rects = cairo_region_num_rectangles (proj->priv->update_region);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
gimp_projectable_begin_render (proj->priv->projectable);
|
||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
cairo_rectangle_int_t rect;
|
||||||
|
@ -693,6 +698,8 @@ gimp_projection_flush_whenever (GimpProjection *proj,
|
||||||
rect.width,
|
rect.width,
|
||||||
rect.height);
|
rect.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gimp_projectable_end_render (proj->priv->projectable);
|
||||||
}
|
}
|
||||||
else /* Asynchronous */
|
else /* Asynchronous */
|
||||||
{
|
{
|
||||||
|
@ -741,6 +748,8 @@ gimp_projection_chunk_render_callback (gpointer data)
|
||||||
gint chunks = 0;
|
gint chunks = 0;
|
||||||
gboolean retval = TRUE;
|
gboolean retval = TRUE;
|
||||||
|
|
||||||
|
gimp_projectable_begin_render (proj->priv->projectable);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (! gimp_projection_chunk_render_iteration (proj))
|
if (! gimp_projection_chunk_render_iteration (proj))
|
||||||
|
@ -756,6 +765,8 @@ gimp_projection_chunk_render_callback (gpointer data)
|
||||||
}
|
}
|
||||||
while (g_timer_elapsed (timer, NULL) < GIMP_PROJECTION_CHUNK_TIME);
|
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",
|
GIMP_LOG (PROJECTION, "%d chunks in %f seconds\n",
|
||||||
chunks, g_timer_elapsed (timer, NULL));
|
chunks, g_timer_elapsed (timer, NULL));
|
||||||
g_timer_destroy (timer);
|
g_timer_destroy (timer);
|
||||||
|
|
|
@ -89,6 +89,8 @@ gimp_display_shell_render (GimpDisplayShell *shell,
|
||||||
buffer = gimp_pickable_get_buffer (GIMP_PICKABLE (image));
|
buffer = gimp_pickable_get_buffer (GIMP_PICKABLE (image));
|
||||||
#ifdef USE_NODE_BLIT
|
#ifdef USE_NODE_BLIT
|
||||||
node = gimp_projectable_get_graph (GIMP_PROJECTABLE (image));
|
node = gimp_projectable_get_graph (GIMP_PROJECTABLE (image));
|
||||||
|
|
||||||
|
gimp_projectable_begin_render (GIMP_PROJECTABLE (image));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GIMP_DISPLAY_RENDER_ENABLE_SCALING
|
#ifdef GIMP_DISPLAY_RENDER_ENABLE_SCALING
|
||||||
|
@ -321,6 +323,10 @@ gimp_display_shell_render (GimpDisplayShell *shell,
|
||||||
|
|
||||||
g_object_unref (cairo_buffer);
|
g_object_unref (cairo_buffer);
|
||||||
|
|
||||||
|
#ifdef USE_NODE_BLIT
|
||||||
|
gimp_projectable_end_render (GIMP_PROJECTABLE (image));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (shell->mask)
|
if (shell->mask)
|
||||||
{
|
{
|
||||||
if (! shell->mask_surface)
|
if (! shell->mask_surface)
|
||||||
|
|
Loading…
Reference in New Issue