From 0a7bcee76abd2190abf30196d21641b2d799e2fc Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 24 Sep 2007 23:25:10 +0000 Subject: [PATCH] Fix 1800783: "motion blur doesn't work on encapsulated layers". As before, but consider motion blur even for PasteCanvas layers without a sub canvas. git-svn-id: http://svn.voria.com/code@749 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/canvas.cpp | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp index e5b8ab7..739cf7e 100644 --- a/synfig-core/trunk/src/synfig/canvas.cpp +++ b/synfig-core/trunk/src/synfig/canvas.cpp @@ -1082,31 +1082,31 @@ synfig::optimize_layers(Context context, Canvas::Handle op_canvas, bool seen_mot Layer_PasteCanvas* paste_canvas(static_cast(layer.get())); if(layer->get_name()=="PasteCanvas" && paste_canvas->get_time_offset()==0) { - Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas)); - Canvas::Handle paste_sub_canvas = paste_canvas->get_sub_canvas(); - if(paste_sub_canvas) - { - // we need to blur the sub canvas if: - // our parent is blurred, - // or the child is lower than a local blur, - // or the child is at the same z_depth as a local blur, but later in the context + // we need to blur the sub canvas if: + // our parent is blurred, + // or the child is lower than a local blur, + // or the child is at the same z_depth as a local blur, but later in the context + #if 0 // DEBUG - if (seen_motion_blur_in_parent) synfig::info("seen BLUR in parent\n"); - else if (seen_motion_blur_locally) - if (z_depth > motion_blur_z_depth) synfig::info("paste is deeper than BLUR\n"); - else if (z_depth == motion_blur_z_depth) { synfig::info("paste is same depth as BLUR\n"); - if (i > motion_blur_i) synfig::info("paste is physically deeper than BLUR\n"); - else synfig::info("paste is less physically deep than BLUR\n"); - } else synfig::info("paste is less deep than BLUR\n"); - else synfig::info("no BLUR at all\n"); + if (seen_motion_blur_in_parent) synfig::info("seen BLUR in parent\n"); + else if (seen_motion_blur_locally) + if (z_depth > motion_blur_z_depth) synfig::info("paste is deeper than BLUR\n"); + else if (z_depth == motion_blur_z_depth) { synfig::info("paste is same depth as BLUR\n"); + if (i > motion_blur_i) synfig::info("paste is physically deeper than BLUR\n"); + else synfig::info("paste is less physically deep than BLUR\n"); + } else synfig::info("paste is less deep than BLUR\n"); + else synfig::info("no BLUR at all\n"); #endif // DEBUG - motion_blurred = (seen_motion_blur_in_parent || - (seen_motion_blur_locally && - (z_depth > motion_blur_z_depth || - (z_depth == motion_blur_z_depth && i > motion_blur_i)))); + motion_blurred = (seen_motion_blur_in_parent || + (seen_motion_blur_locally && + (z_depth > motion_blur_z_depth || + (z_depth == motion_blur_z_depth && i > motion_blur_i)))); + + Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas)); + Canvas::Handle paste_sub_canvas = paste_canvas->get_sub_canvas(); + if(paste_sub_canvas) optimize_layers(paste_sub_canvas->get_context(),sub_canvas,motion_blurred); - } //#define SYNFIG_OPTIMIZE_PASTE_CANVAS 1 #ifdef SYNFIG_OPTIMIZE_PASTE_CANVAS -- 2.7.4