mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	 45f86466bb
			
		
	
	
		45f86466bb
		
	
	
	
	
		
			
			Works for fills and strokes (using colors, gradients, or patterns), along with images. fill_rect() has been updated to use fill_path(), which allows it to easily transform the rect, and already supports opacity. Co-authored-by: MacDue <macdue@dueutil.tech>
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			471 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			471 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/HTML/ImageData.h>
 | |
| 
 | |
| namespace Web::HTML {
 | |
| 
 | |
| // https://html.spec.whatwg.org/multipage/canvas.html#canvascompositing
 | |
| class CanvasCompositing {
 | |
| public:
 | |
|     virtual ~CanvasCompositing() = default;
 | |
| 
 | |
|     virtual float global_alpha() const = 0;
 | |
|     virtual void set_global_alpha(float) = 0;
 | |
| 
 | |
| protected:
 | |
|     CanvasCompositing() = default;
 | |
| };
 | |
| 
 | |
| }
 |