Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture atlas #154

Merged
merged 23 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1bcfc9a
Implemented a texture atlas for images and svgs.
Maldela Jan 10, 2020
743637e
Merged image and svg texture atlases into one owned by the image pipe…
Maldela Jan 10, 2020
82e0675
Some small debug changes
Maldela Jan 11, 2020
8562a4c
Fixed texture bleeding
Maldela Jan 12, 2020
2f77a6b
Use array of atlases instead of one growing indefinitely.
Maldela Jan 13, 2020
3f38835
Implement allocating large images across multiple texture array layers.
Maldela Jan 16, 2020
c099692
Batch image draw calls into one with multiple instances
Maldela Jan 17, 2020
2f695ef
Updated shaders and removed debug_stub_derive dependency
Maldela Jan 17, 2020
8f9f44b
When deallocating the last allocation in an allocator mark its layer …
Maldela Jan 18, 2020
4617da2
Implemented automatic deallocation of texture space for dropped alloc…
Maldela Jan 19, 2020
82f0a49
Recompile `image` shaders
hecrj Feb 25, 2020
59d45a5
Refactor texture atlas
hecrj Feb 26, 2020
c58d94f
Avoid creating a vertex buffer every frame
hecrj Feb 26, 2020
48d7028
Fix multiple issues from the refactoring
hecrj Feb 26, 2020
d06d06e
Deallocate atlas entries and remove padding
hecrj Feb 26, 2020
883a9f2
Add `env_logger` to `svg` example
hecrj Feb 26, 2020
6cb7fb6
Remove unused code warnings in `iced_wgpu::image`
hecrj Feb 26, 2020
deedf6e
Make new `texture` module private for now
hecrj Feb 26, 2020
271725f
Derive `Debug` for `raster::Memory`
hecrj Feb 26, 2020
bb397cc
Move `Debug` implementation for `vector::Svg`
hecrj Feb 26, 2020
fc55e3a
Move `Atlas::deallocate` after `allocate`
hecrj Feb 26, 2020
4e7159c
Stop creating image pipeline when unnecessary
hecrj Feb 28, 2020
88d4cd0
Remove unnecessary `pub(crate) use`
hecrj Feb 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ publish = false

[dependencies]
iced = { path = "../..", features = ["svg"] }
env_logger = "0.7"
11 changes: 8 additions & 3 deletions examples/svg/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg};

pub fn main() {
env_logger::init();

Tiger::run(Settings::default())
}

Expand All @@ -22,9 +24,12 @@ impl Sandbox for Tiger {

fn view(&mut self) -> Element<()> {
let content = Column::new().padding(20).push(
Svg::new(format!("{}/resources/tiger.svg", env!("CARGO_MANIFEST_DIR")))
.width(Length::Fill)
.height(Length::Fill),
Svg::new(format!(
"{}/resources/tiger.svg",
env!("CARGO_MANIFEST_DIR")
))
.width(Length::Fill)
.height(Length::Fill),
);

Container::new(content)
Expand Down
2 changes: 1 addition & 1 deletion native/src/widget/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::{
/// ```
///
/// <img src="https://github.com/hecrj/iced/blob/9712b319bb7a32848001b96bd84977430f14b623/examples/resources/ferris.png?raw=true" width="300">
#[derive(Debug)]
#[derive(Debug, Hash)]
pub struct Image {
handle: Handle,
width: Length,
Expand Down
1 change: 1 addition & 0 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ raw-window-handle = "0.3"
glam = "0.8"
font-kit = "0.4"
log = "0.4"
guillotiere = "0.4"

[dependencies.image]
version = "0.22"
Expand Down
Loading