mshtml: Wine Gecko 1.4 release.
[wine] / dlls / gdi32 / dibdrv / dc.c
1 /*
2  * DIB driver initialization and DC functions.
3  *
4  * Copyright 2011 Huw Davies
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <assert.h>
22
23 #include "gdi_private.h"
24 #include "dibdrv.h"
25
26 #include "wine/exception.h"
27 #include "wine/debug.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(dib);
30
31 static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff};
32 static const DWORD bit_fields_555[3] = {0x7c00, 0x03e0, 0x001f};
33
34 static void calc_shift_and_len(DWORD mask, int *shift, int *len)
35 {
36     int s, l;
37
38     if(!mask)
39     {
40         *shift = *len = 0;
41         return;
42     }
43
44     s = 0;
45     while ((mask & 1) == 0)
46     {
47         mask >>= 1;
48         s++;
49     }
50     l = 0;
51     while ((mask & 1) == 1)
52     {
53         mask >>= 1;
54         l++;
55     }
56     *shift = s;
57     *len = l;
58 }
59
60 static void init_bit_fields(dib_info *dib, const DWORD *bit_fields)
61 {
62     dib->red_mask    = bit_fields[0];
63     dib->green_mask  = bit_fields[1];
64     dib->blue_mask   = bit_fields[2];
65     calc_shift_and_len(dib->red_mask,   &dib->red_shift,   &dib->red_len);
66     calc_shift_and_len(dib->green_mask, &dib->green_shift, &dib->green_len);
67     calc_shift_and_len(dib->blue_mask,  &dib->blue_shift,  &dib->blue_len);
68 }
69
70 BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields,
71                    RGBQUAD *color_table, int color_table_size, void *bits, enum dib_info_flags flags)
72 {
73     dib->bit_count    = bi->biBitCount;
74     dib->width        = bi->biWidth;
75     dib->height       = bi->biHeight;
76     dib->stride       = get_dib_stride( dib->width, dib->bit_count );
77     dib->bits.ptr     = bits;
78     dib->bits.is_copy = FALSE;
79     dib->bits.free    = NULL;
80     dib->bits.param   = NULL;
81     dib->flags        = flags;
82
83     if(dib->height < 0) /* top-down */
84     {
85         dib->height = -dib->height;
86     }
87     else /* bottom-up */
88     {
89         /* bits always points to the top-left corner and the stride is -ve */
90         dib->bits.ptr = (BYTE*)dib->bits.ptr + (dib->height - 1) * dib->stride;
91         dib->stride  = -dib->stride;
92     }
93
94     dib->funcs = &funcs_null;
95
96     switch(dib->bit_count)
97     {
98     case 32:
99         if(bi->biCompression == BI_RGB)
100             bit_fields = bit_fields_888;
101
102         init_bit_fields(dib, bit_fields);
103
104         if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
105             dib->funcs = &funcs_8888;
106         else
107             dib->funcs = &funcs_32;
108         break;
109
110     case 24:
111         dib->funcs = &funcs_24;
112         break;
113
114     case 16:
115         if(bi->biCompression == BI_RGB)
116             bit_fields = bit_fields_555;
117
118         init_bit_fields(dib, bit_fields);
119
120         if(dib->red_mask == 0x7c00 && dib->green_mask == 0x03e0 && dib->blue_mask == 0x001f)
121             dib->funcs = &funcs_555;
122         else
123             dib->funcs = &funcs_16;
124         break;
125
126     case 8:
127         dib->funcs = &funcs_8;
128         break;
129
130     case 4:
131         dib->funcs = &funcs_4;
132         break;
133
134     case 1:
135         dib->funcs = &funcs_1;
136         break;
137
138     default:
139         TRACE("bpp %d not supported, will forward to graphics driver.\n", dib->bit_count);
140         return FALSE;
141     }
142
143     if(color_table)
144     {
145         if (flags & private_color_table)
146         {
147             dib->color_table = HeapAlloc(GetProcessHeap(), 0, color_table_size * sizeof(dib->color_table[0]));
148             if(!dib->color_table) return FALSE;
149             memcpy(dib->color_table, color_table, color_table_size * sizeof(color_table[0]));
150         }
151         else
152             dib->color_table = color_table;
153         dib->color_table_size = color_table_size;
154     }
155     else
156     {
157         dib->color_table = NULL;
158         dib->color_table_size = 0;
159     }
160
161     return TRUE;
162 }
163
164 BOOL init_dib_info_from_brush(dib_info *dib, const BITMAPINFO *bi, void *bits, UINT usage, HPALETTE palette)
165 {
166     DWORD *masks = (bi->bmiHeader.biCompression == BI_BITFIELDS) ? (DWORD *)bi->bmiColors : NULL;
167     RGBQUAD *color_table = NULL, pal_table[256];
168     int num_colors = get_dib_num_of_colors( bi );
169
170     if(num_colors)
171     {
172         if(usage == DIB_PAL_COLORS)
173         {
174             PALETTEENTRY entries[256];
175             const WORD *index = (const WORD *)bi->bmiColors;
176             UINT i, count = GetPaletteEntries( palette, 0, num_colors, entries );
177             for (i = 0; i < num_colors; i++, index++)
178             {
179                 PALETTEENTRY *entry = &entries[*index % count];
180                 pal_table[i].rgbRed      = entry->peRed;
181                 pal_table[i].rgbGreen    = entry->peGreen;
182                 pal_table[i].rgbBlue     = entry->peBlue;
183                 pal_table[i].rgbReserved = 0;
184             }
185             color_table = pal_table;
186         }
187         else color_table = (RGBQUAD *)bi->bmiColors;
188     }
189     return init_dib_info(dib, &bi->bmiHeader, masks, color_table, num_colors, bits, private_color_table);
190 }
191
192 BOOL init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *bits, enum dib_info_flags flags)
193 {
194     unsigned int colors = get_dib_num_of_colors( info );
195     void *colorptr = (char *)&info->bmiHeader + info->bmiHeader.biSize;
196     const DWORD *bitfields = (info->bmiHeader.biCompression == BI_BITFIELDS) ? (DWORD *)colorptr : NULL;
197
198     return init_dib_info( dib, &info->bmiHeader, bitfields, colors ? colorptr : NULL, colors, bits, flags );
199 }
200
201 BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_flags flags)
202 {
203     if (!bmp->dib)
204     {
205         char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
206         BITMAPINFO *info = (BITMAPINFO *)buffer;
207
208         get_ddb_bitmapinfo( bmp, info );
209         if (!bmp->bitmap.bmBits)
210         {
211             int width_bytes = get_dib_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel );
212             bmp->bitmap.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
213                                             bmp->bitmap.bmHeight * width_bytes );
214             if (!bmp->bitmap.bmBits) return FALSE;
215         }
216         return init_dib_info_from_bitmapinfo( dib, info, bmp->bitmap.bmBits,
217                                               flags | private_color_table );
218     }
219     return init_dib_info( dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields,
220                           bmp->color_table, bmp->nb_colors, bmp->dib->dsBm.bmBits, flags );
221 }
222
223 static void clear_dib_info(dib_info *dib)
224 {
225     dib->color_table = NULL;
226     dib->bits.ptr    = NULL;
227     dib->bits.free   = NULL;
228     dib->bits.param  = NULL;
229 }
230
231 /**********************************************************************
232  *      free_dib_info
233  *
234  * Free the resources associated with a dib and optionally the bits
235  */
236 void free_dib_info(dib_info *dib)
237 {
238     if (dib->flags & private_color_table)
239         HeapFree(GetProcessHeap(), 0, dib->color_table);
240
241     if (dib->bits.free) dib->bits.free( &dib->bits );
242     clear_dib_info( dib );
243 }
244
245 void copy_dib_color_info(dib_info *dst, const dib_info *src)
246 {
247     dst->bit_count        = src->bit_count;
248     dst->red_mask         = src->red_mask;
249     dst->green_mask       = src->green_mask;
250     dst->blue_mask        = src->blue_mask;
251     dst->red_len          = src->red_len;
252     dst->green_len        = src->green_len;
253     dst->blue_len         = src->blue_len;
254     dst->red_shift        = src->red_shift;
255     dst->green_shift      = src->green_shift;
256     dst->blue_shift       = src->blue_shift;
257     dst->funcs            = src->funcs;
258     dst->color_table_size = src->color_table_size;
259     dst->color_table      = NULL;
260     dst->flags            = src->flags;
261     if(dst->color_table_size)
262     {
263         int size = dst->color_table_size * sizeof(dst->color_table[0]);
264         if (dst->flags & private_color_table)
265         {
266             dst->color_table = HeapAlloc(GetProcessHeap(), 0, size);
267             memcpy(dst->color_table, src->color_table, size);
268         }
269         else
270             dst->color_table = src->color_table;
271     }
272 }
273
274 DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
275                           const BITMAPINFO *dst_info, void *dst_bits, BOOL add_alpha )
276 {
277     dib_info src_dib, dst_dib;
278     DWORD ret;
279
280     if ( !init_dib_info_from_bitmapinfo( &src_dib, src_info, src_bits, 0 ) )
281         return ERROR_BAD_FORMAT;
282     if ( !init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits, 0 ) )
283         return ERROR_BAD_FORMAT;
284
285     __TRY
286     {
287         dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
288         ret = TRUE;
289     }
290     __EXCEPT_PAGE_FAULT
291     {
292         WARN( "invalid bits pointer %p\n", src_bits );
293         ret = FALSE;
294     }
295     __ENDTRY
296
297     /* We shared the color tables, so there's no need to free the dib_infos here */
298     if(!ret) return ERROR_BAD_FORMAT;
299
300     /* update coordinates, the destination rectangle is always stored at 0,0 */
301     src->x -= src->visrect.left;
302     src->y -= src->visrect.top;
303     offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
304
305     if (add_alpha && dst_dib.funcs == &funcs_8888 && src_dib.funcs != &funcs_8888)
306     {
307         DWORD *pixel = dst_dib.bits.ptr;
308         int x, y;
309
310         for (y = src->visrect.top; y < src->visrect.bottom; y++, pixel += dst_dib.stride / 4)
311             for (x = src->visrect.left; x < src->visrect.right; x++)
312                 pixel[x] |= 0xff000000;
313     }
314
315     return ERROR_SUCCESS;
316 }
317
318 static void update_fg_colors( dibdrv_physdev *pdev )
319 {
320     pdev->pen_color   = get_pixel_color( pdev, pdev->pen_colorref,   TRUE );
321     pdev->brush_color = get_pixel_color( pdev, pdev->brush_colorref, TRUE );
322 }
323
324 static void update_masks( dibdrv_physdev *pdev, INT rop )
325 {
326     calc_and_xor_masks( rop, pdev->pen_color, &pdev->pen_and, &pdev->pen_xor );
327     update_brush_rop( pdev, rop );
328     if( GetBkMode( pdev->dev.hdc ) == OPAQUE )
329         calc_and_xor_masks( rop, pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
330 }
331
332  /***********************************************************************
333  *           add_extra_clipping_region
334  *
335  * Temporarily add a region to the current clipping region.
336  * The returned region must be restored with restore_clipping_region.
337  */
338 HRGN add_extra_clipping_region( dibdrv_physdev *pdev, HRGN rgn )
339 {
340     HRGN ret, clip;
341
342     if (!(clip = CreateRectRgn( 0, 0, 0, 0 ))) return 0;
343     CombineRgn( clip, pdev->clip, rgn, RGN_AND );
344     ret = pdev->clip;
345     pdev->clip = clip;
346     return ret;
347 }
348
349 /***********************************************************************
350  *           restore_clipping_region
351  */
352 void restore_clipping_region( dibdrv_physdev *pdev, HRGN rgn )
353 {
354     if (!rgn) return;
355     DeleteObject( pdev->clip );
356     pdev->clip = rgn;
357 }
358
359 /**********************************************************************
360  *           dibdrv_CreateDC
361  */
362 static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
363                              LPCWSTR output, const DEVMODEW *data )
364 {
365     dibdrv_physdev *pdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdev) );
366
367     if (!pdev) return FALSE;
368     if (!(pdev->clip = CreateRectRgn(0, 0, 0, 0)))
369     {
370         HeapFree( GetProcessHeap(), 0, pdev );
371         return FALSE;
372     }
373     clear_dib_info(&pdev->dib);
374     clear_dib_info(&pdev->brush_dib);
375     push_dc_driver( dev, &pdev->dev, &dib_driver );
376     return TRUE;
377 }
378
379 /***********************************************************************
380  *           dibdrv_DeleteDC
381  */
382 static BOOL dibdrv_DeleteDC( PHYSDEV dev )
383 {
384     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
385     TRACE("(%p)\n", dev);
386     DeleteObject(pdev->clip);
387     free_pattern_brush(pdev);
388     free_dib_info(&pdev->dib);
389     HeapFree( GetProcessHeap(), 0, pdev );
390     return TRUE;
391 }
392
393 /***********************************************************************
394  *           dibdrv_CopyBitmap
395  */
396 static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
397 {
398     return nulldrv_CopyBitmap( src, dst );
399 }
400
401 /***********************************************************************
402  *           dibdrv_DeleteBitmap
403  */
404 static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
405 {
406     return TRUE;
407 }
408
409 /***********************************************************************
410  *           dibdrv_SelectBitmap
411  */
412 static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
413 {
414     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectBitmap );
415     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
416     BITMAPOBJ *bmp = GDI_GetObjPtr( bitmap, OBJ_BITMAP );
417     TRACE("(%p, %p)\n", dev, bitmap);
418
419     if (!bmp) return 0;
420
421     free_dib_info(&pdev->dib);
422     pdev->defer = 0;
423     if(!init_dib_info_from_bitmapobj(&pdev->dib, bmp, private_color_table))
424         pdev->defer |= DEFER_FORMAT;
425
426     GDI_ReleaseObj( bitmap );
427
428     return next->funcs->pSelectBitmap( next, bitmap );
429 }
430
431 /***********************************************************************
432  *           dibdrv_SetBkColor
433  */
434 static COLORREF dibdrv_SetBkColor( PHYSDEV dev, COLORREF color )
435 {
436     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkColor );
437     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
438
439     pdev->bkgnd_color = get_pixel_color( pdev, color, FALSE );
440
441     if( GetBkMode(dev->hdc) == OPAQUE )
442         calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
443     else
444     {
445         pdev->bkgnd_and = ~0u;
446         pdev->bkgnd_xor = 0;
447     }
448
449     update_fg_colors( pdev ); /* Only needed in the 1 bpp case */
450
451     return next->funcs->pSetBkColor( next, color );
452 }
453
454 /***********************************************************************
455  *           dibdrv_SetBkMode
456  */
457 static INT dibdrv_SetBkMode( PHYSDEV dev, INT mode )
458 {
459     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkMode );
460     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
461
462     if( mode == OPAQUE )
463         calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
464     else
465     {
466         pdev->bkgnd_and = ~0u;
467         pdev->bkgnd_xor = 0;
468     }
469
470     return next->funcs->pSetBkMode( next, mode );
471 }
472
473 /***********************************************************************
474  *           dibdrv_SetDeviceClipping
475  */
476 static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn )
477 {
478     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping );
479     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
480     TRACE("(%p, %p, %p)\n", dev, vis_rgn, clip_rgn);
481
482     CombineRgn( pdev->clip, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY );
483     return next->funcs->pSetDeviceClipping( next, vis_rgn, clip_rgn);
484 }
485
486 /***********************************************************************
487  *           dibdrv_SetDIBColorTable
488  */
489 static UINT dibdrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RGBQUAD *colors )
490 {
491     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDIBColorTable );
492     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
493     TRACE("(%p, %d, %d, %p)\n", dev, pos, count, colors);
494
495     if( pdev->dib.color_table && pos < pdev->dib.color_table_size )
496     {
497         if( pos + count > pdev->dib.color_table_size ) count = pdev->dib.color_table_size - pos;
498         memcpy( pdev->dib.color_table + pos, colors, count * sizeof(RGBQUAD) );
499
500         pdev->bkgnd_color = get_pixel_color( pdev, GetBkColor( dev->hdc ), FALSE );
501         update_fg_colors( pdev );
502
503         update_masks( pdev, GetROP2( dev->hdc ) );
504     }
505     return next->funcs->pSetDIBColorTable( next, pos, count, colors );
506 }
507
508 /***********************************************************************
509  *           dibdrv_SetROP2
510  */
511 static INT dibdrv_SetROP2( PHYSDEV dev, INT rop )
512 {
513     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetROP2 );
514     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
515
516     update_masks( pdev, rop );
517
518     return next->funcs->pSetROP2( next, rop );
519 }
520
521 const struct gdi_dc_funcs dib_driver =
522 {
523     NULL,                               /* pAbortDoc */
524     NULL,                               /* pAbortPath */
525     dibdrv_AlphaBlend,                  /* pAlphaBlend */
526     NULL,                               /* pAngleArc */
527     NULL,                               /* pArc */
528     NULL,                               /* pArcTo */
529     NULL,                               /* pBeginPath */
530     dibdrv_BlendImage,                  /* pBlendImage */
531     NULL,                               /* pChoosePixelFormat */
532     NULL,                               /* pChord */
533     NULL,                               /* pCloseFigure */
534     dibdrv_CopyBitmap,                  /* pCopyBitmap */
535     NULL,                               /* pCreateBitmap */
536     NULL,                               /* pCreateCompatibleDC */
537     dibdrv_CreateDC,                    /* pCreateDC */
538     NULL,                               /* pCreateDIBSection */
539     dibdrv_DeleteBitmap,                /* pDeleteBitmap */
540     dibdrv_DeleteDC,                    /* pDeleteDC */
541     NULL,                               /* pDeleteObject */
542     NULL,                               /* pDescribePixelFormat */
543     NULL,                               /* pDeviceCapabilities */
544     NULL,                               /* pEllipse */
545     NULL,                               /* pEndDoc */
546     NULL,                               /* pEndPage */
547     NULL,                               /* pEndPath */
548     NULL,                               /* pEnumFonts */
549     NULL,                               /* pEnumICMProfiles */
550     NULL,                               /* pExcludeClipRect */
551     NULL,                               /* pExtDeviceMode */
552     NULL,                               /* pExtEscape */
553     NULL,                               /* pExtFloodFill */
554     NULL,                               /* pExtSelectClipRgn */
555     NULL,                               /* pExtTextOut */
556     NULL,                               /* pFillPath */
557     NULL,                               /* pFillRgn */
558     NULL,                               /* pFlattenPath */
559     NULL,                               /* pFontIsLinked */
560     NULL,                               /* pFrameRgn */
561     NULL,                               /* pGdiComment */
562     NULL,                               /* pGdiRealizationInfo */
563     NULL,                               /* pGetCharABCWidths */
564     NULL,                               /* pGetCharABCWidthsI */
565     NULL,                               /* pGetCharWidth */
566     NULL,                               /* pGetDeviceCaps */
567     NULL,                               /* pGetDeviceGammaRamp */
568     NULL,                               /* pGetFontData */
569     NULL,                               /* pGetFontUnicodeRanges */
570     NULL,                               /* pGetGlyphIndices */
571     NULL,                               /* pGetGlyphOutline */
572     NULL,                               /* pGetICMProfile */
573     dibdrv_GetImage,                    /* pGetImage */
574     NULL,                               /* pGetKerningPairs */
575     NULL,                               /* pGetNearestColor */
576     NULL,                               /* pGetOutlineTextMetrics */
577     dibdrv_GetPixel,                    /* pGetPixel */
578     NULL,                               /* pGetPixelFormat */
579     NULL,                               /* pGetSystemPaletteEntries */
580     NULL,                               /* pGetTextCharsetInfo */
581     NULL,                               /* pGetTextExtentExPoint */
582     NULL,                               /* pGetTextExtentExPointI */
583     NULL,                               /* pGetTextFace */
584     NULL,                               /* pGetTextMetrics */
585     NULL,                               /* pGradientFill */
586     NULL,                               /* pIntersectClipRect */
587     NULL,                               /* pInvertRgn */
588     dibdrv_LineTo,                      /* pLineTo */
589     NULL,                               /* pModifyWorldTransform */
590     NULL,                               /* pMoveTo */
591     NULL,                               /* pOffsetClipRgn */
592     NULL,                               /* pOffsetViewportOrg */
593     NULL,                               /* pOffsetWindowOrg */
594     dibdrv_PaintRgn,                    /* pPaintRgn */
595     dibdrv_PatBlt,                      /* pPatBlt */
596     NULL,                               /* pPie */
597     NULL,                               /* pPolyBezier */
598     NULL,                               /* pPolyBezierTo */
599     NULL,                               /* pPolyDraw */
600     NULL,                               /* pPolyPolygon */
601     dibdrv_PolyPolyline,                /* pPolyPolyline */
602     NULL,                               /* pPolygon */
603     dibdrv_Polyline,                    /* pPolyline */
604     NULL,                               /* pPolylineTo */
605     dibdrv_PutImage,                    /* pPutImage */
606     NULL,                               /* pRealizeDefaultPalette */
607     NULL,                               /* pRealizePalette */
608     dibdrv_Rectangle,                   /* pRectangle */
609     NULL,                               /* pResetDC */
610     NULL,                               /* pRestoreDC */
611     NULL,                               /* pRoundRect */
612     NULL,                               /* pSaveDC */
613     NULL,                               /* pScaleViewportExt */
614     NULL,                               /* pScaleWindowExt */
615     dibdrv_SelectBitmap,                /* pSelectBitmap */
616     dibdrv_SelectBrush,                 /* pSelectBrush */
617     NULL,                               /* pSelectClipPath */
618     NULL,                               /* pSelectFont */
619     NULL,                               /* pSelectPalette */
620     dibdrv_SelectPen,                   /* pSelectPen */
621     NULL,                               /* pSetArcDirection */
622     dibdrv_SetBkColor,                  /* pSetBkColor */
623     dibdrv_SetBkMode,                   /* pSetBkMode */
624     dibdrv_SetDCBrushColor,             /* pSetDCBrushColor */
625     dibdrv_SetDCPenColor,               /* pSetDCPenColor */
626     dibdrv_SetDIBColorTable,            /* pSetDIBColorTable */
627     NULL,                               /* pSetDIBitsToDevice */
628     dibdrv_SetDeviceClipping,           /* pSetDeviceClipping */
629     NULL,                               /* pSetDeviceGammaRamp */
630     NULL,                               /* pSetLayout */
631     NULL,                               /* pSetMapMode */
632     NULL,                               /* pSetMapperFlags */
633     dibdrv_SetPixel,                    /* pSetPixel */
634     NULL,                               /* pSetPixelFormat */
635     NULL,                               /* pSetPolyFillMode */
636     dibdrv_SetROP2,                     /* pSetROP2 */
637     NULL,                               /* pSetRelAbs */
638     NULL,                               /* pSetStretchBltMode */
639     NULL,                               /* pSetTextAlign */
640     NULL,                               /* pSetTextCharacterExtra */
641     NULL,                               /* pSetTextColor */
642     NULL,                               /* pSetTextJustification */
643     NULL,                               /* pSetViewportExt */
644     NULL,                               /* pSetViewportOrg */
645     NULL,                               /* pSetWindowExt */
646     NULL,                               /* pSetWindowOrg */
647     NULL,                               /* pSetWorldTransform */
648     NULL,                               /* pStartDoc */
649     NULL,                               /* pStartPage */
650     dibdrv_StretchBlt,                  /* pStretchBlt */
651     NULL,                               /* pStretchDIBits */
652     NULL,                               /* pStrokeAndFillPath */
653     NULL,                               /* pStrokePath */
654     NULL,                               /* pSwapBuffers */
655     NULL,                               /* pUnrealizePalette */
656     NULL,                               /* pWidenPath */
657     NULL,                               /* pwglCopyContext */
658     NULL,                               /* pwglCreateContext */
659     NULL,                               /* pwglCreateContextAttribsARB */
660     NULL,                               /* pwglDeleteContext */
661     NULL,                               /* pwglGetPbufferDCARB */
662     NULL,                               /* pwglGetProcAddress */
663     NULL,                               /* pwglMakeContextCurrentARB */
664     NULL,                               /* pwglMakeCurrent */
665     NULL,                               /* pwglSetPixelFormatWINE */
666     NULL,                               /* pwglShareLists */
667     NULL,                               /* pwglUseFontBitmapsA */
668     NULL                                /* pwglUseFontBitmapsW */
669 };