Пример #1
0
		protected override void Render (ImageSurface src, ImageSurface dst, Gdk.Rectangle roi)
		{
            var r = roi.ToCairoRectangle ();

            using (var temp = new ImageSurface (Format.Argb32, roi.Width, roi.Height)) {

                RenderClouds (temp, roi, Data.Scale, (byte)(Data.Seed ^ instanceSeed), Data.Power / 100.0, 
                              PintaCore.Palette.PrimaryColor.ToColorBgra (), PintaCore.Palette.SecondaryColor.ToColorBgra ());
                
                temp.MarkDirty ();

                // Have to lock because effect renderer is multithreaded
                lock (render_lock) {
                    using (var g = new Context (dst)) {
                        // - Clear any previous render from the destination
                        // - Copy the source to the destination
                        // - Blend the clouds over the source
                        g.Clear (r);
                        g.BlendSurface (src, r);
                        g.BlendSurface (temp, r.Location (), (BlendMode)CloudsData.BlendOps[Data.BlendMode]);
                    }
                }
            }
		}