CN105427236A - Method and device for image rendering - Google Patents

Method and device for image rendering Download PDF

Info

Publication number
CN105427236A
CN105427236A CN201510971103.7A CN201510971103A CN105427236A CN 105427236 A CN105427236 A CN 105427236A CN 201510971103 A CN201510971103 A CN 201510971103A CN 105427236 A CN105427236 A CN 105427236A
Authority
CN
China
Prior art keywords
image
gpu
memory headroom
program
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510971103.7A
Other languages
Chinese (zh)
Inventor
朱和泉
崔英云
黄涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meizu Technology China Co Ltd
Original Assignee
Meizu Technology China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Meizu Technology China Co Ltd filed Critical Meizu Technology China Co Ltd
Priority to CN201510971103.7A priority Critical patent/CN105427236A/en
Publication of CN105427236A publication Critical patent/CN105427236A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/28Indexing scheme for image data processing or generation, in general involving image processing hardware

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a method and device for image rendering, wherein the method comprises that a GPU (Graphic Processing Unit) receives an instruction for the image rendering sent by a CPU (Central Processing Unit); the instruction contains an identifier of a to-be-rendered image; the GPU reads a bitmap image corresponding to the identifier in memory space which can be accessed by application programs and the GPU; and the GPU renders the bitmap image. By implementing the embodiment of the invention, the memory space can be saved; the problem about frequent process standstill caused by frequent memory distribution can be avoided; and the image rendering efficiency can be increased.

Description

