From 4359d529121fc1f39f882693d641c0133d138d41 Mon Sep 17 00:00:00 2001 From: Allan MacKinnon Date: Tue, 19 Jun 2018 13:57:04 -0700 Subject: Skia Compute core files Bug: skia: Change-Id: I4bba49cf20eff013e581800a3f114c85acd8498c Reviewed-on: https://skia-review.googlesource.com/135782 Reviewed-by: Mike Klein Reviewed-by: Mike Reed Commit-Queue: Mike Klein --- src/compute/skc/raster_builder.h | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/compute/skc/raster_builder.h (limited to 'src/compute/skc/raster_builder.h') diff --git a/src/compute/skc/raster_builder.h b/src/compute/skc/raster_builder.h new file mode 100644 index 0000000000..9996a2bfd7 --- /dev/null +++ b/src/compute/skc/raster_builder.h @@ -0,0 +1,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); +}; + +// +// +// -- cgit v1.2.3