summaryrefslogtreecommitdiffstats
path: root/draw.c
blob: df30d5dbe6bcbe2b139430a8bbc21620d1b08b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "rfb.h"

void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,Pixel col)
{
  int rowstride = s->paddedWidthInBytes, bpp = s->bitsPerPixel>>3;
  int i,j;
  char* colour=(char*)&col;

  if(!rfbEndianTest)
    colour += 4-bpp;
  for(j=y1;j<y2;j++)
    for(i=x1;i<x2;i++)
      memcpy(s->frameBuffer+j*rowstride+i*bpp,colour,bpp);
  rfbMarkRectAsModified(s,x1,y1,x2,y2);
}