A kind of image rendering method and device
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of image rendering method and device.
Background technology
At present, the interface of the software application of Android android system can use CPU or GPU to play up, and conventional Rendering operations is directly presented in one piece of internal memory by scene, and scene by after drawing function loading video memory, then is delivered to display and shown.And in order to realize some special effects, such as common environment mappings, just needs render to texture, carry out texture Rendering operations.Rendering operations depends on two core components usually: central processing unit (CentralProcessingUnit, referred to as " CPU ") and graphic process unit (GraphicProcessingUnit, referred to as " GPU "), CPU is responsible for comprising measurement (Measure), layout (Layout), record (Record), performing calculating operations such as (Execute), and GPU is responsible for the operations such as rasterizing (Rasterization).Rasterizing is the fundamental operation drawing bitmap (Bitmap) assembly, Bitmap assembly can be split in different pixels show by rasterizing.
In actual applications, when carrying out image rendering operations, generally can preserve two number certificates, it is kept in the internal memory of Java Virtual Machine distribution and the internal memory of GPU distribution respectively.Concrete, data bitmap can be stored in the internal memory of Java Virtual Machine distribution by function when android system processes image; And GPU device drives operates in the space that oneself distributes, thus when adopting GPU to play up data bitmap, need the space bitmap images duplicate copy in Java Virtual Machine distributed to this GPU, to carry out image rendering, the internal memory of GPU additional allocation that what it took is.That is, at present when carrying out image rendering, the internal memory that Java Virtual Machine distributes and the internal memory that GPU distributes all save a data bitmap, and this just causes the waste of memory headroom.And, under current image rendering operations, Java Virtual Machine and GPU all need internally to deposit into row distribution, the frequent triggering of Memory Allocation easily causes process to occur the phenomenon that frequent card pauses, and the bitmap copy in the internal memory distributed by Java Virtual Machine will need in the internal memory of GPU additional allocation to spend the longer time.
Summary of the invention
Embodiments provide a kind of image rendering method and device, can memory headroom be saved, avoid causing because internal memory frequently distributes process frequently to block the problem of timing, and the efficiency of image rendering can be improved.
The embodiment of the invention discloses a kind of image rendering method, comprising:
Graphic process unit GPU receives the instruction of the rendering image that central processor CPU sends, and described instruction comprises the mark of image to be rendered;
Described GPU reads and identifies corresponding bitmap images with described in the memory headroom that can be employed program and described GPU access;
Described GPU plays up institute's bit map images.
Optionally, described GPU plays up institute's bit map images, comprising:
Institute's bit map images is played up as texture image by described GPU.
Optionally, described GPU can be employed to read in the memory headroom that program and described GPU access with described identify corresponding bitmap images before, described method also comprises:
Create the described memory headroom that can be employed program and described GPU access.
Optionally, described method also comprises:
Described CPU stores institute's bit map images described can being employed in the memory headroom of program and described GPU access.
Optionally, the described memory headroom that can be employed program and described GPU access is the kernel spacing that figure memory management equipment ION creates.
Correspondingly, the embodiment of the invention also discloses a kind of image rendering device, comprising:
Instruction reception unit, for receiving the instruction of the rendering image that central processor CPU sends, described instruction comprises the mark of image to be rendered;
Image fetching unit, identifies corresponding bitmap images for reading in the memory headroom that can be employed program and described GPU access with described;
Image rendering unit, plays up for the institute's bit map images read described image fetching unit.
Optionally, described image rendering unit specifically for:
Institute's bit map images is played up as texture image.
Optionally, described device also comprises:
Creating unit, for creating the described memory headroom that can be employed program and described GPU access.
Optionally, described device also comprises:
Storage unit, for storing institute's bit map images described can being employed in the memory headroom of program and described GPU access.
Optionally, the described memory headroom that can be employed program and described GPU access is the kernel spacing that figure memory management equipment ION creates.
Implement the embodiment of the present invention, there is following beneficial effect:
In embodiments of the present invention, GPU can when the instruction receiving rendering image, the mark of the image to be rendered carried according to this instruction reads the bitmap images of this mark correspondence from the memory headroom that preset application program and GPU all can be accessed, and plays up process to this bitmap images of reading.The described image rendering method of the embodiment of the present invention only needs bitmap images to be kept at application program and the equal memory headroom that can access of GPU, and without the need to preserving two number certificates again, thus save memory headroom, and GPU is by reading the bitmap images in this space, and do not need copy image, therefore improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of a kind of image rendering method that the embodiment of the present invention provides;
Fig. 2 is the schematic flow sheet of the another kind of image rendering method that the embodiment of the present invention provides;
Fig. 3 is the structural representation of a kind of image rendering device that the embodiment of the present invention provides;
Fig. 4 is the structural representation of the another kind of image rendering device that the embodiment of the present invention provides;
Fig. 5 is the structural representation of a kind of terminal that the embodiment of the present invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of image rendering method, device and terminal, can memory headroom be saved, avoid causing because of the frequent triggering of Memory Allocation process frequently to block the problem of timing.Below describe in detail respectively.
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of a kind of image rendering method that the embodiment of the present invention provides, concrete, and as shown in Figure 1, the described image rendering method of the embodiment of the present invention can comprise the following steps:
The instruction of the rendering image that 101: graphic process unit GPU reception central processor CPU sends, described instruction comprises the mark of image to be rendered.
Should be understood that the described method of the embodiment of the present invention can be applicable to be configured with in the terminal of GPU.This terminal can include but not limited to smart mobile phone (as Android phone, iOS mobile phone etc.), panel computer, mobile internet device (MobileInternetDevices, be called for short " MID "), personal digital assistant (PersonalDigitalAssistant, be called for short " PDA "), PC etc.
Concrete, can receive after user opens the operation of image in terminal, the CPU in terminal generates the instruction of rendering image, and this instruction is sent to the GPU in terminal.
Wherein, the mark of described image to be rendered can be the title, image ID (identification), store path etc. that need the image played up, and the embodiment of the present invention does not limit.
102: described GPU can be employed to read in the memory headroom that program and described GPU access to identify corresponding bitmap images with described.
In linux system, a part of kernel software is independent of common applications, and operate on higher privilege level, they can reside on protected memory headroom, and have all authorities of access hardware devices, this is called kernel spacing by Linux.Correspondingly, application program is then run in " user's space ".The application program operating in user's space only can use the part system resource of permission, and can not use some specific systemic-function, can not directly access kernel space and hardware device.Thus, for meeting some specific demands, can be pre-created and obtain a memory headroom, this memory headroom is the space that application program and this GPU all can access, such as, this memory headroom can be kernel (Kernel) space of the pre-first to file of figure memory management equipment ION.Thus the internal memory distributed without the need to the internal memory that distributed by user's space and Java Virtual Machine again and GPU when carrying out image rendering operations stores double data bitmap, and the memory headroom only all can need accessed in this application program and GPU store a data bitmap.
That is, the memory headroom that the program that can be employed in embodiments of the present invention and described GPU access, can be accessed by CPU and GPU simultaneously, image decoding to be rendered is stored in this memory headroom after bitmap images by CPU, and be no longer the user's space distributed stored in CPU, therefore expand the scope that this Partial Bitmap image is accessed or be read.
103: described GPU plays up institute's bit map images.
Concrete, the memory headroom reading all can accessed in this application program and GPU can realize the Rendering operations to this bitmap images after obtaining the bitmap images of mark correspondence of image to be rendered, and exports display to and show this rendering effect.
In embodiments of the present invention, GPU can when the instruction receiving rendering image, the mark of the image to be rendered carried according to this instruction reads the bitmap images of this mark correspondence from the memory headroom that preset application program and GPU all can be accessed, and plays up process to this bitmap images of reading.The described image rendering method of the embodiment of the present invention only needs the memory headroom all can accessed in application program and GPU, and without the need to preserving two number certificates again, also without the need to again bitmap images being copied in the internal memory of GPU distribution, thus save memory headroom, and improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
Further, refer to Fig. 2, Fig. 2 is the schematic flow sheet of the another kind of image rendering method that the embodiment of the present invention provides, concrete, and as shown in Figure 2, the described image rendering method of the embodiment of the present invention can comprise the following steps:
201: create the memory headroom that can be employed program and graphic process unit GPU access.
Wherein, the kernel spacing that the described memory headroom that can be employed program and described GPU access can create for figure memory management equipment ION, i.e. internal memory shared buffer GraphicBuffer, this memory headroom both may be user's space, also may be kernel spacing, certainly except being created by ION, also can be created by other parts.Wherein, ION is the module for memory management introduced by Android android, this ION module is extendible (API (ApplicationProgrammingInterface, application programming interface) be all unified), it supports various forms of memory allocate way (support comprises continuously and the distribution of discontinuous internal memory), and ION provides corresponding APIs to kernel (Kernel) and user's space (Userspace) process processes.
It should be noted that, ION refers to that the special kernel Kernel for figure storage allocation drives, and the internal memory of ION application belongs to kernel spacing.Concrete, by arranging lock (namely locking) or unlock (i.e. non-locking) to internal memory shared buffer GraphicBuffer, make the application program in terminal can access by this lock and unlock the data be stored in the GraphicBuffer of this internal memory shared buffer very easily, GPU can access the data be stored in the GraphicBuffer of this internal memory shared buffer too simultaneously, when reading and writing GraphicBuffer, lock is carried out to GraphicBuffer, read and write and rear unlock has been carried out to GraphicBuffer, concrete, application program can access described memory headroom when described memory headroom is in lock state, and described memory headroom can not be accessed when described memory headroom is in unlock state.GPU can directly use the internal storage data of this internal memory shared buffer GraphicBuffer as texture, and user's space also can this internal memory shared buffer of direct read/write this block internal memory of GraphicBuffer.
Optionally, bitmap memory allocator Allocator is utilized to go application memory pixel, this internal memory is the internal memory applied for by ION, also referred to as GraphicBuffer in Android, and gives bitmap pixels manager SkPixelRef this GraphicBuffer and manages.SkBitmap is a bitmap class in 2D vector graphics process function library Skia, and it encapsulates the sequence of operations action relevant to bitmap, thus can realize hardware-accelerated to the blitter in Skia by SkBitmap.Allocator is the embedded class of SkBitmap class, Allocator class and SkPixelRef class in close relations, Allocator class provides typed Memory Allocation, the distribution of object and cancelling of object, the internal memory that Allocator distributes is by SkPixelRef process reference count, the corresponding SkPixelRef of each Allocator, usually after storage allocation success, called SkPixelRef to bind by Allocator, when acquiescence, SkBitmap uses SkMallocPixelRef (a kind of SkPixelRef class) and HeapAllocator (a kind of Allocator class) to carry out pairing and binding.If so other utilization derive from Allocator class and internally deposit into row and distribute, usually also need that derivation SkPixelRef class is corresponding with deriving from Allocator class binds.
Further, make mistakes to prevent internal memory, when terminal utilizes the SkPixelRef class of SkBitmap internally to deposit into row distribution, or, after storage allocation success, Allocator calls SkPixelRef to carry out in binding procedure, directly can copy (or being called " copy ") whole object, instead of copy with using the form directive property of pointer.This copies and refers to and can not cause copying of the lightweight of Efficacy Problem, due to the logic having some built-in when carrying out Memory Allocation, binding, when especially employing reference count, can avoid multiple copying, also add lock mechanism equally.In addition, the memory headroom that this bitmap image data takies can be determined by outside, or the size of the kernel spacing that this bitmap image data takies can be obtained by system assignment.
202:CPU can be employed storage bitmap image in the memory headroom of program and described GPU access described.
Further, after ION creates kernel spacing and internal memory shared buffer GraphicBuffer, namely storage bitmap (Bitmap) data are carried out by this internal memory shared buffer GraphicBuffer.Concrete, the data bitmap be stored in the GraphicBuffer of internal memory shared buffer can be encapsulated as shared data and store, so that application program and GPU are to the access of institute's bit-map data.And due to this internal memory shared buffer GraphicBuffer can be employed program and GPU access, therefore only need preserve a data bitmap at this internal memory shared buffer GraphicBuffer and can complete image rendering operations, and protect double data without the need to the internal memory distributed by Java Virtual Machine and GPU oneself again.Wherein, shared data are a kind of by open shape library OpenGL (OpenGraphicsLibrary), or the shared resource type that vector image algorithm standard rules OpenVG (OpenVectorGraphics) etc. creates, be used to indicate shared 2D view data, application program and relevant customer interface can create the shared data of any type based on any object.
203: described GPU receives the instruction of the rendering image that central processor CPU sends, and described instruction comprises the mark of image to be rendered.
Optionally, described mark can be the title, the ID (identification) of image, the store path of image etc. of image, and the embodiment of the present invention does not limit.
204: described GPU can be employed to read in the memory headroom of program and described GPU access to identify corresponding bitmap images with described described.
Institute's bit map images is played up as texture image by 205: described GPU.
In specific embodiment, after this application program and the equal memory headroom that can access of GPU read the bitmap images of the mark correspondence entrained by the instruction obtaining this rendering image, this bitmap images can be played up as texture image, after drawing function loading video memory, image after this being played up by Present function is again exported in display and shows, with the sense of reality of enhanced scene.
In embodiments of the present invention, the memory headroom being pre-created and can being employed program and GPU access can be led to, and by this memory headroom storage bitmap image, make GPU when the instruction receiving rendering image, the mark of the image to be rendered that can carry according to this instruction reads the bitmap images of this mark correspondence as image to be rendered from the memory headroom that preset application program and GPU all can be accessed, thus carries out texture to this bitmap images of reading and play up process.The embodiment of the present invention is directly kept in this newly-built memory headroom by the bitmap images of being decoded by CPU, make GPU from this memory headroom, directly can read bitmap, no longer need the copy of data bitmap, namely without the need to preserving two number certificates again, thus save memory headroom, and improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
Refer to Fig. 3, Fig. 3 is the structural representation of a kind of image rendering device that the embodiment of the present invention provides, concrete, as shown in Figure 3, the described image rendering device of the embodiment of the present invention can comprise instruction reception unit 11, image fetching unit 12 and image rendering unit 13; Wherein,
Described instruction reception unit 11, for receiving the instruction of the rendering image that central processor CPU sends, described instruction comprises the mark of image to be rendered.
Should be understood that the described image rendering device of the embodiment of the present invention can specifically be arranged to be configured with in the terminal of GPU.This terminal can include but not limited to smart mobile phone (as Android phone, iOS mobile phone etc.), panel computer, mobile internet device (MobileInternetDevices, be called for short " MID "), personal digital assistant (PersonalDigitalAssistant, be called for short " PDA "), PC etc.
Wherein, the mark of described image to be rendered can be the title, image ID (identification), store path etc. that need the image played up, and the embodiment of the present invention does not limit.
Concrete, the instruction of this rendering image can be receive after user opens the operation of image in terminal, and the instruction of the rendering image generated by the CPU in terminal, after generating this instruction, this instruction is sent to the GPU in terminal by this CPU.
Described image fetching unit 12, identifies corresponding bitmap images for reading in the memory headroom that can be employed program and described GPU access with described.
Wherein, the described memory headroom that can be employed program and described GPU access can be the kernel spacing of figure memory management equipment ION establishment.
Described image rendering unit 13, plays up for the institute's bit map images read described image fetching unit 12.
Concrete, after the memory headroom reading all can accessed from this application program and GPU at image fetching unit 12 obtains the bitmap images of mark correspondence of image to be rendered, image rendering unit 13 can realize the Rendering operations to this bitmap images, and exports display to and show this rendering effect.
Instruction reception unit 11 in the device provided in embodiments of the present invention receives the instruction of rendering image, the mark of the image to be rendered that image fetching unit 12 carries according to this instruction when instruction reception unit 11 receives this instruction reads the bitmap images of this mark correspondence from the memory headroom that preset application program and GPU all can be accessed, and this bitmap images of image rendering unit 13 pairs of image fetching units 12 readings plays up process.The described image rendering method of the embodiment of the present invention only needs the memory headroom all can accessed in application program and GPU, and without the need to preserving two number certificates again, also without the need to again bitmap images being copied in the internal memory of GPU distribution, thus save memory headroom, and improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
Further, refer to Fig. 4, Fig. 4 is the structural representation of the another kind of image rendering device that the embodiment of the present invention provides, concrete, as shown in Figure 4, the described device of the embodiment of the present invention can comprise the instruction reception unit 11 of the image rendering device in the corresponding embodiment of above-mentioned Fig. 3, image fetching unit 12 and image rendering unit 13.Further, in embodiments of the present invention, this image rendering device also can comprise:
Creating unit 14, for creating the described memory headroom that can be employed program and described GPU access.
Wherein, the kernel spacing that the described memory headroom that can be employed program and described GPU access can create for figure memory management equipment ION, i.e. internal memory shared buffer GraphicBuffer, this memory headroom both may be user's space, also may be kernel spacing, certainly except being created by ION, also can be created by other parts.
Concrete, internal memory shared buffer GraphicBuffer by creating creating unit 14 arranges lock and unlock, make the application program in terminal can access by this lock and unlock the data be stored in the GraphicBuffer of this internal memory shared buffer very easily, GPU can access the data be stored in the GraphicBuffer of this internal memory shared buffer too simultaneously, when reading and writing GraphicBuffer, lock is carried out to GraphicBuffer, read and write and rear unlock has been carried out to GraphicBuffer, concrete, application program can access described memory headroom when described memory headroom is in lock state, and described memory headroom can not be accessed when described memory headroom is in unlock state.GPU can directly use the internal storage data of this internal memory shared buffer GraphicBuffer as texture, and user's space also can this internal memory shared buffer of direct read/write this block internal memory of GraphicBuffer.
Further, in embodiments of the present invention, described device also can comprise:
Storage unit 15, for storing institute's bit map images described can being employed in the memory headroom of program and described GPU access.
Further, after creating unit 14 calls ION establishment kernel spacing and internal memory shared buffer GraphicBuffer, namely storage unit 15 carrys out storage bitmap (Bitmap) data by this internal memory shared buffer GraphicBuffer.Concrete, the data bitmap be stored in the GraphicBuffer of internal memory shared buffer can be encapsulated as shared data and store by storage unit 15, so that application program and GPU are to the access of institute's bit-map data.And due to this internal memory shared buffer GraphicBuffer can be employed program and GPU access, therefore only need preserve a data bitmap at this internal memory shared buffer GraphicBuffer and can complete image rendering operations, and protect double data without the need to the internal memory distributed by Java Virtual Machine and GPU oneself again.
Further, in embodiments of the present invention, described image rendering unit 13 can be specifically for:
Institute's bit map images is played up as texture image.
In specific embodiment, the instruction of rendering image is received at instruction reception unit 11, and after reading the bitmap images of the mark correspondence entrained by the instruction obtaining this rendering image by image fetching unit 12 from the bitmap images that storage unit 15 stores the memory headroom that this application program and GPU all can be accessed, this bitmap images can be played up as texture image by image rendering unit 13, be loaded into after video memory by drawing function, then the image after this being played up by Present function is exported in display and shows.With the sense of reality of enhanced scene.
In embodiments of the present invention, the memory headroom being pre-created and can being employed program and GPU access can be led to, and by this memory headroom storage bitmap image, make GPU when the instruction receiving rendering image, the mark of the image to be rendered that can carry according to this instruction reads the bitmap images of this mark correspondence as image to be rendered from the memory headroom that preset application program and GPU all can be accessed, thus carries out texture to this bitmap images of reading and play up process.The embodiment of the present invention is directly kept in this newly-built memory headroom by the bitmap images of being decoded by CPU, make GPU from this memory headroom, directly can read bitmap, no longer need the copy of data bitmap, namely without the need to preserving two number certificates again, thus save memory headroom, and improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
Refer to Fig. 5, Fig. 5 is the structural representation of a kind of terminal that the embodiment of the present invention provides.Concrete, as shown in Figure 5, the described terminal of the embodiment of the present invention can comprise: at least one processor 100, at least one input media 200, at least one output unit 300, assembly such as storer 500 grade.Wherein, these assemblies are communicated to connect by one or more bus 400.It will be appreciated by those skilled in the art that, the structure of the terminal shown in Fig. 5 does not form the restriction to the embodiment of the present invention, it both can be busbar network, also can be hub-and-spoke configuration, the parts more more or less than diagram can also be comprised, or combine some parts, or different parts are arranged.Wherein:
Processor 100 is the control center of terminal, utilize the various piece of various interface and the whole terminal of connection, by running or perform the program in storer 500 of being stored in and/or module, and call the data be stored in storer 500, to perform various function and the process data of terminal.Processor 100 by integrated circuit (IntegratedCircuit is called for short IC) composition, such as, can be made up of the IC of single encapsulation, also can be made up of the encapsulation IC connecting many identical functions or difference in functionality.For example, processor 100 can only comprise central processing unit (CentralProcessingUnit, be called for short CPU), also can be CPU, digital signal processor (digitalsignalprocessor, be called for short DSP), the combination of graphic process unit (GraphicProcessingUnit, be called for short GPU) and various control chip.In embodiments of the present invention, CPU can be the combination of CPU and GPU.
Input media 200 can comprise the touch-screen of standard, keyboard, shooting are first-class, also can include line interface, wave point etc.
Output unit 300 can comprise display screen, loudspeaker etc., also can include line interface, wave point etc.
Storer 500 can be used for storing software program and module, processor 100, input media 200 and output unit 300 are stored in software program in storer 500 and module by calling, thus perform the various functions application of terminal and realize data processing.Storer 500 mainly comprises program storage area and data storage area, and wherein, program storage area can store operating system, application program etc. needed at least one function; Data storage area can store the data etc. created according to the use of terminal.In embodiments of the present invention, operating system can be android system, iOS system or Windows operating system etc.
Concrete, processor 100 calls the application program be stored in storer 500, for performing following steps:
Receive the instruction of the rendering image that central processor CPU sends, described instruction comprises the mark of image to be rendered;
Read in the memory headroom that can be employed program and graphic process unit GPU access and identify corresponding bitmap images with described;
Institute's bit map images is played up.
Optionally, described processor 100 describedly to be played up institute's bit map images in execution, specifically performs following steps:
Institute's bit map images is played up as texture image.
Optionally, described processor 100 perform in the described memory headroom program and GPU access can be employed read with described identify corresponding bitmap images before, also for performing following steps:
Create the described memory headroom that can be employed program and described GPU access.
Optionally, described processor 100 is also for performing following steps:
Institute's bit map images is stored in the memory headroom of program and described GPU access described can being employed.
Optionally, the described memory headroom that can be employed program and described GPU access is the kernel spacing that figure memory management equipment ION creates.
In embodiments of the present invention, GPU can when the instruction receiving rendering image, the mark of the image to be rendered carried according to this instruction reads the bitmap images of this mark correspondence from the memory headroom that preset application program and GPU all can be accessed, and plays up process to this bitmap images of reading.The described image rendering method of the embodiment of the present invention only needs bitmap images to be kept at application program and the equal memory headroom that can access of GPU, and without the need to preserving two number certificates again, thus save memory headroom, and GPU is by reading the bitmap images in this space, and do not need copy image, therefore improve graph rendering efficiency, avoid and cause process frequently to block the problem of timing because of the frequent triggering of Memory Allocation.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " specific embodiment " " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, to the schematic representation of above-mentioned term not must for be identical embodiment or example.And the specific features of description, structure, material or feature can combine in one or more embodiment in office or example in an appropriate manner.In addition, when not conflicting, the feature of the different embodiment described in this instructions or example and different embodiment or example can carry out combining and combining by those skilled in the art.
In addition, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance or imply the quantity indicating indicated technical characteristic.Thus, be limited with " first ", the feature of " second " can express or impliedly comprise at least one this feature.In describing the invention, the implication of " multiple " is at least two, such as two, three etc., unless otherwise expressly limited specifically.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
In flow charts represent or in this logic otherwise described and/or step, such as, the sequencing list of the executable instruction for realizing logic function can be considered to, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise the system of processor or other can from instruction execution system, device or equipment instruction fetch and perform the system of instruction) use, or to use in conjunction with these instruction execution systems, device or equipment.With regard to this instructions, " computer-readable medium " can be anyly can to comprise, store, communicate, propagate or transmission procedure for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), ROM (read-only memory) (ROM), erasablely edit ROM (read-only memory) (EPROM or flash memory), fiber device, and portable optic disk ROM (read-only memory) (CDROM).In addition, computer-readable medium can be even paper or other suitable media that can print described program thereon, because can such as by carrying out optical scanning to paper or other media, then carry out editing, decipher or carry out process with other suitable methods if desired and electronically obtain described program, be then stored in computer memory.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, revises, replace and modification.

