public AGSImageComponent(IHasImage image, IGraphicsFactory factory, IRenderPipeline pipeline,
IGLTextureRenderer renderer, ITextureCache textures,
ITextureFactory textureFactory)
{
IsImageVisible = true;
_getTextureFunc = textureFactory.CreateTexture; //Creating a delegate in advance to avoid memory allocations on critical path
_textures = textures;
_colorBuilder = new GLColor();
_image = image;
_factory = factory;
_colorAdjusters = new IHasImage[2];
_image.PropertyChanged += onPropertyChanged;
_pipeline = pipeline;
_boxesPool = new ObjectPool<AGSBoundingBoxes>(_ => new AGSBoundingBoxes(), 2);
_instructionPool = new ObjectPool<Instruction>(instructionPool => new Instruction(instructionPool, _boxesPool, renderer), 2);
}