Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to internal BitmapPool #31

Closed
savvasdalkitsis opened this issue Nov 4, 2013 · 4 comments
Closed

Access to internal BitmapPool #31

savvasdalkitsis opened this issue Nov 4, 2013 · 4 comments

Comments

@savvasdalkitsis
Copy link
Contributor

I was wondering if it would be possible to expose the BitmapPool held implicitly by the ImageHandler through the ImageResizer reference.

Basically, what I am after, is to reuse the instance of the pool that Glide is using internally. in my own transformations so that I do not generate Bitmaps that could be reused later on by the system.

@sjudd
Copy link
Collaborator

sjudd commented Nov 4, 2013

I'm not necessarily opposed to it, my only hesitation is that the pool is only useful if you not only get bitmaps from, but also put bitmaps back in. Otherwise you just drain the pool and it doesn't really provide any benefits.

Have you taken a look at the Transformation interface (https://github.com/bumptech/glide/blob/master/library/src/com/bumptech/glide/resize/load/Transformation.java)? That currently passes in the bitmap pool for you to use if you can apply your transformations as you're loading the images. It has the added benefit of being run asynchronously on Glide's framework.

@savvasdalkitsis
Copy link
Contributor Author

I am aware of that. The problem is that at some points in our code, we want to use the transformations directly, not via Glide. It would be nice if we could pass in the same BitmapPool that Glide is using.

@sjudd
Copy link
Collaborator

sjudd commented Nov 4, 2013

Got it, from our offline discussion, I'll add a Glide.getBitmapPool method with well documented caveats, unless you or anyone else has a better thought.

@sjudd
Copy link
Collaborator

sjudd commented Nov 5, 2013

Fixed: 0d1005f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants