Esempio n. 1
0
        //================================================render_scanline_aa_solid
        private static void RenderSolidSingleScanLine(IPixelFormat pixFormat, IScanline scanLine, RGBA_Bytes color)
        {
#if use_timers
            render_scanline_aa_solidTimer.Start();
#endif
            int y = scanLine.y();
            uint num_spans = scanLine.NumberOfSpans;
            ScanlineSpan scanlineSpan = scanLine.Begin;

            byte[] ManagedCoversArray = scanLine.GetCovers();
            unsafe
            {
                fixed (byte* pCovers = ManagedCoversArray)
                {
                    for (; ; )
                    {
                        int x = scanlineSpan.x;
                        if (scanlineSpan.len > 0)
                        {
#if use_timers
                            render_scanline_aa_solid_blend_solid_hspan.Start();
#endif
                            pixFormat.BlendSolidHorizontalSpan(x, y, (uint)scanlineSpan.len, color, &pCovers[scanlineSpan.cover_index]);
#if use_timers
                            render_scanline_aa_solid_blend_solid_hspan.Stop();
#endif
                        }
                        else
                        {
#if use_timers
                            render_scanline_aa_solid_blend_hline.Start();
#endif
                            pixFormat.BlendHorizontalLine(x, y, (x - (int)scanlineSpan.len - 1), color, pCovers[scanlineSpan.cover_index]);
#if use_timers
                            render_scanline_aa_solid_blend_hline.Stop();
#endif
                        }
                        if (--num_spans == 0) break;
                        scanlineSpan = scanLine.GetNextScanlineSpan();
                    }
                }
            }
#if use_timers
            render_scanline_aa_solidTimer.Stop();
#endif
        }
Esempio n. 2
0
        //================================================render_scanline_aa_solid
        private static void RenderSolidSingleScanLine(IPixelFormat pixFormat, IScanline scanLine, RGBA_Bytes color)
        {
            #if use_timers
            render_scanline_aa_solidTimer.Start();
            #endif
            int y = scanLine.y();
            uint num_spans = scanLine.NumberOfSpans;
            ScanlineSpan scanlineSpan = scanLine.Begin;

            byte[] ManagedCoversArray = scanLine.GetCovers();
            unsafe
            {
                fixed (byte* pCovers = ManagedCoversArray)
                {
                    for (; ; )
                    {
                        int x = scanlineSpan.x;
                        if (scanlineSpan.len > 0)
                        {
            #if use_timers
                            render_scanline_aa_solid_blend_solid_hspan.Start();
            #endif
                            pixFormat.BlendSolidHorizontalSpan(x, y, (uint)scanlineSpan.len, color, &pCovers[scanlineSpan.cover_index]);
            #if use_timers
                            render_scanline_aa_solid_blend_solid_hspan.Stop();
            #endif
                        }
                        else
                        {
            #if use_timers
                            render_scanline_aa_solid_blend_hline.Start();
            #endif
                            pixFormat.BlendHorizontalLine(x, y, (x - (int)scanlineSpan.len - 1), color, pCovers[scanlineSpan.cover_index]);
            #if use_timers
                            render_scanline_aa_solid_blend_hline.Stop();
            #endif
                        }
                        if (--num_spans == 0) break;
                        scanlineSpan = scanLine.GetNextScanlineSpan();
                    }
                }
            }
            #if use_timers
            render_scanline_aa_solidTimer.Stop();
            #endif
        }
Esempio n. 3
0
 public unsafe virtual void BlendSolidHorizontalSpan(int x, int y, uint len, RGBA_Bytes c, byte *covers)
 {
     PixelFormat.BlendSolidHorizontalSpan(x, y, len, c, covers);
 }