if (x<0) x=0; if (y<0) y=0;
void Java_vdr_mhp_awt_MHPNativeGraphics_fillRect(JNIEnv* env, jobject obj, jlong nativeData, jlong nativeFlipData, jint x, jint y, jint width, jint height) {   IDirectFBSurface *surface=((IDirectFBSurface *)nativeData);   //printf("Java_vdr_mhp_awt_MHPNativeGraphics_fillRect: %dx%d, %dx%d\n", x, y, width, height);   if (x<0)      x=0;   if (y<0)      y=0;   try {      surface->SetDrawingFlags(DSDRAW_BLEND);      surface->FillRectangle(x, y, width+1, height+1);   } catch (DFBException *e) {      int w,h;      surface->GetSize(&w, &h);      printf("DirectFB: Error %s, %s, %dx%d, %dx%d; %dx%d\n", e->GetAction(), e->GetResult(), x, y, width+1, height+1, w, h);      delete e;      return;   }   ((FlipData *)nativeFlipData)->addUpdate(x, y, x+width+1, y+height+1);}