]> git.sesse.net Git - casparcg/commitdiff
2.0. image_mixer: "replace" blend mode was not necessary.
authorRonag <Ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 21 Aug 2011 16:35:59 +0000 (16:35 +0000)
committerRonag <Ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 21 Aug 2011 16:35:59 +0000 (16:35 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1253 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

core/mixer/image/blend_modes.h
core/mixer/image/image_kernel.cpp
core/mixer/image/image_mixer.cpp
core/mixer/image/image_shader.cpp

index 1684639edf312a9ff942d5d895e3e022410af80e..b008a998309fc2bb919647c505e5b02248b4d411 100644 (file)
@@ -35,7 +35,6 @@ struct blend_mode
                saturation,\r
                color,\r
                luminosity,\r
-               replace,\r
                blend_mode_count \r
        };\r
 };\r
index 8a390c3893e804d7dd92486854c5cf049761e679..3209bd4e9a0ff83cbd9f41d3b23a7ab4af02bf1d 100644 (file)
@@ -127,16 +127,7 @@ struct image_kernel::implementation : boost::noncopyable
                }\r
                else\r
                {\r
-                       switch(item.blend_mode)\r
-                       {\r
-                       case blend_mode::replace:                       \r
-                               ogl.blend_func_separate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE);\r
-                               break;\r
-                       case blend_mode::normal:\r
-                       default:\r
-                               ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);\r
-                               break;\r
-                       }\r
+                       ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);                        \r
                }\r
 \r
                // Setup image-adjustements\r
index 5ed421e7edf71ea6fd854db3699193655adcca2a..d70dc4fedc15a4f0a7c31b687a5d9b3259b43193 100644 (file)
@@ -106,26 +106,19 @@ private:
                                \r
                if(layer.front().blend_mode != blend_mode::normal && has_overlapping_items(layer))\r
                {\r
-                       auto layer_draw_buffer = std::make_pair(0, create_device_buffer(4)); // int is fields flag\r
+                       auto layer_draw_buffer = create_device_buffer(4); // int is fields flag\r
                        auto layer_blend_mode = layer.front().blend_mode;\r
 \r
                        BOOST_FOREACH(auto& item, layer)\r
                        {\r
-                               if(layer_draw_buffer.first & item.transform.field_mode)\r
-                                       item.blend_mode = blend_mode::normal; // Disable blending and just merge, it will be used when merging back into render stack.\r
-                               else\r
-                               {\r
-                                       item.blend_mode = blend_mode::replace; // Target field is empty, no blending, just copy\r
-                                       layer_draw_buffer.first |= item.transform.field_mode;\r
-                               }\r
-\r
-                               draw_item(std::move(item), *layer_draw_buffer.second, local_key_buffer, layer_key_buffer);              \r
+                               item.blend_mode = blend_mode::normal; // Disable blending and just merge.\r
+                               draw_item(std::move(item), *layer_draw_buffer, local_key_buffer, layer_key_buffer);             \r
                        }\r
                        \r
                        render_item item;\r
                        item.pix_desc.pix_fmt   = pixel_format::bgra;\r
                        item.pix_desc.planes    = list_of(pixel_format_desc::plane(channel_.get_format_desc().width, channel_.get_format_desc().height, 4));\r
-                       item.textures                   = list_of(layer_draw_buffer.second);\r
+                       item.textures                   = list_of(layer_draw_buffer);\r
                        item.transform                  = frame_transform();\r
                        item.blend_mode                 = layer_blend_mode;\r
 \r
index 77a3704585e971c693e545fb2935b763038f1440..d9b83877f74da3c52da6e0e34b8d98fa86d42d2e 100644 (file)
@@ -69,8 +69,6 @@ std::string get_blend_color_func()
        "                                                                                                                                                                       \n"                                                                                                                                                       \r
        "vec4 blend(vec4 fore)                                                                                                                          \n"\r
        "{                                                                                                                                                                      \n"\r
-       "   if(blend_mode == 29) // replace                                                                                                     \n"\r
-       "         return fore;                                                                                                                          \n"\r
        "   vec4 back = texture2D(background, gl_TexCoord[1].st).bgra;                                          \n"\r
        "       fore.rgb = get_blend_color(back.rgb, fore.rgb);                                                                 \n"\r
        "       return fore + (1.0-fore.a)*back;                                                                                                \n"\r