Huw Davies : gdi32: Make clip_line external.

Alexandre Julliard julliard at winehq.org
Tue Sep 27 13:00:07 CDT 2011


Module: wine
Branch: master
Commit: c6e483cbd1ad5bc848cd38411ebba9eef7401425
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c6e483cbd1ad5bc848cd38411ebba9eef7401425

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Sep 27 16:13:36 2011 +0100

gdi32: Make clip_line external.

---

 dlls/gdi32/dibdrv/dibdrv.h  |   24 ++++++++++++++++++------
 dlls/gdi32/dibdrv/objects.c |   11 ++---------
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h
index 3c17841..e580ba5 100644
--- a/dlls/gdi32/dibdrv/dibdrv.h
+++ b/dlls/gdi32/dibdrv/dibdrv.h
@@ -124,12 +124,15 @@ static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev )
 
 typedef struct primitive_funcs
 {
-    void        (* solid_rects)(const dib_info *dib, int num, const RECT *rc, DWORD and, DWORD xor);
-    void      (* pattern_rects)(const dib_info *dib, int num, const RECT *rc, const POINT *orign, const dib_info *brush, void *and_bits, void *xor_bits);
-    void          (* copy_rect)(const dib_info *dst, const RECT *rc, const dib_info *src, const POINT *origin, int rop2, int overlap);
-    DWORD (* colorref_to_pixel)(const dib_info *dib, COLORREF color);
-    BOOL         (* convert_to)(dib_info *dst, const dib_info *src, const RECT *src_rect);
-    BOOL   (* create_rop_masks)(const dib_info *dib, const dib_info *hatch, const rop_mask *fg, const rop_mask *bg, rop_mask_bits *bits);
+    void            (* solid_rects)(const dib_info *dib, int num, const RECT *rc, DWORD and, DWORD xor);
+    void          (* pattern_rects)(const dib_info *dib, int num, const RECT *rc, const POINT *orign,
+                                    const dib_info *brush, void *and_bits, void *xor_bits);
+    void              (* copy_rect)(const dib_info *dst, const RECT *rc, const dib_info *src,
+                                    const POINT *origin, int rop2, int overlap);
+    DWORD     (* colorref_to_pixel)(const dib_info *dib, COLORREF color);
+    BOOL             (* convert_to)(dib_info *dst, const dib_info *src, const RECT *src_rect);
+    BOOL       (* create_rop_masks)(const dib_info *dib, const dib_info *hatch,
+                                    const rop_mask *fg, const rop_mask *bg, rop_mask_bits *bits);
 } primitive_funcs;
 
 extern const primitive_funcs funcs_8888 DECLSPEC_HIDDEN;
@@ -152,6 +155,13 @@ struct rop_codes
 #define OVERLAP_ABOVE 0x04  /* dest starts above source */
 #define OVERLAP_BELOW 0x08  /* dest starts below source */
 
+typedef struct
+{
+    unsigned int dx, dy;
+    int bias;
+    DWORD octant;
+} bres_params;
+
 extern void get_rop_codes(INT rop, struct rop_codes *codes);
 extern void calc_and_xor_masks(INT rop, DWORD color, DWORD *and, DWORD *xor) DECLSPEC_HIDDEN;
 extern void update_brush_rop( dibdrv_physdev *pdev, INT rop ) DECLSPEC_HIDDEN;
@@ -171,6 +181,8 @@ extern DWORD get_fg_color(dibdrv_physdev *pdev, COLORREF color) DECLSPEC_HIDDEN;
 extern BOOL brush_rects( dibdrv_physdev *pdev, int num, const RECT *rects ) DECLSPEC_HIDDEN;
 extern HRGN add_extra_clipping_region( dibdrv_physdev *pdev, HRGN rgn ) DECLSPEC_HIDDEN;
 extern void restore_clipping_region( dibdrv_physdev *pdev, HRGN rgn ) DECLSPEC_HIDDEN;
+extern int clip_line(const POINT *start, const POINT *end, const RECT *clip,
+                     const bres_params *params, POINT *pt1, POINT *pt2) DECLSPEC_HIDDEN;
 
 static inline BOOL defer_pen(dibdrv_physdev *pdev)
 {
diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index 4833600..2dcd33a 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -288,13 +288,6 @@ static inline DWORD calc_outcode(const POINT *pt, const RECT *clip)
     return out;
 }
 
-typedef struct
-{
-    unsigned int dx, dy;
-    int bias;
-    DWORD octant;
-} bres_params;
-
 /******************************************************************************
  *                clip_line
  *
@@ -365,8 +358,8 @@ typedef struct
  * Moving end point from x2 to x2 - m find y2 - n
  *                     n = (2mdy + bias - dy - 1) / 2dx + 1
  */
-static int clip_line(const POINT *start, const POINT *end, const RECT *clip,
-                     const bres_params *params, POINT *pt1, POINT *pt2)
+int clip_line(const POINT *start, const POINT *end, const RECT *clip,
+              const bres_params *params, POINT *pt1, POINT *pt2)
 {
     int m, n;
     BOOL clipped = FALSE;




More information about the wine-cvs mailing list