+ if( mAuxiliaryPixelBuffer )
+ {
+ // If the auxiliary image is smaller than the un-stretched NPatch, use CPU resizing to enlarge it to the
+ // same size as the unstretched NPatch. This will give slightly higher quality results than just relying
+ // on GL interpolation alone.
+ if( mAuxiliaryPixelBuffer.GetWidth() < data->croppedWidth &&
+ mAuxiliaryPixelBuffer.GetHeight() < data->croppedHeight )
+ {
+ mAuxiliaryPixelBuffer.Resize( data->croppedWidth, data->croppedHeight );
+ }
+
+ // Note, this resets mAuxiliaryPixelBuffer handle
+ auto auxiliaryPixelData = Devel::PixelBuffer::Convert( mAuxiliaryPixelBuffer );
+
+ auto texture = Texture::New( TextureType::TEXTURE_2D,
+ auxiliaryPixelData.GetPixelFormat(), auxiliaryPixelData.GetWidth(),
+ auxiliaryPixelData.GetHeight() );
+ texture.Upload( auxiliaryPixelData );
+ textureSet.SetTexture( 1, texture );
+ DevelHandle::RegisterProperty( mImpl->mRenderer, DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
+ AUXILIARY_IMAGE_ALPHA_NAME, mAuxiliaryImageAlpha );
+ }
+ mImpl->mRenderer.SetTextures( textureSet );
+
+ // Register transform properties