mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:12:44 +00:00 
			
		
		
		
	 2198091bbc
			
		
	
	
		2198091bbc
		
	
	
	
	
		
			
			After this change, LibWeb now expects Web::ImageDecoding::Decoder to be pre-initialized with a concrete implementation before using the webpage. The previous implementation, based on the ImageDecoder service, has been provided directly through an adapter in LibWebClient, and is now used as the default value by WebContent.
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/NonnullRefPtr.h>
 | |
| #include <LibWeb/ImageDecoding.h>
 | |
| 
 | |
| namespace ImageDecoderClient {
 | |
| class Client;
 | |
| }
 | |
| 
 | |
| namespace WebView {
 | |
| 
 | |
| class ImageDecoderClientAdapter : public Web::ImageDecoding::Decoder {
 | |
| public:
 | |
|     static NonnullRefPtr<ImageDecoderClientAdapter> create();
 | |
| 
 | |
|     virtual ~ImageDecoderClientAdapter() override = default;
 | |
| 
 | |
|     virtual Optional<Web::ImageDecoding::DecodedImage> decode_image(ReadonlyBytes) override;
 | |
| 
 | |
| private:
 | |
|     explicit ImageDecoderClientAdapter() = default;
 | |
| 
 | |
|     RefPtr<ImageDecoderClient::Client> m_client;
 | |
| };
 | |
| 
 | |
| }
 |