My stab at CI (#66)
This commit is contained in:
+12
-20
@@ -19,23 +19,17 @@ workspace = true
|
||||
[features]
|
||||
default = ["font-kit", "wayland", "x11", "windows-manifest"]
|
||||
test-support = [
|
||||
"leak-detection",
|
||||
"collections/test-support",
|
||||
"wayland",
|
||||
"x11",
|
||||
"proptest",
|
||||
"leak-detection",
|
||||
"collections/test-support",
|
||||
"wayland",
|
||||
"x11",
|
||||
"proptest",
|
||||
]
|
||||
inspector = ["gpui_macros/inspector"]
|
||||
leak-detection = ["backtrace"]
|
||||
wayland = [
|
||||
"bitflags",
|
||||
]
|
||||
x11 = [
|
||||
"scap?/x11",
|
||||
]
|
||||
screen-capture = [
|
||||
"scap",
|
||||
]
|
||||
wayland = ["bitflags"]
|
||||
x11 = ["scap?/x11"]
|
||||
screen-capture = ["scap"]
|
||||
windows-manifest = ["dep:embed-resource"]
|
||||
input-latency-histogram = ["dep:hdrhistogram"]
|
||||
|
||||
@@ -76,10 +70,10 @@ regex.workspace = true
|
||||
refineable.workspace = true
|
||||
scheduler.workspace = true
|
||||
resvg = { version = "0.45.0", default-features = false, features = [
|
||||
"text",
|
||||
"system-fonts",
|
||||
"memmap-fonts",
|
||||
"raster-images"
|
||||
"text",
|
||||
"system-fonts",
|
||||
"memmap-fonts",
|
||||
"raster-images",
|
||||
] }
|
||||
usvg = { version = "0.45.0", default-features = false }
|
||||
ttf-parser = "0.25"
|
||||
@@ -140,7 +134,6 @@ pathfinder_geometry = "0.5"
|
||||
scap = { workspace = true, optional = true }
|
||||
|
||||
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
windows = { version = "0.61", features = ["Win32_Foundation"] }
|
||||
|
||||
@@ -159,7 +152,6 @@ scheduler = { workspace = true, features = ["test-support"] }
|
||||
unicode-segmentation = { workspace = true }
|
||||
|
||||
|
||||
|
||||
[target.'cfg(target_family = "wasm")'.dev-dependencies]
|
||||
wasm-bindgen = { workspace = true }
|
||||
gpui_web.workspace = true
|
||||
|
||||
@@ -138,9 +138,11 @@ fn content_blurred_rich() -> impl IntoElement {
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.gap_3()
|
||||
.children([0xef4444, 0x22c55e, 0x3b82f6].into_iter().map(|hex| {
|
||||
div().w(px(48.)).h(px(48.)).rounded_md().bg(rgb(hex))
|
||||
}))
|
||||
.children(
|
||||
[0xef4444, 0x22c55e, 0x3b82f6]
|
||||
.into_iter()
|
||||
.map(|hex| div().w(px(48.)).h(px(48.)).rounded_md().bg(rgb(hex))),
|
||||
)
|
||||
}
|
||||
|
||||
/// Nested content blur: a `blur()` element inside another `blur()` element. The inner block is
|
||||
|
||||
@@ -22,6 +22,7 @@ use itertools::Itertools;
|
||||
use parking_lot::RwLock;
|
||||
use slotmap::SlotMap;
|
||||
|
||||
use crate::http_client::{HttpClient, NullHttpClient};
|
||||
pub use async_context::*;
|
||||
use collections::{FxHashMap, FxHashSet, HashMap, VecDeque};
|
||||
pub use context::*;
|
||||
@@ -29,7 +30,6 @@ pub use entity_map::*;
|
||||
use gpui_util::{ResultExt, debug_panic};
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub use headless_app_context::*;
|
||||
use crate::http_client::{HttpClient, NullHttpClient};
|
||||
use smallvec::SmallVec;
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub use test_app::*;
|
||||
@@ -2710,8 +2710,6 @@ pub struct KeystrokeEvent {
|
||||
pub context_stack: Vec<KeyContext>,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A mutable reference to an entity owned by GPUI
|
||||
pub struct GpuiBorrow<'a, T> {
|
||||
inner: Option<Lease<T>>,
|
||||
|
||||
@@ -618,25 +618,24 @@ impl Asset for ImageAssetLoader {
|
||||
async move {
|
||||
let bytes = match source.clone() {
|
||||
Resource::Path(uri) => fs::read(uri.as_ref())?,
|
||||
Resource::Uri(uri) => {
|
||||
use anyhow::Context as _;
|
||||
Resource::Uri(uri) => {
|
||||
use anyhow::Context as _;
|
||||
|
||||
let response = client
|
||||
.get(uri.as_ref(), true)
|
||||
.await
|
||||
.with_context(|| format!("loading image asset from {uri:?}"))?;
|
||||
if !response.status.is_success() {
|
||||
let mut error_body =
|
||||
String::from_utf8_lossy(&response.body).into_owned();
|
||||
let first_line = error_body.lines().next().unwrap_or("").trim_end();
|
||||
error_body.truncate(first_line.len());
|
||||
return Err(ImageCacheError::BadStatus {
|
||||
uri,
|
||||
status: response.status,
|
||||
body: error_body,
|
||||
});
|
||||
}
|
||||
response.body
|
||||
let response = client
|
||||
.get(uri.as_ref(), true)
|
||||
.await
|
||||
.with_context(|| format!("loading image asset from {uri:?}"))?;
|
||||
if !response.status.is_success() {
|
||||
let mut error_body = String::from_utf8_lossy(&response.body).into_owned();
|
||||
let first_line = error_body.lines().next().unwrap_or("").trim_end();
|
||||
error_body.truncate(first_line.len());
|
||||
return Err(ImageCacheError::BadStatus {
|
||||
uri,
|
||||
status: response.status,
|
||||
body: error_body,
|
||||
});
|
||||
}
|
||||
response.body
|
||||
}
|
||||
Resource::Embedded(path) => {
|
||||
let data = asset_source.load(&path).ok().flatten();
|
||||
|
||||
@@ -40,12 +40,12 @@ impl Clone for SurfaceSource {
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for SurfaceSource {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match *self {
|
||||
#[cfg(target_os = "macos")]
|
||||
SurfaceSource::Surface(ref buf) => f.debug_tuple("Surface").field(buf).finish(),
|
||||
SurfaceSource::Surface(ref buf) => _f.debug_tuple("Surface").field(buf).finish(),
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
SurfaceSource::Texture { size, .. } => f
|
||||
SurfaceSource::Texture { size, .. } => _f
|
||||
.debug_struct("Texture")
|
||||
.field("size", &size)
|
||||
.finish_non_exhaustive(),
|
||||
@@ -124,27 +124,27 @@ impl Element for Surface {
|
||||
&mut self,
|
||||
_global_id: Option<&GlobalElementId>,
|
||||
_inspector_id: Option<&InspectorElementId>,
|
||||
bounds: Bounds<Pixels>,
|
||||
_bounds: Bounds<Pixels>,
|
||||
_: &mut Self::RequestLayoutState,
|
||||
_: &mut Self::PrepaintState,
|
||||
window: &mut Window,
|
||||
_window: &mut Window,
|
||||
_: &mut App,
|
||||
) {
|
||||
match self.source {
|
||||
#[cfg(target_os = "macos")]
|
||||
SurfaceSource::Surface(ref surface) => {
|
||||
let size = crate::size(surface.get_width().into(), surface.get_height().into());
|
||||
let new_bounds = self.object_fit.get_bounds(bounds, size);
|
||||
let new_bounds = self.object_fit.get_bounds(_bounds, size);
|
||||
// TODO: Add support for corner_radii
|
||||
window.paint_surface(new_bounds, surface.clone());
|
||||
_window.paint_surface(new_bounds, surface.clone());
|
||||
}
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
SurfaceSource::Texture {
|
||||
ref texture,
|
||||
ref size,
|
||||
} => {
|
||||
let new_bounds = self.object_fit.get_bounds(bounds, *size);
|
||||
window.paint_surface(new_bounds, Arc::clone(texture), *size);
|
||||
let new_bounds = self.object_fit.get_bounds(_bounds, *size);
|
||||
_window.paint_surface(new_bounds, Arc::clone(texture), *size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ use crate::{
|
||||
CornersRefinement, CursorStyle, DefiniteLength, DevicePixels, Edges, EdgesRefinement, Font,
|
||||
FontFallbacks, FontFeatures, FontStyle, FontWeight, GridLocation, Hsla, Length, Pixels, Point,
|
||||
PointRefinement, Rgba, ScaledPixels, SharedString, Size, SizeRefinement, Styled, TextRun,
|
||||
Window, black, phi,
|
||||
point, quad, rems, size,
|
||||
Window, black, phi, point, quad, rems, size,
|
||||
};
|
||||
use collections::HashSet;
|
||||
use refineable::Refineable;
|
||||
|
||||
@@ -702,7 +702,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_state_with_point() {
|
||||
let initial: Point<f32> = Point { x: 10.0, y: 20.0 };
|
||||
let state = TransitionState::new(initial.clone());
|
||||
let state = TransitionState::new(initial);
|
||||
|
||||
assert_eq!(state.initial_goal.x, 10.0);
|
||||
assert_eq!(state.initial_goal.y, 20.0);
|
||||
|
||||
@@ -13,13 +13,12 @@ use crate::{
|
||||
PolychromeSprite, Priority, PromptButton, PromptLevel, Quad, Render, RenderGlyphParams,
|
||||
RenderImage, RenderImageParams, RenderSvgParams, Replay, ResizeEdge, SMOOTH_SVG_SCALE_FACTOR,
|
||||
SUBPIXEL_VARIANTS_X, SUBPIXEL_VARIANTS_Y, ScaledFilter, ScaledPixels, Scene, Shadow,
|
||||
SharedString, Size,
|
||||
StrikethroughStyle, Style, SubpixelSprite, SubscriberSet, Subscription, SystemWindowTab,
|
||||
SystemWindowTabController, TabStopMap, TaffyLayoutEngine, Task, TextRenderingMode, TextStyle,
|
||||
TextStyleRefinement, ThermalState, TransformationMatrix, Transition, TransitionState,
|
||||
Underline, UnderlineStyle, WindowAppearance, WindowBackgroundAppearance, WindowBounds,
|
||||
WindowControls, WindowDecorations, WindowOptions, WindowParams, WindowTextSystem, point,
|
||||
prelude::*, px, rems, size, transparent_black,
|
||||
SharedString, Size, StrikethroughStyle, Style, SubpixelSprite, SubscriberSet, Subscription,
|
||||
SystemWindowTab, SystemWindowTabController, TabStopMap, TaffyLayoutEngine, Task,
|
||||
TextRenderingMode, TextStyle, TextStyleRefinement, ThermalState, TransformationMatrix,
|
||||
Transition, TransitionState, Underline, UnderlineStyle, WindowAppearance,
|
||||
WindowBackgroundAppearance, WindowBounds, WindowControls, WindowDecorations, WindowOptions,
|
||||
WindowParams, WindowTextSystem, point, prelude::*, px, rems, size, transparent_black,
|
||||
};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use collections::{FxHashMap, FxHashSet};
|
||||
|
||||
Reference in New Issue
Block a user