File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/ImageSharp/Processing/Processors/Transforms/Resize Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,8 @@ private ResizeKernelMap(
5151 this . DestinationLength = destinationLength ;
5252 this . MaxDiameter = ( radius * 2 ) + 1 ;
5353
54- if ( ResizeKernel . IsHardwareAccelerated )
55- {
56- this . data = memoryAllocator . Allocate2D < float > ( this . MaxDiameter * 4 , bufferHeight , preferContiguosImageBuffers : true ) ;
57- }
58- else
59- {
60- this . data = memoryAllocator . Allocate2D < float > ( this . MaxDiameter , bufferHeight , preferContiguosImageBuffers : true ) ;
61- }
62-
54+ int diameter = ResizeKernel . IsHardwareAccelerated ? this . MaxDiameter * 4 : this . MaxDiameter ;
55+ this . data = memoryAllocator . Allocate2D < float > ( diameter , bufferHeight , preferContiguosImageBuffers : true ) ;
6356 this . pinHandle = this . data . DangerousGetSingleMemory ( ) . Pin ( ) ;
6457 this . kernels = new ResizeKernel [ destinationLength ] ;
6558 this . tempValues = new float [ this . MaxDiameter ] ;
You can’t perform that action at this time.
0 commit comments