aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compute/skc/raster_builder.h
blob: 9996a2bfd7a69f35661d40f2da69391a91f8dda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can
 * be found in the LICENSE file.
 *
 */

#pragma once

//
//
//

#include "skc.h"
#include "assert_state.h"
#include "extent_ring.h" // note that these structs are *not* opaque

//
//
//

typedef enum skc_raster_builder_state_e {

  SKC_RASTER_BUILDER_STATE_READY,
  SKC_RASTER_BUILDER_STATE_BUILDING

} skc_raster_builder_state_e;

//
// Construct and dispose of a raster builder and its opaque
// implementation.
//

struct skc_raster_builder
{
  struct skc_context              * context;

  struct skc_raster_builder_impl  * impl;

  skc_err                        (* add    )(struct skc_raster_builder_impl * const impl, skc_path_t const * paths, skc_uint count);
  void                           (* end    )(struct skc_raster_builder_impl * const impl, skc_raster_t * const raster);
  void                           (* start  )(struct skc_raster_builder_impl * const impl);
  void                           (* force  )(struct skc_raster_builder_impl * const impl);
  void                           (* release)(struct skc_raster_builder_impl * const impl);

  struct {
    skc_path_t                    * extent;
    struct skc_extent_ring          ring;
  } path_ids;

  struct {
    union skc_transform           * extent;
    struct skc_extent_ring          ring;
  } transforms;

  struct {
    union skc_path_clip           * extent;
    struct skc_extent_ring          ring;
  } clips;

  struct {
    union skc_cmd_fill            * extent;
    struct skc_extent_ring          ring;
  } fill_cmds;

  struct {
    skc_raster_t                  * extent;
    struct skc_extent_ring          ring;
  } raster_ids;

  skc_uint                          refcount; // FIXME -- split this into host and impl refcounts

  SKC_ASSERT_STATE_DECLARE(skc_raster_builder_state_e);
};

//
//
//