X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Foverlay%2Foverlay.C;h=a77898f37ce988a53b89c0b452922bfd45681062;hb=6ca0a7892ec6459a54fcb3ba3a223d1ddc5ce402;hp=8f8cdea5693999439027ac3badb3036f059d7ad2;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/overlay/overlay.C b/cinelerra-5.1/plugins/overlay/overlay.C index 8f8cdea5..a77898f3 100644 --- a/cinelerra-5.1/plugins/overlay/overlay.C +++ b/cinelerra-5.1/plugins/overlay/overlay.C @@ -22,6 +22,7 @@ #include "bcdisplayinfo.h" #include "clip.h" #include "bchash.h" +#include "edl.h" #include "edlsession.h" #include "filexml.h" #include "guicast.h" @@ -393,7 +394,7 @@ int Overlay::process_buffer(VFrame **frame, { load_configuration(); - EDLSession* session = get_edlsession(); + EDLSession* session = get_edl()->session; int interpolation_type = session ? session->interpolation_type : NEAREST_NEIGHBOR; int step = config.direction == OverlayConfig::BOTTOM_FIRST ? -1 : 1; @@ -484,20 +485,12 @@ int Overlay::handle_opengl() #undef TWO #define TWO 2.0 -static const char *blend_NORMAL_frag = - " vec4 result = mix(src_color, src_color, src_color.a);\n"; - -static const char *blend_ADDITION_frag = - " vec4 result = dst_color + src_color;\n" - " result = clamp(result, 0.0, 1.0);\n"; - -static const char *blend_SUBTRACT_frag = - " vec4 result = dst_color - src_color;\n" - " result = clamp(result, 0.0, 1.0);\n"; - static const char *blend_REPLACE_frag = " vec4 result = src_color;\n"; +GL_VEC_FRAG(NORMAL); +GL_VEC_FRAG(ADDITION); +GL_VEC_FRAG(SUBTRACT); GL_STD_FRAG(MULTIPLY); GL_VEC_FRAG(DIVIDE); GL_VEC_FRAG(MAX); @@ -571,21 +564,6 @@ static const char * const overlay_shaders[TRANSFER_TYPES] = { dst->init_screen(); src->draw_texture(); break; - case TRANSFER_NORMAL: -// Move destination to screen - if( dst->get_opengl_state() != VFrame::SCREEN ) { - dst->to_texture(); - dst->enable_opengl(); - dst->init_screen(); - dst->draw_texture(); - } - src->to_texture(); - dst->enable_opengl(); - dst->init_screen(); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - src->draw_texture(); - break; default: src->to_texture(); dst->to_texture();