Remove HasColor
This commit is contained in:
parent
56bf0d759f
commit
14499e4659
2 changed files with 1 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
use cosmic_text::{Attrs, FontSystem, SwashCache, TextBuffer, TextMetrics};
|
use cosmic_text::{Attrs, FontSystem, SwashCache, TextBuffer, TextMetrics};
|
||||||
use glyphon::{Color, HasColor, Resolution, TextAtlas, TextRenderer};
|
use glyphon::{Resolution, TextAtlas, TextRenderer};
|
||||||
use wgpu::{
|
use wgpu::{
|
||||||
Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance,
|
Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance,
|
||||||
Limits, LoadOp, Operations, PresentMode, RenderPassColorAttachment, RenderPassDescriptor,
|
Limits, LoadOp, Operations, PresentMode, RenderPassColorAttachment, RenderPassDescriptor,
|
||||||
|
@ -17,20 +17,6 @@ fn main() {
|
||||||
pollster::block_on(run());
|
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;
|
static mut FONT_SYSTEM: Option<FontSystem> = None;
|
||||||
|
|
||||||
async fn run() {
|
async fn run() {
|
||||||
|
|
|
@ -26,12 +26,6 @@ pub struct Color {
|
||||||
pub a: u8,
|
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 {
|
pub(crate) enum GpuCache {
|
||||||
InAtlas { x: u16, y: u16 },
|
InAtlas { x: u16, y: u16 },
|
||||||
SkipRasterization,
|
SkipRasterization,
|
||||||
|
|
Loading…
Reference in a new issue