Claims (10)

1. an image rendering method, is characterized in that, comprising:
Graphic process unit GPU receives the instruction of the rendering image that central processor CPU sends, and described instruction comprises the mark of image to be rendered;
Described GPU reads and identifies corresponding bitmap images with described in the memory headroom that can be employed program and described GPU access;
Described GPU plays up institute's bit map images.
2. the method for claim 1, is characterized in that, described GPU plays up institute's bit map images, comprising:
Institute's bit map images is played up as texture image by described GPU.
3. method as claimed in claim 1 or 2, is characterized in that, described GPU can be employed to read in the memory headroom that program and described GPU access with described identify corresponding bitmap images before, described method also comprises:
Create the described memory headroom that can be employed program and described GPU access.
4., as the method as described in arbitrary in claim 1-3, it is characterized in that, described method also comprises:
Described CPU stores institute's bit map images described can being employed in the memory headroom of program and described GPU access.
5. the method according to any one of claim 1-4, is characterized in that, the described memory headroom that can be employed program and described GPU access is the kernel spacing that figure memory management equipment ION creates.
6. an image rendering device, is characterized in that, comprising:
Instruction reception unit, for receiving the instruction of the rendering image that central processor CPU sends, described instruction comprises the mark of image to be rendered;
Image fetching unit, identifies corresponding bitmap images for reading in the memory headroom that can be employed program and described GPU access with described;
Image rendering unit, plays up for the institute's bit map images read described image fetching unit.
7. device as claimed in claim 6, is characterized in that, described image rendering unit specifically for:
Institute's bit map images is played up as texture image.
8. device as claimed in claims 6 or 7, it is characterized in that, described device also comprises:
Creating unit, for creating the described memory headroom that can be employed program and described GPU access.
9., as the device as described in arbitrary in claim 6-8, it is characterized in that, described device also comprises:
Storage unit, for storing institute's bit map images described can being employed in the memory headroom of program and described GPU access.
10. the device according to any one of claim 6-9, is characterized in that, the described memory headroom that can be employed program and described GPU access is the kernel spacing that figure memory management equipment ION creates.
CN201510971103.7A 2015-12-18 2015-12-18 Method and device for image rendering Pending CN105427236A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510971103.7A CN105427236A (en) 2015-12-18 2015-12-18 Method and device for image rendering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510971103.7A CN105427236A (en) 2015-12-18 2015-12-18 Method and device for image rendering

