mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	screencopy: check if damage committed before copy
This check avoids copying stale state from output->pending.damage.
This commit is contained in:
		
							parent
							
								
									1ecc1b5987
								
							
						
					
					
						commit
						37cb3eb8dd
					
				
					 1 changed files with 6 additions and 7 deletions
				
			
		| 
						 | 
					@ -51,15 +51,14 @@ static void screencopy_damage_accumulate(struct screencopy_damage *damage) {
 | 
				
			||||||
	int width, height;
 | 
						int width, height;
 | 
				
			||||||
	wlr_output_transformed_resolution(output, &width, &height);
 | 
						wlr_output_transformed_resolution(output, &width, &height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// If the compositor did not submit damage but did submit a buffer,
 | 
						if (output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) {
 | 
				
			||||||
	if (!(output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) &&
 | 
							// If the compositor submitted damage, copy it over
 | 
				
			||||||
			(output->pending.committed & WLR_OUTPUT_STATE_BUFFER)) {
 | 
					 | 
				
			||||||
		// damage everything
 | 
					 | 
				
			||||||
		pixman_region32_union_rect(region, region, 0, 0, width, height);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		// otherwise copy over the current damage
 | 
					 | 
				
			||||||
		pixman_region32_union(region, region, &output->pending.damage);
 | 
							pixman_region32_union(region, region, &output->pending.damage);
 | 
				
			||||||
		pixman_region32_intersect_rect(region, region, 0, 0, width, height);
 | 
							pixman_region32_intersect_rect(region, region, 0, 0, width, height);
 | 
				
			||||||
 | 
						} else if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
 | 
				
			||||||
 | 
							// If the compositor did not submit damage but did submit a buffer
 | 
				
			||||||
 | 
							// damage everything
 | 
				
			||||||
 | 
							pixman_region32_union_rect(region, region, 0, 0, width, height);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	damage->last_commit_seq = output->commit_seq;
 | 
						damage->last_commit_seq = output->commit_seq;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue