~vcs-imports/libcairo/trunk

« back to all changes in this revision

Viewing changes to src/win32/cairo-win32-display-surface.c

  • Committer: Bryce Harrington
  • Date: 2018-02-06 23:13:00 UTC
  • Revision ID: git-v1:dbe3d9ea517da51e6be5a19d87f2d02176f0ba00
win32: Whitespace cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        goto FAIL;
215
215
 
216
216
    surface->bitmap = CreateDIBSection (surface->win32.dc,
217
 
                                        bitmap_info,
218
 
                                        DIB_RGB_COLORS,
219
 
                                        &bits,
220
 
                                        NULL, 0);
 
217
                                        bitmap_info,
 
218
                                        DIB_RGB_COLORS,
 
219
                                        &bits,
 
220
                                        NULL, 0);
221
221
    if (!surface->bitmap)
222
222
        goto FAIL;
223
223
 
289
289
static cairo_surface_t *
290
290
_cairo_win32_display_surface_create_for_dc (HDC             original_dc,
291
291
                                            cairo_format_t  format,
292
 
                                            int             width,
293
 
                                            int             height)
 
292
                                            int             width,
 
293
                                            int             height)
294
294
{
295
295
    cairo_status_t status;
296
296
    cairo_device_t *device;
325
325
    surface->win32.extents.y = 0;
326
326
    surface->win32.extents.width = width;
327
327
    surface->win32.extents.height = height;
328
 
    surface->win32.x_ofs = 0; 
 
328
    surface->win32.x_ofs = 0;
329
329
    surface->win32.y_ofs = 0;
330
330
 
331
331
    surface->initial_clip_rgn = NULL;
634
634
    surface->win32.extents.height = rect.bottom - rect.top;
635
635
 
636
636
    /* On multi-monitor setup, under Windows, the primary monitor always
637
 
     * have origin (0,0).  Any monitors that extends to the left or above 
 
637
     * have origin (0,0).  Any monitors that extends to the left or above
638
638
     * will have coordinates in the negative range.  Take this into
639
 
     * account, by forcing our Win32 surface to start at extent (0,0) and 
640
 
     * using a device offset.  Cairo does not handle extents with negative 
 
639
     * account, by forcing our Win32 surface to start at extent (0,0) and
 
640
     * using a device offset.  Cairo does not handle extents with negative
641
641
     * offsets.
642
 
     */ 
 
642
     */
643
643
    surface->win32.x_ofs = 0;
644
644
    surface->win32.y_ofs = 0;
645
645
    if ((surface->win32.extents.x < 0) ||
646
646
        (surface->win32.extents.y < 0)) {
647
647
        /* Negative offsets occurs for (and ONLY for) the desktop DC (virtual
648
 
         * desktop), when a monitor extend to the left or above the primary 
649
 
         * monitor. 
650
 
         *  
651
 
         * More info @ https://www.microsoft.com/msj/0697/monitor/monitor.aspx 
652
 
         *  
653
 
         * Note that any other DC, including memory DC created with 
 
648
         * desktop), when a monitor extend to the left or above the primary
 
649
         * monitor.
 
650
         *
 
651
         * More info @ https://www.microsoft.com/msj/0697/monitor/monitor.aspx
 
652
         *
 
653
         * Note that any other DC, including memory DC created with
654
654
         * CreateCompatibleDC(<virtual desktop DC>) will have extents in the
655
 
         * positive range.  This will be taken into account later when we perform 
656
 
         * raster operations between the DC (may have to perform offset 
 
655
         * positive range.  This will be taken into account later when we perform
 
656
         * raster operations between the DC (may have to perform offset
657
657
         * translation).
658
658
         */
659
659
        surface->win32.x_ofs = surface->win32.extents.x;