Publications (1)

Publication Number Publication Date
CN105427236A true CN105427236A (en) 2016-03-23

Family

ID=55505418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510971103.7A Pending CN105427236A (en) 2015-12-18 2015-12-18 Method and device for image rendering

Country Status (1)

Country Link
CN (1) CN105427236A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204668A (en) * 2016-07-01 2016-12-07 腾讯科技(深圳)有限公司 Picture decoding method and device
CN106796535A (en) * 2016-12-27 2017-05-31 深圳前海达闼云端智能科技有限公司 Image display method, device, electronic equipment and computer program product
CN107402928A (en) * 2016-05-20 2017-11-28 上海画擎信息科技有限公司 A kind of document rendering intent
CN107885592A (en) * 2016-09-29 2018-04-06 上海华测导航技术股份有限公司 A kind of method for accelerating Android system operation fluency
CN108269223A (en) * 2017-01-04 2018-07-10 腾讯科技(深圳)有限公司 A kind of web page graphics method for drafting and terminal
CN108965975A (en) * 2017-05-24 2018-12-07 阿里巴巴集团控股有限公司 A kind of method for drafting and device
CN109308282A (en) * 2017-07-28 2019-02-05 幻视互动(北京)科技有限公司 A kind of parallel architecture method and device being used in MR mixed reality equipment
WO2019056744A1 (en) * 2017-09-20 2019-03-28 武汉斗鱼网络科技有限公司 Screen capturing method, device, electronic apparatus, and readable storage medium
CN110134370A (en) * 2018-02-08 2019-08-16 龙芯中科技术有限公司 A kind of method, apparatus of graphic plotting, electronic equipment and storage medium
WO2019170126A1 (en) * 2018-03-09 2019-09-12 Oppo广东移动通信有限公司 Picture drawing method and related products
CN110298780A (en) * 2018-03-23 2019-10-01 腾讯科技(深圳)有限公司 Map rendering method, device and computer storage medium
CN110347462A (en) * 2019-06-21 2019-10-18 秦皇岛尼特智能科技有限公司 WMF fire-fighting graph processing method and device based on OPENGL
CN110728773A (en) * 2019-10-15 2020-01-24 百度在线网络技术(北京)有限公司 Image storage method and device and electronic equipment
CN111147925A (en) * 2020-01-02 2020-05-12 南京巨鲨显示科技有限公司 Processing method, system and device capable of playing video stream compatible with WPF (Windows presentation foundation)
CN111145074A (en) * 2019-11-30 2020-05-12 航天科技控股集团股份有限公司 Full liquid crystal instrument image rendering method
CN111292387A (en) * 2020-01-16 2020-06-16 广州小鹏汽车科技有限公司 Dynamic picture loading method and device, storage medium and terminal equipment
CN112241932A (en) * 2019-07-19 2021-01-19 华为技术有限公司 Picture processing method and device
CN114391260A (en) * 2019-12-30 2022-04-22 深圳市欢太科技有限公司 Character recognition method and device, storage medium and electronic equipment
CN114820272A (en) * 2022-03-18 2022-07-29 维塔科技(北京)有限公司 Data interaction method and device, storage medium and electronic equipment
CN114998087A (en) * 2021-11-17 2022-09-02 荣耀终端有限公司 Rendering method and device
WO2023020124A1 (en) * 2021-08-17 2023-02-23 华为技术有限公司 Data processing method and apparatus, and computing device and system
WO2023236930A1 (en) * 2022-06-10 2023-12-14 维沃移动通信有限公司 Memory allocation method and apparatus based on ion allocator, electronic device, and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1950878A (en) * 2004-04-27 2007-04-18 辉达公司 GPU rendering to system memory
CN101496067A (en) * 2006-07-28 2009-07-29 英特尔公司 Real-time multi-resolution 3D collision detection using cube-maps
CN101551761A (en) * 2009-04-30 2009-10-07 浪潮电子信息产业股份有限公司 Method for sharing stream memory of heterogeneous multi-processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1950878A (en) * 2004-04-27 2007-04-18 辉达公司 GPU rendering to system memory
CN101496067A (en) * 2006-07-28 2009-07-29 英特尔公司 Real-time multi-resolution 3D collision detection using cube-maps
CN101551761A (en) * 2009-04-30 2009-10-07 浪潮电子信息产业股份有限公司 Method for sharing stream memory of heterogeneous multi-processor

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CRAZYJIANG: "android之ION内存管理器(1)--简介", 《HTTP://BLOG.CSDN.NET/CRAZYJIANG/ARTICAL/DETAILS/7927260》 *
快乐安卓: "Android图形缓冲区分配过程源码分析", 《HTTPS://BLOG.CSDN.NET/YANGWEN123/ARTICLE/DETAILS/12231687》 *
快乐安卓: "AndRoid图形缓冲区映射过程源码分析", 《HTTPS://BLOG.CSDN.NET/YANGWEN123/ARTICLE/DETAILS/12234931》 *

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402928A (en) * 2016-05-20 2017-11-28 上海画擎信息科技有限公司 A kind of document rendering intent
CN106204668A (en) * 2016-07-01 2016-12-07 腾讯科技(深圳)有限公司 Picture decoding method and device
CN107885592A (en) * 2016-09-29 2018-04-06 上海华测导航技术股份有限公司 A kind of method for accelerating Android system operation fluency
CN106796535A (en) * 2016-12-27 2017-05-31 深圳前海达闼云端智能科技有限公司 Image display method, device, electronic equipment and computer program product
US10929079B2 (en) 2016-12-27 2021-02-23 Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Video display method, electronic device and computer program product
CN108269223B (en) * 2017-01-04 2021-08-31 腾讯科技(深圳)有限公司 Webpage graph drawing method and terminal
CN108269223A (en) * 2017-01-04 2018-07-10 腾讯科技(深圳)有限公司 A kind of web page graphics method for drafting and terminal
CN108965975A (en) * 2017-05-24 2018-12-07 阿里巴巴集团控股有限公司 A kind of method for drafting and device
CN108965975B (en) * 2017-05-24 2021-03-23 阿里巴巴集团控股有限公司 Drawing method and device
CN109308282A (en) * 2017-07-28 2019-02-05 幻视互动(北京)科技有限公司 A kind of parallel architecture method and device being used in MR mixed reality equipment
WO2019056744A1 (en) * 2017-09-20 2019-03-28 武汉斗鱼网络科技有限公司 Screen capturing method, device, electronic apparatus, and readable storage medium
CN110134370A (en) * 2018-02-08 2019-08-16 龙芯中科技术有限公司 A kind of method, apparatus of graphic plotting, electronic equipment and storage medium
CN110134370B (en) * 2018-02-08 2023-09-12 龙芯中科技术股份有限公司 Graph drawing method and device, electronic equipment and storage medium
WO2019170126A1 (en) * 2018-03-09 2019-09-12 Oppo广东移动通信有限公司 Picture drawing method and related products
CN110298780B (en) * 2018-03-23 2022-10-28 腾讯科技(深圳)有限公司 Map rendering method, map rendering device and computer storage medium
CN110298780A (en) * 2018-03-23 2019-10-01 腾讯科技(深圳)有限公司 Map rendering method, device and computer storage medium
CN110347462A (en) * 2019-06-21 2019-10-18 秦皇岛尼特智能科技有限公司 WMF fire-fighting graph processing method and device based on OPENGL
CN112241932A (en) * 2019-07-19 2021-01-19 华为技术有限公司 Picture processing method and device
EP3971818A4 (en) * 2019-07-19 2022-08-10 Huawei Technologies Co., Ltd. Picture processing method and apparatus
WO2021013019A1 (en) * 2019-07-19 2021-01-28 华为技术有限公司 Picture processing method and apparatus
CN110728773A (en) * 2019-10-15 2020-01-24 百度在线网络技术(北京)有限公司 Image storage method and device and electronic equipment
CN111145074A (en) * 2019-11-30 2020-05-12 航天科技控股集团股份有限公司 Full liquid crystal instrument image rendering method
CN111145074B (en) * 2019-11-30 2023-11-28 航天科技控股集团股份有限公司 Full liquid crystal instrument image rendering method
CN114391260A (en) * 2019-12-30 2022-04-22 深圳市欢太科技有限公司 Character recognition method and device, storage medium and electronic equipment
CN111147925A (en) * 2020-01-02 2020-05-12 南京巨鲨显示科技有限公司 Processing method, system and device capable of playing video stream compatible with WPF (Windows presentation foundation)
CN111292387B (en) * 2020-01-16 2023-08-29 广州小鹏汽车科技有限公司 Dynamic picture loading method and device, storage medium and terminal equipment
CN111292387A (en) * 2020-01-16 2020-06-16 广州小鹏汽车科技有限公司 Dynamic picture loading method and device, storage medium and terminal equipment
WO2023020124A1 (en) * 2021-08-17 2023-02-23 华为技术有限公司 Data processing method and apparatus, and computing device and system
CN114998087A (en) * 2021-11-17 2022-09-02 荣耀终端有限公司 Rendering method and device
CN114998087B (en) * 2021-11-17 2023-05-05 荣耀终端有限公司 Rendering method and device
CN114820272A (en) * 2022-03-18 2022-07-29 维塔科技(北京)有限公司 Data interaction method and device, storage medium and electronic equipment
CN114820272B (en) * 2022-03-18 2024-06-14 北京趋动智能科技有限公司 Data interaction method and device, storage medium and electronic equipment
WO2023236930A1 (en) * 2022-06-10 2023-12-14 维沃移动通信有限公司 Memory allocation method and apparatus based on ion allocator, electronic device, and readable storage medium

