Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDecompose tiled images during frame building (v3) #2704
Conversation
|
We'll also want to resolve the reftest failures @staktrace mentioned here #2644 (comment). Thanks for addressing all those comments from the previous review! |
|
There's a heap of CI tests failing too - maybe something went wrong during rebasing? Probably around half of the reftests fail, until it crashes at:
|
|
Getting close!
|
It would seem more efficient to apply tile spacing in the second blit and avoid the memory overhead of baking the tile spacing in the first render task, but clearing seems to be handled differently on the two blits (absent in the second).
…owing any tile.
|
Another try run with the fixes from #2664: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f726753e0a776525670067356227edb9a7112389 |
|
The remaining 3 failing reftests all go through the the tile decomposition code path with a large scroll offset applied. All of them render nothing on screen (they do produce tiles but I suspect these tiles are off-screen). The tests pass if I remove the scroll offset in the tests and the references which seems to imply I got this piece wrong somehow: In prim_store.rs: fn compute_conservative_visible_rect(
prim_run_context: &PrimitiveRunContext,
frame_context: &FrameBuildingContext,
local_clip_rect: &LayoutRect,
) -> LayoutRect {
let world_screen_rect = prim_run_context
.clip_chain.combined_outer_screen_rect
.to_f32() / frame_context.device_pixel_scale;
if let Some(layer_screen_rect) = prim_run_context
.scroll_node
.world_content_transform
.unapply(&world_screen_rect) {
return local_clip_rect.intersection(&layer_screen_rect).unwrap_or(LayoutRect::zero());
}
*local_clip_rect
}If anyone understands webrender's coordinate systems somewhat and has a vague idea of what I missed, please let me know. |
|
It looks like it was actually for_each_tile() that was wrong. |
|
This fixes all the failing tests: diff --git a/gfx/webrender/src/image.rs b/gfx/webrender/src/image.rs
index 181cb566fd1e..d1f3811b3631 100644
--- a/gfx/webrender/src/image.rs
+++ b/gfx/webrender/src/image.rs
@@ -195,22 +195,22 @@ pub fn for_each_tile(
if y == y_count - 1 {
row_flags |= EdgeAaSegmentMask::BOTTOM;
}
for x in 0..x_count {
let tile_offset = t0 + vec2(x, y);
let mut segment_rect = LayoutRect {
origin: LayoutPoint::new(
- x0 + tile_offset.x as f32 * layer_tile_size.width,
- y0 + tile_offset.y as f32 * layer_tile_size.height,
+ prim_rect.origin.x + tile_offset.x as f32 * layer_tile_size.width,
+ prim_rect.origin.y + tile_offset.y as f32 * layer_tile_size.height,
),
size: layer_tile_size,
};
if tile_offset.x == leftover_offset.x {
segment_rect.size.width = leftover_layer_size.width;
}
if tile_offset.y == leftover_offset.y {
segment_rect.size.height = leftover_layer_size.height; |
|
Also, the |
|
Here's a version of this that's been rebased and should pass the tests: |
|
I'm going to move to a different pull request for now. |
Decompose tiled images during frame building (v4) This is a continuation of #2704 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2742) <!-- Reviewable:end -->
|
Closing since tiled images v4 PR landed. |
nical commentedApr 27, 2018
•
edited by larsbergstrom
This PR implements decomposing tiled images during frame building using visibility information to avoid issues with very large blob images.
This version does not use segments, avoiding issues with the maximum contiguous gpu cache alloc size as well as a few hacks that I had to write to get repetitions to work with segments.
As a bonus the non-brush image primitive and ps_image shader are now obsolete so I removed them.
This change is