summaryrefslogtreecommitdiffstats
path: root/gfx/cairo/cairo/src/win32/cairo-win32-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/cairo/cairo/src/win32/cairo-win32-surface.c')
-rw-r--r--gfx/cairo/cairo/src/win32/cairo-win32-surface.c82
1 files changed, 38 insertions, 44 deletions
diff --git a/gfx/cairo/cairo/src/win32/cairo-win32-surface.c b/gfx/cairo/cairo/src/win32/cairo-win32-surface.c
index e1e6494cce..9cd6f55fcc 100644
--- a/gfx/cairo/cairo/src/win32/cairo-win32-surface.c
+++ b/gfx/cairo/cairo/src/win32/cairo-win32-surface.c
@@ -37,15 +37,6 @@
* Vladimir Vukicevic <vladimir@pobox.com>
*/
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
#include "cairoint.h"
#include "cairo-backend-private.h"
@@ -171,46 +162,50 @@ cairo_win32_surface_get_dc (cairo_surface_t *surface)
return NULL;
}
+/**
+ * cairo_win32_get_dc_with_clip:
+ * (Mozilla addition)
+ */
HDC
-cairo_win32_get_dc_with_clip (cairo_t *cr)
+cairo_win32_get_dc_with_clip(cairo_t* cr)
{
- cairo_surface_t *surface = cairo_get_target (cr);
- if (cr->backend->type == CAIRO_TYPE_DEFAULT) {
- cairo_default_context_t *c = (cairo_default_context_t *) cr;
- cairo_clip_t *clip = _cairo_clip_copy (_cairo_gstate_get_clip (c->gstate));
- if (_cairo_surface_is_win32 (surface)) {
- cairo_win32_display_surface_t *winsurf = (cairo_win32_display_surface_t *) surface;
+ cairo_surface_t* surface = cairo_get_target(cr);
+ if (cr->backend->type == CAIRO_TYPE_DEFAULT) {
+ cairo_default_context_t* c = (cairo_default_context_t*)cr;
+ cairo_clip_t* clip = _cairo_clip_copy(_cairo_gstate_get_clip(c->gstate));
+ if (_cairo_surface_is_win32(surface)) {
+ cairo_win32_display_surface_t* winsurf = (cairo_win32_display_surface_t*)surface;
- _cairo_win32_display_surface_set_clip (winsurf, clip);
+ _cairo_win32_display_surface_set_clip(winsurf, clip);
- _cairo_clip_destroy (clip);
- return winsurf->win32.dc;
- }
+ _cairo_clip_destroy(clip);
+ return winsurf->win32.dc;
+ }
- if (_cairo_surface_is_paginated (surface)) {
- cairo_surface_t *target;
+ if (_cairo_surface_is_paginated(surface)) {
+ cairo_surface_t* target;
- target = _cairo_paginated_surface_get_target (surface);
+ target = _cairo_paginated_surface_get_target(surface);
#ifndef CAIRO_OMIT_WIN32_PRINTING
- if (_cairo_surface_is_win32_printing (target)) {
- cairo_status_t status;
- cairo_win32_printing_surface_t *psurf = (cairo_win32_printing_surface_t *) target;
+ if (_cairo_surface_is_win32_printing(target)) {
+ cairo_status_t status;
+ cairo_win32_printing_surface_t* psurf = (cairo_win32_printing_surface_t*)target;
- status = _cairo_surface_clipper_set_clip (&psurf->clipper, clip);
+ status = _cairo_surface_clipper_set_clip(&psurf->clipper, clip);
- _cairo_clip_destroy (clip);
+ _cairo_clip_destroy(clip);
- if (status)
- return NULL;
+ if (status)
+ return NULL;
- return psurf->win32.dc;
- }
+ return psurf->win32.dc;
+ }
#endif
- }
- _cairo_clip_destroy (clip);
}
- return NULL;
+ _cairo_clip_destroy(clip);
+ }
+ return NULL;
}
/**
@@ -390,16 +385,15 @@ _cairo_win32_surface_emit_glyphs (cairo_win32_surface_t *dst,
#undef STACK_GLYPH_SIZE
cairo_status_t
-cairo_win32_surface_get_size (const cairo_surface_t *surface, int *width, int *height)
+cairo_win32_surface_get_size(const cairo_surface_t* surface, int* width, int* height)
{
- if (surface->type != CAIRO_SURFACE_TYPE_WIN32)
- return CAIRO_STATUS_SURFACE_TYPE_MISMATCH;
+ if (!_cairo_surface_is_win32(surface))
+ return CAIRO_STATUS_SURFACE_TYPE_MISMATCH;
- const cairo_win32_surface_t *winsurface = (const cairo_win32_surface_t *) surface;
+ const cairo_win32_surface_t* winsurface = (const cairo_win32_surface_t*)surface;
- *width = winsurface->extents.width;
- *height = winsurface->extents.height;
-
- return CAIRO_STATUS_SUCCESS;
-}
+ *width = winsurface->extents.width;
+ *height = winsurface->extents.height;
+ return CAIRO_STATUS_SUCCESS;
+} \ No newline at end of file