Similar Documents

Publication Publication Date Title
CN105427236A (en) Method and device for image rendering
KR101813429B1 (en) Shader pipeline with shared data channels
EP2756481B1 (en) System and method for layering using tile-based renderers
CN108701366B (en) Method, apparatus, and readable storage medium for start node determination for tree traversal of shadow rays in graphics processing
JP5917784B1 (en) Hardware content protection for graphics processing units
KR101563098B1 (en) Graphics processing unit with command processor
CN112381918A (en) Image rendering method and device, computer equipment and storage medium
KR102646906B1 (en) Tile-based rendering method and apparatus
KR102006584B1 (en) Dynamic switching between rate depth testing and convex depth testing
CN112801855B (en) Method and device for scheduling rendering task based on graphics primitive and storage medium
AU2008258132B2 (en) Load balancing in multiple processor rendering systems
TW201724011A (en) Apparatus and method for intelligent resource provisioning for shadow structures
US20150348224A1 (en) Graphics Pipeline State Object And Model
US11301952B2 (en) Full screen processing in multi-application environments
CN110223216B (en) Data processing method and device based on parallel PLB and computer storage medium
US9852539B2 (en) Single pass surface splatting
US10509666B2 (en) Register partition and protection for virtualized processing device
CN108780582B (en) Visibility information modification
CN113256764A (en) Rasterization device and method and computer storage medium
CN113467959A (en) Method, device and medium for determining task complexity applied to GPU
US20210049788A1 (en) Shader function based pixel count determination
CN115375821A (en) Image rendering method and device and server
CN115920376A (en) Recording method and device
CN115222869A (en) Distributed rendering method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160323

RJ01 Rejection of invention patent application after publication