Image loading method and device
First Claim
Patent Images
1. An image loading method, comprising:
- determining whether a native heap memory stores decoded data of a first image to be loaded based on cache record information of the native heap memory, wherein the cache record information of the native heap memory is stored in a Java heap memory, wherein the decoded data of the first image includes pixel array data obtained by decoding the first image;
in response to determining that the native heap memory stores the decoded data of the first image, loading the first image based on the decoded data of the first image from the native heap memory by;
determining whether a bitmap object currently displayed on an image view and corresponding to a second image satisfies a reuse condition for the decoded data of the first image by comparing a product of a width of the second image, a height of the second image, and a amount of memory occupied by each pixel of the second image to a data length of the decoded data of the first image, andin response to determining that the bitmap object currently displayed on the image view satisfies the reuse condition, copying the pixel array data from the native heap memory into the bitmap object currently displayed on the image view to obtain a new bitmap object, and rendering the new bitmap object into the image view to load the first image; and
in response to determining that the native heap memory does not store the decoded data of the first image, loading the first image from a storage space storing the first image, and storing, into the native heap memory, decoded data of the first image obtained in the process of loading the first image.
3 Assignments
0 Petitions
Accused Products
Abstract
This application discloses an image loading method and device. The image loading method may comprise: determining whether a native heap memory stores decoded data of an image to be loaded; in response to determining that the native heap memory stores the decoded data of the image, loading the image based on the decoded data of the image from the native heap memory; and in response to determining that the native heap memory does not store the decoded data of the image, loading the image from a storage space storing the image, and storing, into the native heap memory, decoded data of the image obtained in the process of loading the image.
20 Citations
20 Claims
-
1. An image loading method, comprising:
-
determining whether a native heap memory stores decoded data of a first image to be loaded based on cache record information of the native heap memory, wherein the cache record information of the native heap memory is stored in a Java heap memory, wherein the decoded data of the first image includes pixel array data obtained by decoding the first image; in response to determining that the native heap memory stores the decoded data of the first image, loading the first image based on the decoded data of the first image from the native heap memory by; determining whether a bitmap object currently displayed on an image view and corresponding to a second image satisfies a reuse condition for the decoded data of the first image by comparing a product of a width of the second image, a height of the second image, and a amount of memory occupied by each pixel of the second image to a data length of the decoded data of the first image, and in response to determining that the bitmap object currently displayed on the image view satisfies the reuse condition, copying the pixel array data from the native heap memory into the bitmap object currently displayed on the image view to obtain a new bitmap object, and rendering the new bitmap object into the image view to load the first image; and in response to determining that the native heap memory does not store the decoded data of the first image, loading the first image from a storage space storing the first image, and storing, into the native heap memory, decoded data of the first image obtained in the process of loading the first image. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. An image loading device comprising one or more processors and one or more non-transitory computer-readable memories coupled to the one or more processors and configured with instructions executable by the one or more processors to cause the device to perform operations comprising:
-
determining whether a native heap memory stores decoded data of a first image to be loaded based on cache record information of the native heap memory, wherein the cache record information of the native heap memory is stored in a Java heap memory, wherein the decoded data of the first image includes pixel array data obtained by decoding the first image; in response to determining that the native heap memory stores the decoded data of the first image, loading the first image based on the decoded data of the first image from the native heap memory by; determining whether a bitmap object currently displayed on an image view and corresponding to a second image satisfies a reuse condition for the decoded data of the first image by comparing a product of a width of the second image, a height of the second image, and a amount of memory occupied by each pixel of the second image to a data length of the decoded data of the first image, and in response to determining that the bitmap object currently displayed on the image view satisfies the reuse condition, copying the pixel array data from the native heap memory into the bitmap object currently displayed on the image view to obtain a new bitmap object, and rendering the new bitmap object into the image view to load the first image; and in response to determining that the native heap memory does not store the decoded data of the first image, loading the first image from a storage space storing the first image, and storing, into the native heap memory, decoded data of the first image obtained in the process of loading the first image. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15)
-
-
16. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform operations comprising:
-
determining whether a native heap memory stores decoded data of a first image to be loaded based on cache record information of the native heap memory, wherein the cache record information of the native heap memory is stored in a Java heap memory, wherein the decoded data of the first image includes pixel array data obtained by decoding the first image; in response to determining that the native heap memory stores the decoded data of the first image, loading the first image based on the decoded data of the first image from the native heap memory by; determining whether a bitmap object currently displayed on an image view and corresponding to a second image satisfies a reuse condition for the decoded data of the first image by comparing a product of a width of the second image, a height of the second image, and a amount of memory occupied by each pixel of the second image to a data length of the decoded data of the first image, and in response to determining that the bitmap object currently displayed on the image view satisfies the reuse condition, copying the pixel array data from the native heap memory into the bitmap object currently displayed on the image view to obtain a new bitmap object, and rendering the new bitmap object into the image view to load the first image; and in response to determining that the native heap memory does not store the decoded data of the first image, loading the first image from a storage space storing the first image, and storing, into the native heap memory, decoded data of the first image obtained in the process of loading the first image. - View Dependent Claims (17, 18, 19, 20)
-
Specification