X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Flayer_pastecanvas.cpp;h=d19f066f0c8c4fa77900a8eedd1dece28b096738;hb=17db38a8803db1a9deebfa02a45c351f7325063e;hp=b4b85383852cc0819de21256dc1927f6efd52515;hpb=7e79f447f0b72d717d21dc16b20a71b2e74198d6;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp b/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp index b4b8538..d19f066 100644 --- a/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp +++ b/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp @@ -53,6 +53,7 @@ using namespace synfig; #define MAX_DEPTH 10 +// if this isn't defined, the 'dead heads' in examples/pirates.sifz don't render properly #define SYNFIG_CLIP_PASTECANVAS //#ifdef __APPLE__ @@ -332,13 +333,27 @@ Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quali Color::BlendMethod blend_method(get_blend_method()); const Rect full_bounding_rect(canvas->get_context().get_full_bounding_rect()); - if(context->empty() || - !etl::intersect(context.get_full_bounding_rect(),full_bounding_rect+origin)) + if(context->empty()) { if (Color::is_onto(blend_method)) return true; if (blend_method==Color::BLEND_COMPOSITE) blend_method=Color::BLEND_STRAIGHT; } + if (!etl::intersect(context.get_full_bounding_rect(),full_bounding_rect+origin)) + { + if (Color::is_onto(blend_method)) return true; + + /* 'straight' is faster than 'composite' and has the same + * effect if the affected area of the lower layer is + * transparent; however, if we're not clipping the blit to + * just the bounding rectangle, the affected area is the whole + * tile, so we can't use this optimisation + */ +#ifdef SYNFIG_CLIP_PASTECANVAS + if (blend_method==Color::BLEND_COMPOSITE) blend_method=Color::BLEND_STRAIGHT; +#endif // SYNFIG_CLIP_PASTECANVAS + } + #ifdef SYNFIG_CLIP_PASTECANVAS Rect area(desc.get_rect() & full_bounding_rect);