mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 00:32:45 +00:00 
			
		
		
		
	LibWeb: Remove transform interpolation optimization
The property values here will always be StyleValueLists and not TransformationStyleValues. The handling of interpolation in this case gets quite a bit more complex, so let's just remove the dead code for now and attempt this optimization again in the future if it's needed.
This commit is contained in:
		
							parent
							
								
									ee1d8a534d
								
							
						
					
					
						commit
						1f88ca2a03
					
				
					 1 changed files with 1 additions and 19 deletions
				
			
		|  | @ -1141,26 +1141,8 @@ static ErrorOr<ValueComparingNonnullRefPtr<StyleValue const>> interpolate_proper | ||||||
|     case AnimationType::None: |     case AnimationType::None: | ||||||
|         return to; |         return to; | ||||||
|     case AnimationType::Custom: { |     case AnimationType::Custom: { | ||||||
|         if (property_id == PropertyID::Transform) { |         if (property_id == PropertyID::Transform) | ||||||
|             // Try to optimize same-function interpolation
 |  | ||||||
|             if (from.is_transformation() && to.is_transformation()) { |  | ||||||
|                 auto& from_transform = from.as_transformation(); |  | ||||||
|                 auto& to_transform = to.as_transformation(); |  | ||||||
|                 if (from_transform.transform_function() == to_transform.transform_function()) { |  | ||||||
|                     auto from_input_values = from_transform.values(); |  | ||||||
|                     auto to_input_values = to_transform.values(); |  | ||||||
|                     if (from_input_values.size() == to_input_values.size()) { |  | ||||||
|                         StyleValueVector interpolated_values; |  | ||||||
|                         interpolated_values.ensure_capacity(from_input_values.size()); |  | ||||||
|                         for (size_t i = 0; i < from_input_values.size(); ++i) |  | ||||||
|                             interpolated_values.append(TRY(interpolate_value(element, *from_input_values[i], *to_input_values[i], delta))); |  | ||||||
| 
 |  | ||||||
|                         return TransformationStyleValue::create(from_transform.transform_function(), move(interpolated_values)); |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|             return interpolate_transform(element, from, to, delta); |             return interpolate_transform(element, from, to, delta); | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         // FIXME: Handle all custom animatable properties
 |         // FIXME: Handle all custom animatable properties
 | ||||||
|         [[fallthrough]]; |         [[fallthrough]]; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Matthew Olsson
						Matthew Olsson