X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Flayer_pastecanvas.cpp;h=edc3d0b6b6fbada291cd657ca250fe6ffc0e06a0;hb=3f11cd07d0b39fbd614ca1f8b0eb903dc5571fc8;hp=747f7700bcf41f54d501ecaacce7f9ca26af3b3d;hpb=159c8ba9953730ff45962e6f92370fd531af65f9;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp b/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp index 747f770..edc3d0b 100644 --- a/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp +++ b/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp @@ -85,7 +85,8 @@ Layer_PasteCanvas::Layer_PasteCanvas(): origin(0,0), depth(0), zoom(0), - time_offset(0) + time_offset(0), + extra_reference(false) { children_lock=false; muck_with_time_=true; @@ -103,6 +104,7 @@ Layer_PasteCanvas::~Layer_PasteCanvas() set_sub_canvas(0); //if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root())) + //if(extra_reference) // canvas->unref(); } @@ -186,7 +188,8 @@ Layer_PasteCanvas::set_sub_canvas(etl::handle x) if(canvas && muck_with_time_) remove_child(canvas.get()); - if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root())) + // if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root())) + if (extra_reference) canvas->unref(); child_changed_connection.disconnect(); @@ -209,7 +212,12 @@ Layer_PasteCanvas::set_sub_canvas(etl::handle x) add_child(canvas.get()); if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root())) + { canvas->ref(); + extra_reference = true; + } + else + extra_reference = false; if(canvas) on_canvas_set(); @@ -401,7 +409,10 @@ Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quali // the area we're about to blit is transparent, so it doesn't // matter whether we use 'straight' or 'straight onto' here - apen.set_blend_method(Color::BLEND_STRAIGHT); + if (blend_method == Color::BLEND_ALPHA_BRIGHTEN) + apen.set_blend_method(blend_method); + else + apen.set_blend_method(Color::BLEND_STRAIGHT); /* This represents the area we're pasting into the tile, * within the tile as a whole. Areas (A), (B), (C) and (D)