• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can
5  * be found in the LICENSE file.
6  *
7  */
8 
9 #pragma once
10 
11 //
12 //
13 //
14 
15 #include "skc.h"
16 #include "assert_state.h"
17 #include "extent_ring.h" // note that these structs are *not* opaque
18 
19 //
20 //
21 //
22 
23 typedef enum skc_raster_builder_state_e {
24 
25   SKC_RASTER_BUILDER_STATE_READY,
26   SKC_RASTER_BUILDER_STATE_BUILDING
27 
28 } skc_raster_builder_state_e;
29 
30 //
31 // Construct and dispose of a raster builder and its opaque
32 // implementation.
33 //
34 
35 struct skc_raster_builder
36 {
37   struct skc_context              * context;
38 
39   struct skc_raster_builder_impl  * impl;
40 
41   skc_err                        (* add    )(struct skc_raster_builder_impl * const impl, skc_path_t const * paths, skc_uint count);
42   void                           (* end    )(struct skc_raster_builder_impl * const impl, skc_raster_t * const raster);
43   void                           (* start  )(struct skc_raster_builder_impl * const impl);
44   void                           (* force  )(struct skc_raster_builder_impl * const impl);
45   void                           (* release)(struct skc_raster_builder_impl * const impl);
46 
47   struct {
48     skc_path_t                    * extent;
49     struct skc_extent_ring          ring;
50   } path_ids;
51 
52   struct {
53     union skc_transform           * extent;
54     struct skc_extent_ring          ring;
55   } transforms;
56 
57   struct {
58     union skc_path_clip           * extent;
59     struct skc_extent_ring          ring;
60   } clips;
61 
62   struct {
63     union skc_cmd_fill            * extent;
64     struct skc_extent_ring          ring;
65   } fill_cmds;
66 
67   struct {
68     skc_raster_t                  * extent;
69     struct skc_extent_ring          ring;
70   } raster_ids;
71 
72   skc_uint                          refcount; // FIXME -- split this into host and impl refcounts
73 
74   SKC_ASSERT_STATE_DECLARE(skc_raster_builder_state_e);
75 };
76 
77 //
78 //
79 //
80