mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	chase wlroots: simplify transforms in scene-helpers (MR 4819/4845)
Ref: 009515161bd97d8f920d72d31ef462f2608688e8
("scene: Only accept buffer coordinates for damage")
Note:
MR 4819 is immediately followed by MR 4845.
MR 4819 removes return value of wlr_damage_ring_add().
MR 4845 applies applies buffer-local coordinates for
scene_output->damage_ring instead of transformed coordinates.
			
			
This commit is contained in:
		
							parent
							
								
									6caa2a8830
								
							
						
					
					
						commit
						2b1923c867
					
				
					 2 changed files with 11 additions and 27 deletions
				
			
		| 
						 | 
					@ -48,30 +48,21 @@ lab_wlr_scene_get_prev_node(struct wlr_scene_node *node)
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
scene_output_damage(struct wlr_scene_output *scene_output,
 | 
					scene_output_damage(struct wlr_scene_output *scene_output,
 | 
				
			||||||
		const pixman_region32_t *region)
 | 
							const pixman_region32_t *damage)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	wlr_damage_ring_add(&scene_output->damage_ring, region);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	struct wlr_output *output = scene_output->output;
 | 
						struct wlr_output *output = scene_output->output;
 | 
				
			||||||
	enum wl_output_transform transform =
 | 
					 | 
				
			||||||
		wlr_output_transform_invert(scene_output->output->transform);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int width = output->width;
 | 
						pixman_region32_t clipped;
 | 
				
			||||||
	int height = output->height;
 | 
						pixman_region32_init(&clipped);
 | 
				
			||||||
	if (transform & WL_OUTPUT_TRANSFORM_90) {
 | 
						pixman_region32_intersect_rect(&clipped, damage, 0, 0, output->width, output->height);
 | 
				
			||||||
		width = output->height;
 | 
					
 | 
				
			||||||
		height = output->width;
 | 
						if (pixman_region32_not_empty(&clipped)) {
 | 
				
			||||||
 | 
							wlr_damage_ring_add(&scene_output->damage_ring, &clipped);
 | 
				
			||||||
 | 
							pixman_region32_union(&scene_output->pending_commit_damage,
 | 
				
			||||||
 | 
								&scene_output->pending_commit_damage, &clipped);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pixman_region32_t frame_damage;
 | 
						pixman_region32_fini(&clipped);
 | 
				
			||||||
	pixman_region32_init(&frame_damage);
 | 
					 | 
				
			||||||
	wlr_region_transform(&frame_damage, region, transform, width, height);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pixman_region32_union(&scene_output->pending_commit_damage,
 | 
					 | 
				
			||||||
		&scene_output->pending_commit_damage, &frame_damage);
 | 
					 | 
				
			||||||
	pixman_region32_intersect_rect(&scene_output->pending_commit_damage,
 | 
					 | 
				
			||||||
		&scene_output->pending_commit_damage, 0, 0, output->width, output->height);
 | 
					 | 
				
			||||||
	pixman_region32_fini(&frame_damage);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -141,13 +132,6 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output,
 | 
				
			||||||
		pixman_region32_init_rect(®ion,
 | 
							pixman_region32_init_rect(®ion,
 | 
				
			||||||
			additional_damage.x, additional_damage.y,
 | 
								additional_damage.x, additional_damage.y,
 | 
				
			||||||
			additional_damage.width, additional_damage.height);
 | 
								additional_damage.width, additional_damage.height);
 | 
				
			||||||
		/*
 | 
					 | 
				
			||||||
		 * Region passed to scene_output_damage() should have the same
 | 
					 | 
				
			||||||
		 * scale as the output buffer but have a different transform.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		wlr_region_transform(®ion, ®ion, wlr_output->transform,
 | 
					 | 
				
			||||||
			wlr_output->width, wlr_output->height);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		scene_output_damage(scene_output, ®ion);
 | 
							scene_output_damage(scene_output, ®ion);
 | 
				
			||||||
		pixman_region32_fini(®ion);
 | 
							pixman_region32_fini(®ion);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
[wrap-git]
 | 
					[wrap-git]
 | 
				
			||||||
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
 | 
					url = https://gitlab.freedesktop.org/wlroots/wlroots.git
 | 
				
			||||||
revision = 502eb38d80eb5a273f5481ec8559cb35d726f5da
 | 
					revision = 009515161bd97d8f920d72d31ef462f2608688e8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[provide]
 | 
					[provide]
 | 
				
			||||||
dependency_names = wlroots-0.19
 | 
					dependency_names = wlroots-0.19
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue