diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-04-26 18:10:56 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-04-26 19:49:13 +0100 |
commit | 20610dc28ee3cf7e64ad46f11e9b96fb3befba00 (patch) | |
tree | caf1ecd133beea5ab478858fc8f022081912ab89 /base/gdevoflt.c | |
parent | edd20b3b8c3c1a7117dd5dbee0b54cd1de7838bf (diff) | |
download | ghostpdl-20610dc28ee3cf7e64ad46f11e9b96fb3befba00.tar.gz |
Split initialize device proc into two.
The device initialize function currently performs 2 jobs. Firstly,
it fills out the device_procs. Secondly, it performs any minimal
initialization required by the device (typically none).
At various points in the code we want to be able to copy procs
from one 'prototype' device to another, so we call initialize
for that. This populates the device procs, but does other work
that typically requires a 'derived device' structure rather
than a vanilla gx_device to work in.
Accordingly, we split the job into two; initialize_device_procs
(the first part) and initialize_device (the second part). The
initialize_device_procs function will set up the initialize_device
function pointer along with the rest if required.
Diffstat (limited to 'base/gdevoflt.c')
-rw-r--r-- | base/gdevoflt.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/base/gdevoflt.c b/base/gdevoflt.c index 4772d7422..72958467b 100644 --- a/base/gdevoflt.c +++ b/base/gdevoflt.c @@ -87,13 +87,10 @@ RELOC_PTRS_END public_st_obj_filter_device(); -static int -obj_filter_initialize(gx_device *dev) +static void +obj_filter_initialize_device_procs(gx_device *dev) { - int code = default_subclass_initialize(dev); - - if (code < 0) - return code; + default_subclass_initialize_device_procs(dev); set_dev_proc(dev, fill_rectangle, obj_filter_fill_rectangle); set_dev_proc(dev, fill_path, obj_filter_fill_path); @@ -115,8 +112,6 @@ obj_filter_initialize(gx_device *dev) set_dev_proc(dev, strip_copy_rop2, obj_filter_strip_copy_rop2); set_dev_proc(dev, strip_tile_rect_devn, obj_filter_strip_tile_rect_devn); set_dev_proc(dev, fill_stroke_path, obj_filter_fill_stroke_path); - - return 0; } const @@ -125,7 +120,8 @@ gx_device_obj_filter gs_obj_filter_device = /* * Define the device as 8-bit gray scale to avoid computing halftones. */ - std_device_dci_type_body(gx_device_obj_filter, obj_filter_initialize, + std_device_dci_type_body(gx_device_obj_filter, + obj_filter_initialize_device_procs, "object_filter", &st_obj_filter_device, MAX_COORD, MAX_COORD, MAX_RESOLUTION, MAX_RESOLUTION, |