Remove HasColor

This commit is contained in:
grovesNL 2022-10-28 01:15:02 -02:30 committed by Josh Groves
parent 56bf0d759f
commit 14499e4659
2 changed files with 1 additions and 21 deletions

View file

@ -1,5 +1,5 @@
use cosmic_text::{Attrs, FontSystem, SwashCache, TextBuffer, TextMetrics};
use glyphon::{Color, HasColor, Resolution, TextAtlas, TextRenderer};
use glyphon::{Resolution, TextAtlas, TextRenderer};
use wgpu::{
Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance,
Limits, LoadOp, Operations, PresentMode, RenderPassColorAttachment, RenderPassDescriptor,
@ -17,20 +17,6 @@ fn main() {
pollster::block_on(run());
}
#[derive(Clone, Copy)]
struct GlyphUserData;
impl HasColor for GlyphUserData {
fn color(&self) -> Color {
Color {
r: 255,
g: 255,
b: 0,
a: 255,
}
}
}
static mut FONT_SYSTEM: Option<FontSystem> = None;
async fn run() {

View file

@ -26,12 +26,6 @@ pub struct Color {
pub a: u8,
}
/// Allows text to be colored during rendering.
pub trait HasColor: Copy {
/// The color to use when rendering text.
fn color(&self) -> Color;
}
pub(crate) enum GpuCache {
InAtlas { x: u16, y: u16 },
SkipRasterization,