xref: /reactos/win32ss/gdi/dib/dib1bpp.c (revision a9a6f6e1)
1 /*
2  * PROJECT:         Win32 subsystem
3  * LICENSE:         See COPYING in the top level directory
4  * FILE:            win32ss/gdi/dib/dib1bpp.c
5  * PURPOSE:         Device Independant Bitmap functions, 1bpp
6  * PROGRAMMERS:     Jason Filby
7  *                  Doug Lyons
8  */
9 
10 #include <win32k.h>
11 
12 #define NDEBUG
13 #include <debug.h>
14 
15 #define DEC_OR_INC(var, decTrue, amount) \
16     ((var) = (decTrue) ? ((var) - (amount)) : ((var) + (amount)))
17 
18 VOID
19 DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
20 {
21   PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
22 
23   if (0 == (c & 0x01))
24     *addr &= ~MASK1BPP(x);
25   else
26     *addr |= MASK1BPP(x);
27 }
28 
29 ULONG
30 DIB_1BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
31 {
32   PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
33 
34   return (*addr & MASK1BPP(x) ? 1 : 0);
35 }
36 
37 VOID
38 DIB_1BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
39 {
40   while(x1 < x2)
41   {
42     DIB_1BPP_PutPixel(SurfObj, x1, y, c);
43     x1++;
44   }
45 }
46 
47 VOID
48 DIB_1BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
49 {
50   while(y1 < y2)
51   {
52     DIB_1BPP_PutPixel(SurfObj, x, y1, c);
53     y1++;
54   }
55 }
56 
57 static
58 void
59 DIB_1BPP_BitBltSrcCopy_From1BPP (
60                                  SURFOBJ* DestSurf,
61                                  SURFOBJ* SourceSurf,
62                                  XLATEOBJ* pxlo,
63                                  PRECTL DestRect,
64                                  POINTL *SourcePoint,
65                                  BOOLEAN bTopToBottom,
66                                  BOOLEAN bLeftToRight )
67 {
68 
69   DPRINT("bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
70 
71   // The 'window' in this sense is the x-position that corresponds
72   // to the left-edge of the 8-pixel byte we are currently working with.
73   // dwx is current x-window, dwx2 is the 'last' window we need to process.
74   int dwx, dwx2;  // Destination window x-position
75   int swx;        // Source window x-position
76 
77   // Left and right edges of source and dest rectangles
78   int dl = DestRect->left; // dest left
79   int dr = DestRect->right-1; // dest right (inclusive)
80   int sl = SourcePoint->x; // source left
81   int sr = sl + dr - dl; // source right (inclusive)
82 
83   // Which direction are we going?
84   int xinc;
85   int yinc;
86   int ySrcDelta, yDstDelta;
87 
88   // The following 4 variables are used for the y-sweep
89   int dy;  // dest y
90   int dy1; // dest y start
91   int dy2; // dest y end
92   int sy1; // src  y start
93 
94   int shift;
95   BYTE srcmask, dstmask, xormask;
96 
97   // 'd' and 's' are the dest & src buffer pointers that I use on my x-sweep
98   // 'pd' and 'ps' are the dest & src buffer pointers used on the inner y-sweep
99   PBYTE d, pd; // dest ptrs
100   PBYTE s, ps; // src ptrs
101 
102   shift = (dl-sl)&7;
103 
104   xormask = 0xFF * (BYTE)XLATEOBJ_iXlate(pxlo, 0);
105 
106   if ( DestRect->top <= SourcePoint->y )
107   {
108     DPRINT("Moving up (scan top -> bottom).\n");
109     // Moving up (scan top -> bottom)
110     dy1 = DestRect->top;
111     dy2 = DestRect->bottom - 1;
112     if (bTopToBottom)
113     {
114       sy1 = SourcePoint->y + dy2 - dy1;
115       ySrcDelta = -SourceSurf->lDelta;
116     }
117     else
118     {
119       sy1 = SourcePoint->y;
120       ySrcDelta = SourceSurf->lDelta;
121     }
122     yinc = 1;
123     yDstDelta = DestSurf->lDelta;
124   }
125   else
126   {
127     DPRINT("Moving down (scan bottom -> top).\n");
128     // Moving down (scan bottom -> top)
129     dy1 = DestRect->bottom - 1;
130     dy2 = DestRect->top;
131     if (bTopToBottom)
132     {
133       sy1 = SourcePoint->y;
134       ySrcDelta = SourceSurf->lDelta;
135     }
136     else
137     {
138       sy1 = SourcePoint->y + dy1 - dy2;
139       ySrcDelta = -SourceSurf->lDelta;
140     }
141     yinc = -1;
142     yDstDelta = -DestSurf->lDelta;
143   }
144   if ( DestRect->left <= SourcePoint->x )
145   {
146     DPRINT("Moving left (scan left->right).\n");
147     // Moving left (scan left->right)
148     dwx = dl&~7;
149     dwx2 = dr&~7;
150     if (bLeftToRight)
151     {
152       swx = (sr - (dr & 7)) & ~7;
153       xinc = -1;
154     }
155     else
156     {
157       swx = (sl-(dl&7))&~7;
158       xinc = 1;
159     }
160   }
161   else
162   {
163     DPRINT("Moving right (scan right->left).\n");
164     // Moving right (scan right->left)
165     dwx = dr & ~7;
166     dwx2 = dl & ~7;
167     if (bLeftToRight)
168     {
169       swx = (sl-(dl&7))&~7;
170       xinc = 1;
171     }
172     else
173     {
174       swx = (sr - (dr & 7)) & ~7; // (sr - 7) & ~7; // We need the left edge of this block. Thus the -7
175       xinc = -1;
176     }
177   }
178   d = &(((PBYTE)DestSurf->pvScan0)[dy1*DestSurf->lDelta + (dwx>>3)]);
179   s = &(((PBYTE)SourceSurf->pvScan0)[sy1*SourceSurf->lDelta + (swx>>3)]);
180   for ( ;; )
181   {
182     dy = dy1;
183     pd = d;
184     ps = s;
185     srcmask = 0xff;
186     if ( dwx < dl )
187     {
188       int diff = dl-dwx;
189       srcmask &= (1<<(8-diff))-1;
190     }
191     if ( dwx+7 > dr )
192     {
193       int diff = dr-dwx+1;
194       srcmask &= ~((1<<(8-diff))-1);
195     }
196     dstmask = ~srcmask;
197 
198     // We unfortunately *must* have 5 different versions of the inner
199     // loop to be certain we don't try to read from memory that is not
200     // needed and may in fact be invalid.
201     if ( !shift )
202     {
203       for ( ;; )
204       {
205         *pd = (BYTE)((*pd & dstmask) | ((ps[0]^xormask) & srcmask));
206 
207         // This *must* be here, because we could be going up *or* down...
208         if ( dy == dy2 )
209           break;
210         dy += yinc;
211         pd += yDstDelta;
212         ps += ySrcDelta;
213       }
214     }
215     else if ( !(0xFF00 & (srcmask<<shift) ) ) // Check if ps[0] not needed...
216     {
217       for ( ;; )
218       {
219         *pd = (BYTE)((*pd & dstmask)
220           | ( ( (ps[1]^xormask) >> shift ) & srcmask ));
221 
222         // This *must* be here, because we could be going up *or* down...
223         if ( dy == dy2 )
224           break;
225         dy += yinc;
226         pd += yDstDelta;
227         ps += ySrcDelta;
228       }
229     }
230     else if ( !(0xFF & (srcmask<<shift) ) ) // Check if ps[1] not needed...
231     {
232       for ( ;; )
233       {
234         *pd = (*pd & dstmask)
235           | ( ( (ps[0]^xormask) << ( 8 - shift ) ) & srcmask );
236 
237         // This *must* be here, because we could be going up *or* down...
238         if ( dy == dy2 )
239           break;
240         dy += yinc;
241         pd += yDstDelta;
242         ps += ySrcDelta;
243       }
244     }
245     else // Both ps[0] and ps[1] are needed
246     {
247       for ( ;; )
248       {
249         *pd = (*pd & dstmask)
250           | ( ( ( ((ps[1]^xormask))|((ps[0]^xormask)<<8) ) >> shift ) & srcmask );
251 
252         // This *must* be here, because we could be going up *or* down...
253         if ( dy == dy2 )
254           break;
255         dy += yinc;
256         pd += yDstDelta;
257         ps += ySrcDelta;
258       }
259     }
260 
261     // This *must* be here, because we could be going right *or* left...
262     if ( dwx == dwx2 )
263       break;
264     d += xinc;
265     s += xinc;
266     dwx += xinc<<3;
267     swx += xinc<<3;
268   }
269 }
270 
271 BOOLEAN
272 DIB_1BPP_BitBltSrcCopy(PBLTINFO BltInfo)
273 {
274   ULONG Color;
275   LONG i, j, sx, sy;
276   BOOLEAN bTopToBottom, bLeftToRight;
277 
278   // This sets sy to the top line
279   sy = BltInfo->SourcePoint.y;
280 
281   DPRINT("DIB_1BPP_BitBltSrcCopy: SrcSurf cx/cy (%d/%d), DestSuft cx/cy (%d/%d) dstRect: (%d,%d)-(%d,%d)\n",
282          BltInfo->SourceSurface->sizlBitmap.cx, BltInfo->SourceSurface->sizlBitmap.cy,
283          BltInfo->DestSurface->sizlBitmap.cx, BltInfo->DestSurface->sizlBitmap.cy,
284          BltInfo->DestRect.left, BltInfo->DestRect.top, BltInfo->DestRect.right, BltInfo->DestRect.bottom);
285 
286   /* Get back left to right flip here */
287   bLeftToRight = (BltInfo->DestRect.left > BltInfo->DestRect.right);
288 
289   /* Check for top to bottom flip needed. */
290   bTopToBottom = BltInfo->DestRect.top > BltInfo->DestRect.bottom;
291 
292   // Make WellOrdered with top < bottom and left < right
293   RECTL_vMakeWellOrdered(&BltInfo->DestRect);
294 
295   DPRINT("BPP is '%d' & BltInfo->SourcePoint.x is '%d' & BltInfo->SourcePoint.y is '%d'.\n",
296          BltInfo->SourceSurface->iBitmapFormat, BltInfo->SourcePoint.x, BltInfo->SourcePoint.y);
297 
298   switch ( BltInfo->SourceSurface->iBitmapFormat )
299   {
300   case BMF_1BPP:
301     DPRINT("1BPP Case Selected with DestRect Width of '%d'.\n",
302            BltInfo->DestRect.right - BltInfo->DestRect.left);
303 
304     DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface,
305       BltInfo->XlateSourceToDest, &BltInfo->DestRect, &BltInfo->SourcePoint,
306       bTopToBottom, bLeftToRight );
307     break;
308 
309   case BMF_4BPP:
310     DPRINT("4BPP Case Selected with DestRect Width of '%d'.\n",
311            BltInfo->DestRect.right - BltInfo->DestRect.left);
312 
313     if (bTopToBottom)
314     {
315       // This sets sy to the bottom line
316       sy += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;
317     }
318 
319     for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
320     {
321       sx = BltInfo->SourcePoint.x;
322 
323       if (bLeftToRight)
324       {
325        // This sets the sx to the rightmost pixel
326        sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
327       }
328 
329       for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
330       {
331         Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
332         DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
333 
334         DEC_OR_INC(sx, bLeftToRight, 1);
335       }
336       DEC_OR_INC(sy, bTopToBottom, 1);
337     }
338     break;
339 
340   case BMF_8BPP:
341     DPRINT("8BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
342            BltInfo->DestRect.left, BltInfo->DestRect.top,
343            BltInfo->DestRect.right, BltInfo->DestRect.bottom,
344            BltInfo->DestRect.right - BltInfo->DestRect.left);
345 
346     if (bTopToBottom)
347     {
348       // This sets sy to the bottom line
349       sy += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;
350     }
351 
352     for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
353     {
354       sx = BltInfo->SourcePoint.x;
355 
356       if (bLeftToRight)
357       {
358         // This sets sx to the rightmost pixel
359         sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
360       }
361 
362       for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
363       {
364         Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_8BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
365         DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
366 
367         DEC_OR_INC(sx, bLeftToRight, 1);
368       }
369       DEC_OR_INC(sy, bTopToBottom, 1);
370     }
371     break;
372 
373   case BMF_16BPP:
374     DPRINT("16BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
375            BltInfo->DestRect.left, BltInfo->DestRect.top,
376            BltInfo->DestRect.right, BltInfo->DestRect.bottom,
377            BltInfo->DestRect.right - BltInfo->DestRect.left);
378 
379     if (bTopToBottom)
380     {
381       // This sets sy to the bottom line
382       sy += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;;
383     }
384 
385     for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
386     {
387       sx = BltInfo->SourcePoint.x;
388 
389       if (bLeftToRight)
390       {
391         // This sets the sx to the rightmost pixel
392         sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
393       }
394 
395       for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
396       {
397         Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_16BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
398         DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
399         DEC_OR_INC(sx, bLeftToRight, 1);
400       }
401       DEC_OR_INC(sy, bTopToBottom, 1);
402     }
403     break;
404 
405   case BMF_24BPP:
406 
407     DPRINT("24BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
408            BltInfo->DestRect.left, BltInfo->DestRect.top,
409            BltInfo->DestRect.right, BltInfo->DestRect.bottom,
410            BltInfo->DestRect.right - BltInfo->DestRect.left);
411 
412       if (bTopToBottom)
413       {
414         // This sets sy to the bottom line
415         sy += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;
416       }
417 
418     for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
419     {
420       sx = BltInfo->SourcePoint.x;
421 
422       if (bLeftToRight)
423       {
424         // This sets the sx to the rightmost pixel
425         sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
426       }
427 
428       for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
429       {
430         Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
431         DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
432         DEC_OR_INC(sx, bLeftToRight, 1);
433       }
434       DEC_OR_INC(sy, bTopToBottom, 1);
435     }
436     break;
437 
438   case BMF_32BPP:
439 
440     DPRINT("32BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
441            BltInfo->DestRect.left, BltInfo->DestRect.top,
442            BltInfo->DestRect.right, BltInfo->DestRect.bottom,
443            BltInfo->DestRect.right - BltInfo->DestRect.left);
444 
445     if (bTopToBottom)
446     {
447       // This sets sy to the bottom line
448       sy += BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1;
449     }
450 
451     for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
452     {
453       sx = BltInfo->SourcePoint.x;
454 
455       if (bLeftToRight)
456       {
457         // This sets the sx to the rightmost pixel
458         sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
459       }
460 
461       for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
462       {
463         Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_32BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
464         DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
465         DEC_OR_INC(sx, bLeftToRight, 1);
466       }
467       DEC_OR_INC(sy, bTopToBottom, 1);
468     }
469     break;
470 
471   default:
472     DbgPrint("DIB_1BPP_BitBlt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
473     return FALSE;
474   }
475 
476   return TRUE;
477 }
478 
479 #ifndef _USE_DIBLIB_
480 BOOLEAN
481 DIB_1BPP_BitBlt(PBLTINFO BltInfo)
482 {
483   LONG DestX, DestY;
484   LONG SourceX, SourceY;
485   LONG PatternY = 0;
486   ULONG Dest, Source = 0, Pattern = 0;
487   ULONG Index;
488   BOOLEAN UsesSource;
489   BOOLEAN UsesPattern;
490   PULONG DestBits;
491   LONG RoundedRight;
492 
493   UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
494   UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
495 
496   RoundedRight = BltInfo->DestRect.right -
497     ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31);
498   SourceY = BltInfo->SourcePoint.y;
499 
500   if (UsesPattern)
501   {
502     if (BltInfo->PatternSurface)
503     {
504       PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
505         BltInfo->PatternSurface->sizlBitmap.cy;
506     }
507     else
508     {
509       /* FIXME: Shouldn't it be expanded? */
510       if (BltInfo->Brush)
511         Pattern = BltInfo->Brush->iSolidColor;
512     }
513   }
514 
515   for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
516   {
517     DestX = BltInfo->DestRect.left;
518     SourceX = BltInfo->SourcePoint.x;
519     DestBits = (PULONG)(
520       (PBYTE)BltInfo->DestSurface->pvScan0 +
521       (BltInfo->DestRect.left >> 3) +
522       DestY * BltInfo->DestSurface->lDelta);
523 
524     if (DestX & 31)
525     {
526 #if 0
527       /* FIXME: This case is completely untested!!! */
528 
529       Dest = *((PBYTE)DestBits);
530       NoBits = 31 - (DestX & 31);
531 
532       if (UsesSource)
533       {
534         Source = 0;
535         /* FIXME: This is incorrect! */
536         for (Index = 31 - NoBits; Index >= 0; Index++)
537           Source |= (DIB_GetSource(SourceSurf, SourceX + Index, SourceY, ColorTranslation) << (31 - Index));
538       }
539 
540       if (BltInfo->PatternSurface)
541       {
542         Pattern = 0;
543         for (k = 31 - NoBits; k >= 0; k++)
544           Pattern |= (DIB_GetSourceIndex(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY) << (31 - k));
545       }
546 
547       Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
548       Dest &= ~((1 << (31 - NoBits)) - 1);
549       Dest |= *((PBYTE)DestBits) & ((1 << (31 - NoBits)) - 1);
550 
551       *DestBits = Dest;
552 
553       DestX += NoBits;
554       SourceX += NoBits;
555 #endif
556     }
557 
558     for (; DestX < RoundedRight; DestX += 32, DestBits++, SourceX += 32)
559     {
560       Dest = *DestBits;
561 
562       if (UsesSource)
563       {
564         Source = 0;
565         for (Index = 0; Index < 8; Index++)
566         {
567           Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index, SourceY, BltInfo->XlateSourceToDest) << (7 - Index);
568           Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 8, SourceY, BltInfo->XlateSourceToDest) << (8 + (7 - Index));
569           Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 16, SourceY, BltInfo->XlateSourceToDest) << (16 + (7 - Index));
570           Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 24, SourceY, BltInfo->XlateSourceToDest) << (24 + (7 - Index));
571         }
572       }
573 
574       if (BltInfo->PatternSurface)
575       {
576         Pattern = 0;
577         for (Index = 0; Index < 8; Index++)
578         {
579           Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (7 - Index);
580           Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 8) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (8 + (7 - Index));
581           Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 16) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (16 + (7 - Index));
582           Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 24) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (24 + (7 - Index));
583         }
584       }
585 
586       *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
587     }
588 
589     if (DestX < BltInfo->DestRect.right)
590     {
591       for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
592       {
593         Dest = DIB_1BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
594 
595         if (UsesSource)
596         {
597           Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
598         }
599 
600         if (BltInfo->PatternSurface)
601         {
602           Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
603         }
604 
605         DIB_1BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
606       }
607     }
608 
609     SourceY++;
610     if (BltInfo->PatternSurface)
611     {
612       PatternY++;
613       PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
614     }
615   }
616 
617   return TRUE;
618 }
619 
620 /* BitBlt Optimize */
621 BOOLEAN
622 DIB_1BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
623 {
624   LONG DestY;
625 
626   /* Make WellOrdered with top < bottom and left < right */
627   RECTL_vMakeWellOrdered(DestRect);
628 
629   for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
630   {
631     DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
632   }
633   return TRUE;
634 }
635 #endif // !_USE_DIBLIB_
636 
637 BOOLEAN
638 DIB_1BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
639                         RECTL*  DestRect,  RECTL *SourceRect,
640                         XLATEOBJ *ColorTranslation, ULONG iTransColor)
641 {
642   return FALSE;
643 }
644 
645 /* EOF */
646