forma_render/gpu/
mod.rs

1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15mod conveyor_sort;
16mod painter;
17mod rasterizer;
18mod renderer;
19mod style_map;
20
21pub(crate) use style_map::StyleMap;
22
23pub use self::renderer::{Renderer, Timings};
24
25pub(crate) struct TimeStamp<'qs> {
26    query_set: &'qs wgpu::QuerySet,
27    start_index: u32,
28    end_index: u32,
29}
30pub(crate) trait GpuContext {
31    type Data<'s>;
32
33    fn init(device: &wgpu::Device) -> Self;
34    fn encode(
35        &self,
36        device: &wgpu::Device,
37        encoder: &mut wgpu::CommandEncoder,
38        time_stamp: Option<TimeStamp>,
39        data: &mut Self::Data<'_>,
40    );
41}