[go: up one dir, main page]

CN108510428A - picture drawing method and related product - Google Patents

picture drawing method and related product Download PDF

Info

Publication number
CN108510428A
CN108510428A CN201810195110.6A CN201810195110A CN108510428A CN 108510428 A CN108510428 A CN 108510428A CN 201810195110 A CN201810195110 A CN 201810195110A CN 108510428 A CN108510428 A CN 108510428A
Authority
CN
China
Prior art keywords
data
threads
modules
picture
thread
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
CN201810195110.6A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810195110.6A priority Critical patent/CN108510428A/en
Publication of CN108510428A publication Critical patent/CN108510428A/en
Priority to PCT/CN2019/077316 priority patent/WO2019170126A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The method is applied to a mobile terminal, the mobile terminal comprises an OpenG L ES, image data of a target picture is divided into a plurality of data modules according to a preset strategy, a plurality of threads are started to respectively execute data writing operation of the data modules, the threads are threads except a G L thread called by the OpenG L ES, and the drawing operation aiming at the target picture is executed by using the data modules completing the data writing operation through the G L thread.

Description

Picture method for drafting and Related product
Technical field
This application involves technical field of mobile terminals, and in particular to picture method for drafting and Related product.
Background technology
With the fast development of mobile terminal (for example, smart mobile phone) the relevant technologies, more and more applications are installed in In mobile terminal, such as camera-type application, payment class application, wherein with the promotion of people's living standard, people are to camera-type The use of application is more and more frequent.
Currently, in camera-type application, the performance requirement that people show photograph album is higher and higher, however, when display picture Data volume it is larger or when the picture that shows simultaneously is more, how to promote the display speed of picture, solve the display card of picture Phenomenon of pausing becomes urgent problem to be solved.
Invention content
The embodiment of the present application provides picture method for drafting and Related product, can solve the problems, such as the interim card that picture is shown, The speed that mobile terminal picture is drawn is improved, taking for picture drafting is reduced.
In a first aspect, the embodiment of the present application provides a kind of picture method for drafting, it is applied to mobile terminal, the mobile terminal Including graphic joining routine interface OpenGL ES, the method includes:
The image data of Target Photo is divided into multiple data modules according to preset strategy;
Start multiple threads and execute the data write operation for being directed to the multiple data module respectively, the multiple thread is Thread in addition to the GL threads that the OpenGL ES are called;
By the GL threads mesh is directed to execute using the multiple data modules for completing the data write operation Mark on a map piece drafting operation.
Second aspect, the embodiment of the present application provide a kind of picture drawing apparatus, are applied to mobile terminal, the mobile terminal Including graphic joining routine interface OpenGL ES, the picture drawing apparatus includes processing unit, execution unit and draws single Member, wherein
The processing unit, for the image data of Target Photo to be divided into multiple data modules according to preset strategy;
The execution unit, for start multiple threads respectively execute for the multiple data module data be written behaviour Make, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called;
The drawing unit, for using the multiple data modules for completing the data write operation by the GL threads To execute the drafting operation for the Target Photo.
The third aspect, the embodiment of the present application provide a kind of mobile terminal, including processor, memory, communication interface and One or more programs, wherein said one or multiple programs are stored in above-mentioned memory, and are configured by above-mentioned It manages device to execute, above procedure includes the instruction for executing the step in the embodiment of the present application first aspect either method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, wherein above computer is readable Computer program of the storage medium storage for electronic data interchange, wherein above computer program makes computer execute such as Step some or all of described in the embodiment of the present application first aspect either method.
5th aspect, the embodiment of the present application provide a kind of computer program product, wherein above computer program product Non-transient computer readable storage medium including storing computer program, above computer program are operable to make calculating Machine executes the step some or all of as described in the embodiment of the present application first aspect either method.The computer program product It can be a software installation packet.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
Description of the drawings
The attached drawing involved by the embodiment of the present application will be briefly described below.
Figure 1A is a kind of structural schematic diagram of smart mobile phone provided by the embodiments of the present application;
Figure 1B is a kind of exemplary plot of the code running space of smart mobile phone provided by the embodiments of the present application;
Fig. 1 C are the Organization Charts of display system in a kind of Android system provided by the embodiments of the present application
Fig. 2A is a kind of flow diagram of picture method for drafting provided by the embodiments of the present application;
Fig. 2 B are that a kind of display area of Target Photo provided by the embodiments of the present application divides schematic diagram;
Fig. 3 is a kind of flow diagram of picture method for drafting disclosed in the embodiment of the present application;
Fig. 4 is a kind of flow diagram of picture method for drafting disclosed in the embodiment of the present application;
Fig. 5 is a kind of structural schematic diagram of mobile terminal disclosed in the embodiment of the present application;
Fig. 6 is a kind of functional unit composition block diagram of picture drawing apparatus disclosed in the embodiment of the present application.
Specific implementation mode
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, technical solutions in the embodiments of the present application are clearly and completely described, it is clear that described embodiment is only Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art The every other embodiment obtained without creative efforts, shall fall in the protection scope of this application.
Term " first ", " second " in the description and claims of this application and above-mentioned attached drawing etc. are for distinguishing Different objects, rather than for describing particular order.In addition, term " comprising " and " having " and their any deformations, it is intended that It is to cover and non-exclusive includes.Such as process, method, system, product or the equipment for containing series of steps or unit do not have It is defined in the step of having listed or unit, but further includes the steps that optionally not listing or unit, or optionally also wrap It includes for other intrinsic steps of these processes, method, product or equipment or unit.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
Mobile terminal involved by the embodiment of the present application may include various handheld devices with wireless communication function, Mobile unit, wearable device, computing device or other processing equipments and various forms for being connected to radio modem User equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal device (terminal Device) etc..For convenience of description, apparatus mentioned above is referred to as mobile terminal.It is embedding involved by the embodiment of the present invention It is the software systems for being managed collectively to hardware resource, and providing a user business interface to enter formula operating system.
By taking the smart mobile phone in mobile terminal as an example, illustratively, Figure 1A is that the embodiment of the present application provides a kind of intelligence The structural schematic diagram of mobile phone 100, above-mentioned smart mobile phone 100 include:Shell 110, touching display screen 120, mainboard 130, battery 140 With subplate 150, front camera 131 is provided on mainboard 130, processor 132, memory 133, power management chip 134, is penetrated Display system 135 etc. is provided with oscillator 151, integrated sound chamber 152, VOOC and dodges and fill interface 153 on subplate.
The processor is the control centre of smart mobile phone, utilizes each of various interfaces and the entire smart mobile phone of connection A part by running or execute the software program and/or module that are stored in memory 133, and calls and is stored in storage Data in device 133 execute the various functions and processing data of smart mobile phone, to carry out integral monitoring to smart mobile phone.It should Processor may include one or more processing units, can such as integrate application processor AP and baseband processor (also known as base band core Piece, base band) etc., wherein the main processing operation system of application processor, user interface and application program etc., baseband processor master Handle wireless communication.It is understood that above-mentioned baseband processor can not also be integrated into processor.The processor is for example Can be central processing unit (Central Processing Unit, CPU), general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA) or other can Programmed logic device, transistor logic, hardware component or its arbitrary combination.It, which may be implemented or executes, combines the application Various illustrative logic blocks, module and circuit described in disclosure.Above-mentioned processor can also be to realize to calculate work( The combination of energy, such as include that one or more microprocessors combine, the combination etc. of DSP and microprocessor.
The memory 133 can be used for storing software program and module, and processor is stored in memory 133 by operation Software program and module, to execute various function application and the data processing of smart mobile phone.Memory 133 can be main Including storing program area and storage data field, wherein storing program area can storage program area, answering needed at least one function With program etc.;Storage data field can be stored uses created data etc. according to smart mobile phone.In addition, memory 133 can be with Can also include nonvolatile memory, for example, at least disk memory, a flash memory including high-speed random access memory Device or other volatile solid-state parts.The memory 133 for example can be random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), the read-only storage of erasable programmable Device (Erasable Programmable ROM, EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM (CD-ROM) or any other shape well known in the art The storage medium of formula.
Figure 1B is a kind of exemplary plot of the code running space of smart mobile phone provided by the embodiments of the present application, at present intelligence hand The mobile terminals such as machine are typically provided with program running space, which includes user's space and operating system space, Wherein, user's space operation there are one or multiple application programs, the one or more application program be the of mobile terminal installation Tripartite's application program, operating system space motion have the operating system of mobile terminal.The mobile terminal can specifically run Android The Mobile operating system iOS etc. that android system, Apple Inc. develop, does not do unique restriction herein.
By taking above-mentioned running of mobile terminal has android system as an example, android system includes display system, display system The framework of system is as shown in Figure 1 C, which includes that service (SurfaceFlinger) is drawn at interface, graphic joining program connects Mouthful (OpenGL for Embedded Systems, OpenGL ES), EGL interfaces, localization window NativeWindow and hard Part level of abstraction Gralloc.Wherein, it is held in the SurfaceFlinger and to describe to show there are one GraphicPlane member variables Screen and a display screen hardware DisplayHardware object instance.OpenGL ES are an interface protocol, i.e., one logical Function library is needed on different plateform systems by " localization " --- it and the window system on platform specific built Association is erected, just can guarantee that it is worked normally in this way.Wherein, NativeWindow is exactly by OpenGL ES in Android platform The window of upper localization, and EGL interfaces are to configure the intermediate of native window for OpengGL ES to be adapted to translation layer.
In being typically designed, by taking the business that the photograph album of mobile terminal is shown as an example, in embedded systems, the display packet of photograph album Included the upload write operation of photo data, the drafting operation of photograph, the display operation etc. of photograph, wherein photo data it is upper Write operation is passed, the drafting of photograph has operated with the associated functional calls GL threads in OpenGL ES to realize, wherein when The photo data amount of display is larger or the numeral picture that shows simultaneously it is more when, carry out phase passing through OpenGL ES When the upload write operation of sheet data, GL threads can be blocked, photograph display is caused serious Caton phenomenon occur, and show Speed is slow, also, when dynamically changing the photograph having been displayed, need by modified data be uploaded to again OpenGL ES into Row display, further causes the obstruction of GL threads, in fact, the upload write operation of photo data can need not pass through Function in OpenGL ES, but the drafting of photograph operation has to use the correlation function in OpenGL ES, therefore, needle To this case, following application is proposed to the business that photograph album is shown.
For the above situation, the embodiment of the present application proposes a kind of picture method for drafting for mobile terminal, the movement Terminal includes graphic joining routine interface OpenGL ES, and in this method, mobile terminal is according to preset strategy by the figure of Target Photo As data are divided into multiple data modules;Start multiple threads and executes the data write-in behaviour for being directed to the multiple data module respectively Make, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called;Completion is used by the GL threads Multiple data modules of the data write operation are directed to the drafting operation of the Target Photo to execute.It solves picture to show Interim card problem, be conducive to improve mobile terminal picture draw speed, and reduce picture drafting take.
The embodiment of the present application is introduced below in conjunction with the accompanying drawings.
Fig. 2A is please referred to, Fig. 2A is that the embodiment of the present application provides a kind of flow diagram of picture method for drafting, application In mobile terminal, the mobile terminal includes graphic joining routine interface OpenGL ES, as shown, this picture method for drafting Including:
The image data of Target Photo is divided into multiple data modules by S201, the mobile terminal according to preset strategy.
Wherein, graphic joining routine interface OpenGL ES are the OpenGL versions for embedded system.
Wherein, the preset strategy can be that image data is divided by the mobile terminal according to the data volume of image data Multiple data modules, or can also be display position of the mobile terminal according to pixel in image data on Target Photo It sets and image data is divided into multiple data modules etc., do not limit herein.
Wherein, the quantity of the multiple data module can be one or more, the quantity of the multiple data module Can according to data volume number be determined, can also by development technique personnel mobile terminal manufacture before according to mobile terminal Processing capacity pre-seted, do not limit herein, can also moreover, the data volume in each data module can be identical Difference does not do unique restriction herein.
Wherein, the image data of Target Photo is divided into touching for multiple data modules by the mobile terminal according to preset strategy Clockwork spring part can be diversified, such as can detect that random procedure is directed to the display operation of any picture, Huo Zheke To be to detect that photograph album applies the operation etc. of the new picture of modification generation for a certain picture, do not limit herein.
Wherein, the image data of Target Photo is divided into the tool of multiple data modules according to preset strategy by the mobile terminal Body realization method can be:Detect the display operation for the Target Photo;The image data of the Target Photo is obtained, Described image data are divided into multiple data modules according to preset strategy.
Wherein, the mode of the image data for obtaining Target Photo is that target to be shown is obtained by upper level applications Picture obtains image data by decompressing the Target Photo, and the format of the image data is bitmap file Bitmap.
S202, the mobile terminal start multiple threads and execute the data write-in behaviour for being directed to the multiple data module respectively Make, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called.
Wherein, the data write operation is that image data is written in video memory caching by thread, the multiple thread The quantity of quantity and the multiple data module can be the same or different, and the quantity of the multiple thread can be by exploitation skill Data of the art personnel before mobile terminal manufacture according to the processing capacity of mobile terminal or when being tested according to exploitation are preset It sets, can also determine the quantity of multiple threads according to the quantity of different data modules by mobile terminal, not limit herein.
For example, when the quantity of multiple threads is 4, and the quantity of multiple data modules is 6, the mobile terminal It is 1 needle of thread to start multiple threads to execute the specific implementation for the data write operation for being directed to the multiple data module respectively Data write operation is executed to data module 1, thread 2 executes data write operation for data module 2, and thread 3 is directed to data Module 3 executes data write operation, and thread 4 executes data write operation for data module 4, when thread 1 is directed to data module 1 Data write operation when completing, continue to get task execution and execute data write operation for data module 5, when 2 needle of thread When being completed to the data write operation of data module 2, continue to get task execution for the execution data write-in behaviour of data module 6 Make.
S203, the mobile terminal use the multiple data modules for completing the data write operation by the GL threads To execute the drafting operation for the Target Photo.
Wherein, the mobile terminal calls GL threads to be directed to multiple data modules by using the function in OpenGL ES It executes and draws operation.
Wherein, the mobile terminal calls GL threads can basis for the sequence of multiple data modules execution drafting operation The position indication information that data carry in data module is drawn, or can be according to the data write operation of data module Deadline sequence is drawn, and does not do unique restriction herein.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
In a possible example, the Target Photo is single frames picture, it is described according to preset strategy by Target Photo Image data be divided into multiple data modules, including:
Count the data volume of described image data;
The quantity of the data module is determined according to the data volume;
The image data of the Target Photo is equally divided into the quantity with the data module according to the data volume The multiple data module matched.
As it can be seen that in this example, mobile terminal determines the quantity of data module according to the data volume of image data, and by data Amount is distributed equally, and it is impartial so that per thread is executed the data volume of write operation, is conducive to promote total data amount The editorial of the bulk velocity completed and data distribution is written.
It is described to be equally divided into the image data of the Target Photo according to the data volume in this possible example With the multiple data module of the quantity Matching of the data module, including:
The corresponding pixel of described image data is obtained in the display location of the Target Photo;
It is identical that the Target Photo is equally divided into multiple data volumes according to the display location, and with the data module Quantity Matching display area;
The corresponding data in multiple display areas are encapsulated as the multiple data module.
Wherein, described image data are bitmap file, and each pixel number evidence carries the display location information of the pixel, For example, when the quantity of data module is 5, Target Photo as shown in Figure 2 B, the division of the display area of the Target Photo As shown, although the area of each display area is different, the data volume of each display area is identical, data mould All data volumes are adjacent position in block, rather than scattered.
As it can be seen that in this example, mobile terminal is according to each pixel position in image data to all image data roots Data module is divided and be encapsulated as according to the display area of picture, and the data in each data module is made to be located at identical area Domain is conducive to the convenience and speed that promote later stage drafting, moreover, according to data volume subregion, without being divided into area phase Same region, meets the working strength of multiple threads, further improves the working efficiency of multiple threads.
In a possible example, the Target Photo is that multiframe picture or multiple single frames pictures, the basis are pre- If the image data of Target Photo is divided into multiple data modules by strategy, including:
The described image data of the Target Photo are divided into institute according to the data volume of each single frames in the multiframe picture State multiple data modules;Or,
The described image data of the Target Photo are divided according to the data volume of each picture in the multiple single frames picture For the multiple data module.
As it can be seen that in this example, mobile terminal is according to the data volume of each single frames by multiframe picture or multiple single frames pictures The division of data module is carried out, rather than all data volumes are integrated, is then averagely divided, data division is conducive to Convenience, and the convenience of operation is drawn, it promotes picture and draws speed.
In a possible example, the multiple threads of startup execute the data for the multiple data module respectively Write operation, including:
The quantity of the multiple thread is determined according to the quantity of the multiple data module;
Start the multiple thread corresponding with the quantity of the multiple thread;
The per thread in the multiple thread is called to create graphics cache area Graphic Buffer;
Call number of the multiple thread respectively by the multiple data module that data type is bitmap file Bitmap According to the write-in Graphic Buffer.
Wherein, the data module is more, and the quantity of the thread is more, the quantity of the data module and the line The quantity of journey can be 1:2、1:3 etc., it does not limit herein.
Wherein, the size in the graphics cache area can be determined according to the data volume of each data module, each line Journey creates a buffer area rather than creates the buffer area of an entirety, so that multiple threads is used in conjunction with a buffer area, favorably In the flexibility and convenience that promote thread-data write operation.
As it can be seen that in this example, mobile terminal starts the thread of corresponding number according to the quantity of data module, rather than every time All start same amount of thread, the situation that thread utilization rate is relatively low or thread is less is avoided, moreover, being created by per thread Image buffer storage area, rather than by the image buffer storage area of one entirety of GL thread creations, by multiple threads in an image buffer storage area Write operation is carried out, the flexibility and the convenience that promote thread-data write operation are conducive to.
In this possible example, data type is the institute of bitmap file Bitmap by the multiple thread of calling The Graphic Buffer are written in the data for stating multiple data modules, including:
The multiple thread is called to start Read-Write Locks to the Graphic Buffer;
Data of the multiple thread by data type for multiple data modules of institute bitmap file Bitmap are called to write Enter the Graphic Buffer;
The multiple thread is called to close the Read-Write Locks.
As it can be seen that in this example, mobile terminal is corresponding by the thread when calling thread that buffer area is written in image data Buffer zone starts Read-Write Locks, starts Read-Write Locks for the corresponding buffer area of partial data, rather than is directed to all data pair The buffer zone answered starts Read-Write Locks, is conducive to the data write-in success rate for promoting thread and later stage mobile terminal for not When modifying with the data in region, operation is re-write without being carried out to all data, is conducive to promote data modification The speed of write-in afterwards.
It is described that the multiple numbers for completing the data write operation are used by the GL threads in a possible example According to module to execute the drafting operation for being directed to the Target Photo, including:
The multiple data modules for completing the data write operation are encapsulated as to the texture mapping of the GL threads identification Texture data formats;
Call the multiple thread that the packaged corresponding address mark of the multiple data module is sent to the GL Thread, the image data in the data module carry the display location on the Target Photo;
The address that the GL threads identify the instruction according to described address is called to use the multiple data module, and root The drafting operation for the Target Photo is executed according to the display location that image data in the multiple data module carries.
Wherein, the format for completing multiple data modules of data write operation is above-mentioned localization window NativeWindow The Graphic Buffer image datas of identification, the Texture data formats that then GL threads identify, therefore encapsulated in data Graphic Buffer image datas are encapsulated as intermediate adaptation translation layer EGL interfaces identification by Cheng Zhong first as shown in Figure 1 C Then the image data of EGLImage formats is encapsulated as the Texture of GL threads identification by the image data of EGLImage formats Data format.
As it can be seen that in this example, mobile terminal in NativeWindow by multiple threads by completing data write operation Image data encapsulates the Texture data formats that disguise as GL threads can identify by data, then identifies data address GL threads are sent to, GL threads is defrauded of and Image Rendering operation is carried out to image data, be advantageously implemented data write operation and figure Divide threading operation as drafting operation, solves the obstructing problem of GL threads, in addition, image data carries display location, have The speed of operation is drawn conducive to promotion.
It is consistent with embodiment shown in above-mentioned Fig. 2A, referring to Fig. 3, Fig. 3 is a kind of figure provided by the embodiments of the present application The flow diagram of piece method for drafting is applied to mobile terminal, and the mobile terminal includes graphic joining routine interface OpenGL ES.As shown, this picture method for drafting includes:
S301, the data volume of the image data of the mobile terminal statistics single frames picture.
S302, the mobile terminal determine the quantity of data module according to the data volume.
S303, the corresponding pixel of the acquisition for mobile terminal described image data is in the display position of the single frames picture It sets.
The single frames picture is equally divided into multiple data volume phases by S304, the mobile terminal according to the display location Together, and with the display area of the quantity Matching of the data module.
The corresponding data in multiple display areas are encapsulated as multiple data modules by S305, the mobile terminal.
S306, the mobile terminal determine the quantity of multiple threads according to the quantity of the multiple data module.
Wherein, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called.
S307, the mobile terminal start the multiple thread corresponding with the quantity of the multiple thread.
S308, the mobile terminal call the per thread in the multiple thread to create graphics cache area Graphic Buffer。
S309, it is respectively described in bitmap file Bitmap by data type that the mobile terminal, which calls the multiple thread, The Graphic Buffer are written in the data of multiple data modules.
S310, the mobile terminal use the multiple data modules for completing the data write operation by the GL threads To execute the drafting operation for the single frames picture.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
In addition, mobile terminal determines the quantity of data module according to the data volume of image data, and data volume is put down It distributes, it is impartial so that per thread is executed the data volume of write operation, and the write-in for being conducive to be promoted total data amount is completed Bulk velocity and data distribution editorial, and according to each pixel position in image data to all image datas Data module is divided and be encapsulated as according to the display area of picture, so that the data in each data module is located at identical Region is conducive to the convenience and speed that promote later stage drafting, moreover, according to data volume subregion, without being divided into area Identical region, meets the working strength of multiple threads, further improves the working efficiency of multiple threads.
In addition, mobile terminal starts the thread of corresponding number according to the quantity of data module, rather than start every time same The thread of sample quantity avoids the situation that thread utilization rate is relatively low or thread is less, moreover, creating image buffer storage by per thread Area, rather than by the image buffer storage area of one entirety of GL thread creations, it is written in an image buffer storage area by multiple threads Operation is conducive to the flexibility and the convenience that promote thread-data write operation.
It is consistent with embodiment shown in above-mentioned Fig. 2A, referring to Fig. 4, Fig. 4 is a kind of figure provided by the embodiments of the present application The flow diagram of piece method for drafting is applied to mobile terminal, and the mobile terminal includes graphic joining routine interface OpenGL ES.As shown, this picture method for drafting includes:
S401, the mobile terminal is according to the data volume of each single frames in multiframe picture by the picture number of the multiframe picture According to being divided into multiple data modules.
S402, the mobile terminal determine the quantity of multiple threads according to the quantity of the multiple data module.
Wherein, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called.
S403, the mobile terminal start the multiple thread corresponding with the quantity of the multiple thread.
S404, the mobile terminal call the per thread in the multiple thread to create graphics cache area Graphic Buffer。
S405, the mobile terminal call the multiple thread to start Read-Write Locks to the Graphic Buffer.
S406, the mobile terminal call multiple data of the multiple thread by data type for bitmap file Bitmap The Graphic Buffer are written in the data of module.
S407, the mobile terminal call the multiple thread to close the Read-Write Locks.
The multiple data modules for completing the data write operation are encapsulated as GL threads and identified by S408, the mobile terminal Texture mapping Texture data formats.
S409, the mobile terminal call the multiple thread by the packaged corresponding address of the multiple data module Mark is sent to the GL threads, and the image data in the data module carries the display position on the multiframe picture It sets.
S410, the mobile terminal call the GL threads to be identified described in the address use of the instruction according to described address Multiple data modules, and executed for described more according to the display location that image data in the multiple data module carries The drafting of frame picture operates.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
In addition, multiframe picture or multiple single frames pictures are carried out data mould by mobile terminal according to the data volume of each single frames The division of block, rather than all data volumes are integrated, it then averagely divides, is conducive to the convenience of data division, with And the convenience of operation is drawn, it promotes picture and draws speed.Moreover, mobile terminal starts corresponding number according to the quantity of data module The thread of amount, rather than start same amount of thread every time, the situation that thread utilization rate is relatively low or thread is less is avoided, Moreover, image buffer storage area is created by per thread, rather than by the image buffer storage area of one entirety of GL thread creations, by multiple lines Journey carries out write operation in an image buffer storage area, is conducive to the flexibility and the convenience that promote thread-data write operation.
In addition, mobile terminal is led to by the way that multiple threads to be completed to the image data of data write operation in NativeWindow The Texture data formats that data encapsulation disguise as GL threads can identify are crossed, data address mark is then sent to GL lines Journey gains GL threads by cheating and carries out Image Rendering operation to image data, is advantageously implemented data write operation and is operated with Image Rendering Divide threading operation, solve the obstructing problem of GL threads, in addition, image data carries display location, be conducive to be promoted and paint Make the speed of operation.
It is consistent with above-mentioned Fig. 2A, Fig. 3, embodiment shown in Fig. 4, it is provided referring to Fig. 5, Fig. 5 is the embodiment of the present application A kind of mobile terminal structural schematic diagram, the running of mobile terminal there are one or multiple application programs and operating system, such as scheme Shown, which includes processor, memory, communication interface and one or more programs, wherein said one is more A program is different from said one or multiple application programs, and said one or multiple programs are stored in above-mentioned memory, And it is configured to be executed by above-mentioned processor, above procedure includes the instruction for executing following steps;
The image data of Target Photo is divided into multiple data modules according to preset strategy;
Start multiple threads and execute the data write operation for being directed to the multiple data module respectively, the multiple thread is Thread in addition to the GL threads that the OpenGL ES are called;
By the GL threads mesh is directed to execute using the multiple data modules for completing the data write operation Mark on a map piece drafting operation.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
In a possible example, the Target Photo is single frames picture, it is described according to preset strategy by target figure In terms of the image data of piece is divided into multiple data modules, the instruction in described program is specifically used for executing following operation:Statistics institute State the data volume of image data;And the quantity for determining the data module according to the data volume;And for according to The image data of the Target Photo is equally divided into the multiple with the quantity Matching of the data module by the data volume Data module.
In this possible example, it is described according to the data volume by the image data average mark of the Target Photo In terms of the multiple data module for the quantity Matching with the data module, the instruction in described program is specifically used for executing It operates below:The corresponding pixel of described image data is obtained in the display location of the Target Photo;And for according to institute It states display location and the Target Photo is equally divided into multiple data volumes are identical, and is with the quantity Matching of the data module aobvious Show region;And for the corresponding data in multiple display areas to be encapsulated as the multiple data module.
In a possible example, the Target Photo is multiframe picture or multiple single frames pictures, in the basis In terms of the image data of Target Photo is divided into multiple data modules by preset strategy, the instruction in described program is specifically used for executing It operates below:The described image data of the Target Photo are divided into institute according to the data volume of each single frames in the multiframe picture State multiple data modules;Or, will be described in the Target Photo according to the data volume of each picture in the multiple single frames picture Image data is divided into the multiple data module.
In a possible example, the number for the multiple data module is executed respectively in the multiple threads of startup According in terms of write operation, the instruction in described program is specifically used for executing following operation:According to the number of the multiple data module Amount determines the quantity of the multiple thread;And for starting the multiple thread corresponding with the quantity of the multiple thread; And for calling the per thread in the multiple thread to create graphics cache area Graphic Buffer;And for calling The multiple thread respectively will be described in the data write-in for the multiple data module that data type is bitmap file Bitmap Graphic Buffer。
In this possible example, call the multiple thread by data type for bitmap file Bitmap's described In terms of the Graphic Buffer are written in the data of the multiple data module, the instruction in described program is specifically used for executing It operates below:The multiple thread is called to start Read-Write Locks to the Graphic Buffer;And it is the multiple for calling The Graphic Buffer are written for the data of multiple data modules of institute bitmap file Bitmap in data type by thread; And for calling the multiple thread to close the Read-Write Locks.
In a possible example, the multiple of the completion data write operation are used by the GL threads described Data module is directed to the drafting operating aspect of the Target Photo to execute, and the instruction in described program is specifically used for executing following Operation:The multiple data modules for completing the data write operation are encapsulated as to the texture mapping of the GL threads identification Texture data formats;And for calling the multiple thread by the packaged corresponding address of the multiple data module Mark is sent to the GL threads, and the image data in the data module carries the display position on the Target Photo It sets;And for call the GL threads according to described address identify the instruction address use the multiple data module, And the drafting for being directed to the Target Photo is executed according to the display location that image data in the multiple data module carries Operation.
It is above-mentioned that mainly the scheme of the embodiment of the present application is described from the angle of method side implementation procedure.It is appreciated that , for mobile terminal in order to realize above-mentioned function, it comprises execute the corresponding hardware configuration of each function and/or software mould Block.Those skilled in the art should be readily appreciated that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, the application can be realized with the combining form of hardware or hardware and computer software.Some function actually with Hardware or computer software drive the mode of hardware to execute, and depend on the specific application and design constraint item of technical solution Part.Professional technician specifically can realize described function to each using distinct methods, but this reality Now it is not considered that exceeding scope of the present application.
The embodiment of the present application can carry out mobile terminal according to the above method example division of functional unit, for example, can Each functional unit is divided with each function of correspondence, two or more functions can also be integrated in a processing unit In.The form that hardware had both may be used in above-mentioned integrated unit is realized, can also be realized in the form of SFU software functional unit.It needs It is noted that be schematical, only a kind of division of logic function to the division of unit in the embodiment of the present application, it is practical real It is current that there may be another division manner.
Using integrated unit, Fig. 6 shows picture drawing apparatus involved in above-described embodiment A kind of possible functional unit composition block diagram.Picture drawing apparatus 600 is applied to mobile terminal, and the mobile terminal includes figure Splice program interface OpenGL ES, the picture drawing apparatus 600 include processing unit 601, execution unit 602 and draw single Member 603, wherein
The processing unit 601, for the image data of Target Photo to be divided into multiple data modules according to preset strategy;
The execution unit 602 is write for starting the data that multiple threads are executed respectively for the multiple data module Enter operation, the multiple thread is the thread in addition to the GL threads that the OpenGL ES are called;
The drawing unit 603, for using the multiple data for completing the data write operation by the GL threads Module is directed to the drafting operation of the Target Photo to execute.
As can be seen that in the embodiment of the present application, mobile terminal is first according to preset strategy by the image data of Target Photo It is divided into multiple data modules, secondly, starts multiple threads and execute the data write operation for being directed to the multiple data module respectively, The multiple thread is that the thread in addition to the GL threads that the OpenGL ES are called finally has been used by the GL threads At multiple data modules of the data write operation to execute the drafting operation for being directed to the Target Photo.It is found that due to number OpenGL ES need not be called to realize according to write operation, therefore, mobile terminal will take serious data write operation from It is separated in the GL threads that OpenGL ES are called, improves the obstructing problem of GL threads, be conducive to the picture for promoting GL threads Speed is drawn, and before data write operation completion, GL threads can also handle other operations, improve the place of GL threads Efficiency is managed, in addition, image data is divided into multiple data modules carries out data write operation by different threads, is conducive to be promoted Writing speed, and then the whole timeliness that picture is drawn is promoted, moreover, GL threads can be according to completion data write operation Data module gradually carry out picture draw operation, further improve picture drafting fluency.
In a possible example, the Target Photo is single frames picture, it is described according to preset strategy by target figure In terms of the image data of piece is divided into multiple data modules, the processing unit 601 is specifically used for:Count the number of described image data According to amount;And the quantity for determining the data module according to the data volume;And for according to the data volume by institute The image data for stating Target Photo is equally divided into the multiple data module with the quantity Matching of the data module.
In this possible example, it is described according to the data volume by the image data average mark of the Target Photo In terms of the multiple data module for the quantity Matching with the data module, the processing unit 601 is specifically used for:It obtains The corresponding pixel of described image data is in the display location of the Target Photo;And for according to the display location by institute State Target Photo and be equally divided into that multiple data volumes are identical, and with the display area of the quantity Matching of the data module;And it uses In the corresponding data in multiple display areas are encapsulated as the multiple data module.
In a possible example, the Target Photo is multiframe picture or multiple single frames pictures, in the basis In terms of the image data of Target Photo is divided into multiple data modules by preset strategy, the processing unit 601 is specifically used for:According to The described image data of the Target Photo are divided into the multiple data mould by the data volume of each single frames in the multiframe picture Block;Or, the described image data of the Target Photo are divided into according to the data volume of each picture in the multiple single frames picture The multiple data module.
In a possible example, the number for the multiple data module is executed respectively in the multiple threads of startup According in terms of write operation, the execution unit 602 is specifically used for:It is determined according to the quantity of the multiple data module the multiple The quantity of thread;And for starting the multiple thread corresponding with the quantity of the multiple thread;And for calling The per thread stated in multiple threads creates graphics cache area Graphic Buffer;And for calling the multiple thread point The Graphic Buffer are not written into the data for the multiple data module that data type is bitmap file Bitmap.
In this possible example, call the multiple thread by data type for bitmap file Bitmap's described In terms of the Graphic Buffer are written in the data of the multiple data module, the execution unit 602 is specifically used for:It calls The multiple thread starts Read-Write Locks to the Graphic Buffer;And for calling the multiple thread by data type The Graphic Buffer are written in data for multiple data modules of institute bitmap file Bitmap;And for calling It states multiple threads and closes the Read-Write Locks.
In a possible example, the multiple of the completion data write operation are used by the GL threads described Data module is directed to the drafting operating aspect of the Target Photo to execute, and the drawing unit 603 is specifically used for:It will complete institute The multiple data modules for stating data write operation are encapsulated as the texture mapping Texture data formats of the GL threads identification;With And for calling the multiple thread that the packaged corresponding address mark of the multiple data module is sent to the GL lines Journey, the image data in the data module carry the display location on the Target Photo;And it is described for calling The address that GL threads identify the instruction according to described address uses the multiple data module, and according to the multiple data mould The display location that image data carries in block executes the drafting operation for the Target Photo.
It should be noted that picture drawing apparatus described in the application device embodiment is in the form of functional unit is in It is existing.Term " unit " used herein above should be understood as meaning as widest as possible, described for realizing each " unit " The object of function for example can be integrated circuit ASIC, single circuit, for executing one or more softwares or firmware program Processor (shared, dedicated or chipset) and memory, combinational logic circuit, and/or its for realizing above-mentioned function is provided His suitable component.
Specifically, above-mentioned processing unit 601, execution unit 602 and drawing unit 603 can be the processing of mobile terminal Device.
The embodiment of the present application also provides a kind of computer storage media, wherein computer storage media storage is for electricity The computer program that subdata exchanges, the computer program make computer execute any as described in above method embodiment Some or all of method step, above computer include mobile terminal.
The embodiment of the present application also provides a kind of computer program product, and above computer program product includes storing calculating The non-transient computer readable storage medium of machine program, above computer program are operable to that computer is made to execute such as above-mentioned side Some or all of either method described in method embodiment step.The computer program product can be a software installation Packet, above computer includes mobile terminal.
It should be noted that for each method embodiment above-mentioned, for simple description, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know It knows, embodiment described in this description belongs to preferred embodiment, involved action and module not necessarily the application It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way It realizes.For example, the apparatus embodiments described above are merely exemplary, for example, said units division, it is only a kind of Division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit, Can be electrical or other forms.
The above-mentioned unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can be stored in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment (can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the application Step.And memory above-mentioned includes:USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can be stored in a computer-readable memory, memory May include:Flash disk, read-only memory (English:Read-Only Memory, referred to as:ROM), random access device (English: Random Access Memory, referred to as:RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas; Meanwhile for those of ordinary skill in the art, according to the thought of the application, can in specific embodiments and applications There is change place, to sum up above-mentioned, the contents of this specification should not be construed as limiting the present application.

Claims (16)

1.一种图片绘制方法,其特征在于,应用于移动终端,所述移动终端包括图形拼接程序接口OpenGL ES,所述方法包括:1. A picture drawing method, is characterized in that, is applied to mobile terminal, and described mobile terminal comprises graphic splicing program interface OpenGL ES, and described method comprises: 根据预设策略将目标图片的图像数据分为多个数据模块;Divide the image data of the target image into multiple data modules according to a preset strategy; 启动多个线程分别执行针对所述多个数据模块的数据写入操作,所述多个线程为除所述OpenGL ES调用的GL线程之外的线程;Start a plurality of threads to perform data writing operations for the plurality of data modules respectively, and the plurality of threads are threads other than the GL thread called by the OpenGL ES; 通过所述GL线程使用完成所述数据写入操作的多个数据模块以执行针对所述目标图片的绘制操作。The GL thread uses a plurality of data modules that complete the data writing operation to perform a drawing operation for the target picture. 2.根据权利要求1所述的方法,其特征在于,所述目标图片为单帧图片,所述根据预设策略将目标图片的图像数据分为多个数据模块,包括:2. The method according to claim 1, wherein the target picture is a single-frame picture, and the image data of the target picture is divided into a plurality of data modules according to a preset strategy, including: 统计所述图像数据的数据量;Count the data volume of the image data; 根据所述数据量确定所述数据模块的数量;determining the number of data modules according to the amount of data; 按照所述数据量将所述目标图片的图像数据平均分为与所述数据模块的数量匹配的所述多个数据模块。The image data of the target picture is equally divided into the plurality of data modules matching the number of the data modules according to the data amount. 3.根据权利要求2所述的方法,其特征在于,所述按照所述数据量将所述目标图片的图像数据平均分为与所述数据模块的数量匹配的所述多个数据模块,包括:3. The method according to claim 2, wherein said dividing the image data of the target picture into the plurality of data modules matching the quantity of the data modules according to the amount of data includes : 获取所述图像数据对应的像素点在所述目标图片的显示位置;Acquiring the display position of the pixel corresponding to the image data in the target image; 根据所述显示位置将所述目标图片平均分为多个数据量相同,且与所述数据模块的数量匹配的显示区域;Dividing the target picture into multiple display areas with the same amount of data and matching the number of the data modules according to the display position; 将多个所述显示区域对应的数据封装为所述多个数据模块。Encapsulating the data corresponding to the multiple display areas into the multiple data modules. 4.根据权利要求1所述的方法,其特征在于,所述目标图片为多帧图片或者多个单帧图片,所述根据预设策略将目标图片的图像数据分为多个数据模块,包括:4. The method according to claim 1, wherein the target picture is a multi-frame picture or a plurality of single-frame pictures, and the image data of the target picture is divided into a plurality of data modules according to a preset strategy, including : 根据所述多帧图片中每个单帧的数据量将所述目标图片的所述图像数据分为所述多个数据模块;或,dividing the image data of the target picture into the plurality of data modules according to the data amount of each single frame in the multi-frame picture; or, 根据所述多个单帧图片中每个图片的数据量将所述目标图片的所述图像数据分为所述多个数据模块。The image data of the target picture is divided into the plurality of data modules according to the data amount of each picture in the plurality of single-frame pictures. 5.根据权利要求1-4任一项所述的方法,其特征在于,所述启动多个线程分别执行针对所述多个数据模块的数据写入操作,包括:5. The method according to any one of claims 1-4, wherein the starting multiple threads to respectively perform data writing operations for the multiple data modules comprises: 根据所述多个数据模块的数量确定所述多个线程的数量;determining the number of threads according to the number of data modules; 启动与所述多个线程的数量对应的所述多个线程;starting the plurality of threads corresponding to the number of the plurality of threads; 调用所述多个线程中的每个线程创建图形缓存区Graphic Buffer;Calling each thread in the plurality of threads to create a graphics cache Graphic Buffer; 调用所述多个线程分别将数据类型为位图文件Bitmap的所述多个数据模块的数据写入所述Graphic Buffer。Invoking the multiple threads to respectively write the data of the multiple data modules whose data type is a bitmap file Bitmap into the Graphic Buffer. 6.根据权利要求5所述的方法,其特征在于,所述调用所述多个线程将数据类型为位图文件Bitmap的所述多个数据模块的数据写入所述Graphic Buffer,包括:6. The method according to claim 5, wherein said calling said plurality of threads writes the data of said plurality of data modules whose data type is a bitmap file Bitmap into said Graphic Buffer, comprising: 调用所述多个线程对所述Graphic Buffer启动读写锁;Calling the plurality of threads to start a read-write lock on the Graphic Buffer; 调用所述多个线程将数据类型为所述位图文件Bitmap的多个数据模块的数据写入所述Graphic Buffer;Calling the plurality of threads to write the data of the plurality of data modules of the bitmap file Bitmap into the Graphic Buffer; 调用所述多个线程关闭所述读写锁。calling the plurality of threads to close the read-write lock. 7.根据权利要求1-6任一项所述的方法,其特征在于,所述通过所述GL线程使用完成所述数据写入操作的多个数据模块以执行针对所述目标图片的绘制操作,包括:7. The method according to any one of claims 1-6, wherein the GL thread uses a plurality of data modules that complete the data writing operation to perform a drawing operation for the target picture ,include: 将完成所述数据写入操作的多个数据模块封装为所述GL线程识别的纹理贴图Texture数据格式;Encapsulate multiple data modules that complete the data writing operation into the texture map Texture data format identified by the GL thread; 调用所述多个线程将封装好的所述多个数据模块对应的地址标识发送给所述GL线程,所述数据模块中的图像数据携带有在所述目标图片上的显示位置;Calling the plurality of threads to send the packaged address identifiers corresponding to the plurality of data modules to the GL thread, the image data in the data modules carries the display position on the target picture; 调用所述GL线程根据所述地址标识所述指示的地址使用所述多个数据模块,并根据所述多个数据模块中图像数据携带的所述显示位置执行针对所述目标图片的绘制操作。calling the GL thread to use the plurality of data modules according to the address identified by the address, and performing a drawing operation for the target picture according to the display position carried by the image data in the plurality of data modules. 8.一种图片绘制装置,其特征在于,应用于移动终端,所述移动终端包括图形拼接程序接口OpenGL ES,所述图片绘制装置包括处理单元、执行单元和绘制单元,其中,8. A picture drawing device, characterized in that it is applied to a mobile terminal, the mobile terminal includes a graphics splicing program interface OpenGL ES, and the picture drawing device includes a processing unit, an execution unit and a drawing unit, wherein, 所述处理单元,用于根据预设策略将目标图片的图像数据分为多个数据模块;The processing unit is configured to divide the image data of the target picture into a plurality of data modules according to a preset strategy; 所述执行单元,用于启动多个线程分别执行针对所述多个数据模块的数据写入操作,所述多个线程为除所述OpenGL ES调用的GL线程之外的线程;The execution unit is configured to start a plurality of threads to respectively execute data writing operations for the plurality of data modules, the plurality of threads being threads other than the GL thread called by the OpenGL ES; 所述绘制单元,用于通过所述GL线程使用完成所述数据写入操作的多个数据模块以执行针对所述目标图片的绘制操作。The drawing unit is configured to use the plurality of data modules that complete the data writing operation to perform a drawing operation for the target picture through the GL thread. 9.根据权利要求8所述的装置,其特征在于,所述目标图片为单帧图片,在所述根据预设策略将目标图片的图像数据分为多个数据模块方面,所述处理单元具体用于:统计所述图像数据的数据量;以及用于根据所述数据量确定所述数据模块的数量;以及用于按照所述数据量将所述目标图片的图像数据平均分为与所述数据模块的数量匹配的所述多个数据模块。9. The device according to claim 8, wherein the target picture is a single-frame picture, and in terms of dividing the image data of the target picture into a plurality of data modules according to a preset strategy, the processing unit specifically For: counting the data volume of the image data; and for determining the number of the data modules according to the data volume; and for dividing the image data of the target picture into equal parts according to the data volume The number of data modules matches the plurality of data modules. 10.根据权利要求9所述的装置,其特征在于,在所述按照所述数据量将所述目标图片的图像数据平均分为与所述数据模块的数量匹配的所述多个数据模块方面,所述处理单元具体用于:获取所述图像数据对应的像素点在所述目标图片的显示位置;以及用于根据所述显示位置将所述目标图片平均分为多个数据量相同,且与所述数据模块的数量匹配的显示区域;以及用于将多个所述显示区域对应的数据封装为所述多个数据模块。10. The device according to claim 9, characterized in that, according to the amount of data, the image data of the target picture is equally divided into the plurality of data modules matching the number of the data modules The processing unit is specifically used to: acquire the display position of the pixel corresponding to the image data in the target picture; and divide the target picture into multiple equal data volumes according to the display position, and a display area matching the number of the data modules; and packaging data corresponding to a plurality of the display areas into the plurality of data modules. 11.根据权利要求8所述的装置,其特征在于,所述目标图片为多帧图片或者多个单帧图片,在所述根据预设策略将目标图片的图像数据分为多个数据模块方面,所述处理单元具体用于:根据所述多帧图片中每个单帧的数据量将所述目标图片的所述图像数据分为所述多个数据模块;或,根据所述多个单帧图片中每个图片的数据量将所述目标图片的所述图像数据分为所述多个数据模块。11. The device according to claim 8, wherein the target picture is a multi-frame picture or a plurality of single-frame pictures, and in terms of dividing the image data of the target picture into a plurality of data modules according to a preset strategy The processing unit is specifically configured to: divide the image data of the target picture into the multiple data modules according to the data amount of each single frame in the multiple frames of pictures; or, divide the image data of the target picture into the multiple data modules; The data amount of each picture in a frame picture divides the image data of the target picture into the plurality of data modules. 12.根据权利要求8-11任一项所述的装置,其特征在于,在所述启动多个线程分别执行针对所述多个数据模块的数据写入操作方面,所述执行单元具体用于:根据所述多个数据模块的数量确定所述多个线程的数量;以及用于启动与所述多个线程的数量对应的所述多个线程;以及用于调用所述多个线程中的每个线程创建图形缓存区Graphic Buffer;以及用于调用所述多个线程分别将数据类型为位图文件Bitmap的所述多个数据模块的数据写入所述Graphic Buffer。12. The device according to any one of claims 8-11, characterized in that, in terms of starting a plurality of threads to respectively execute data writing operations for the plurality of data modules, the execution unit is specifically configured to : determining the quantity of the multiple threads according to the quantity of the multiple data modules; and being used to start the multiple threads corresponding to the quantity of the multiple threads; and being used to call the multiple threads in the multiple threads Each thread creates a Graphic Buffer; and is used to call the multiple threads to respectively write the data of the multiple data modules whose data type is a bitmap file Bitmap into the Graphic Buffer. 13.根据权利要求12所述的装置,其特征在于,在所述调用所述多个线程将数据类型为位图文件Bitmap的所述多个数据模块的数据写入所述Graphic Buffer方面,所述执行单元具体用于:调用所述多个线程对所述Graphic Buffer启动读写锁;以及用于调用所述多个线程将数据类型为所述位图文件Bitmap的多个数据模块的数据写入所述Graphic Buffer;以及用于调用所述多个线程关闭所述读写锁。13. The device according to claim 12, wherein, in calling the plurality of threads, the data type is written into the Graphic Buffer of the plurality of data modules whose data type is a bitmap file Bitmap, the The execution unit is specifically used for: calling the multiple threads to start the read-write lock on the Graphic Buffer; into the Graphic Buffer; and for invoking the plurality of threads to close the read-write lock. 14.根据权利要求8-13任一项所述的装置,其特征在于,在所述通过所述GL线程使用完成所述数据写入操作的多个数据模块以执行针对所述目标图片的绘制操作方面,所述绘制单元具体用于:将完成所述数据写入操作的多个数据模块封装为所述GL线程识别的纹理贴图Texture数据格式;以及用于调用所述多个线程将封装好的所述多个数据模块对应的地址标识发送给所述GL线程,所述数据模块中的图像数据携带有在所述目标图片上的显示位置;以及用于调用所述GL线程根据所述地址标识所述指示的地址使用所述多个数据模块,并根据所述多个数据模块中图像数据携带的所述显示位置执行针对所述目标图片的绘制操作。14. The device according to any one of claims 8-13, characterized in that, when the GL thread uses a plurality of data modules that complete the data writing operation to perform drawing for the target picture In terms of operation, the drawing unit is specifically used to: package a plurality of data modules that complete the data writing operation into a texture map Texture data format recognized by the GL thread; The address identifiers corresponding to the plurality of data modules are sent to the GL thread, and the image data in the data module carries the display position on the target picture; and is used to call the GL thread according to the address Identifying the indicated address uses the plurality of data modules, and performing a drawing operation on the target picture according to the display position carried by the image data in the plurality of data modules. 15.一种移动终端,其特征在于,包括处理器、存储器,所述存储器存储有程序,所述处理器用于调用所述程序以执行如权利要求1-7任一项所述的方法。15. A mobile terminal, characterized by comprising a processor and a memory, the memory stores a program, and the processor is used to call the program to execute the method according to any one of claims 1-7. 16.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-7任一项所述的方法。16. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the computer program according to any one of claims 1-7. described method.
CN201810195110.6A 2018-03-09 2018-03-09 picture drawing method and related product Pending CN108510428A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810195110.6A CN108510428A (en) 2018-03-09 2018-03-09 picture drawing method and related product
PCT/CN2019/077316 WO2019170126A1 (en) 2018-03-09 2019-03-07 Picture drawing method and related products

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810195110.6A CN108510428A (en) 2018-03-09 2018-03-09 picture drawing method and related product

Publications (1)

Publication Number Publication Date
CN108510428A true CN108510428A (en) 2018-09-07

Family

ID=63377175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810195110.6A Pending CN108510428A (en) 2018-03-09 2018-03-09 picture drawing method and related product

Country Status (2)

Country Link
CN (1) CN108510428A (en)
WO (1) WO2019170126A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508229A (en) * 2018-09-19 2019-03-22 安徽慧视金瞳科技有限公司 A kind of matching process that multiple spot is drawn simultaneously
CN109960543A (en) * 2019-03-18 2019-07-02 广州视源电子科技股份有限公司 Writing operation processing method and device
CN109978971A (en) * 2019-03-29 2019-07-05 深圳市万普拉斯科技有限公司 UI drawing practice, device and mobile terminal
CN110211022A (en) * 2019-05-16 2019-09-06 北京奇艺世纪科技有限公司 A kind of image processing method, device and electronic equipment
WO2019170126A1 (en) * 2018-03-09 2019-09-12 Oppo广东移动通信有限公司 Picture drawing method and related products
CN114570020A (en) * 2022-03-03 2022-06-03 阿里巴巴(中国)有限公司 Data processing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8102391B2 (en) * 2008-04-11 2012-01-24 International Business Machines Corporation Hybrid rendering of image data utilizing streaming geometry frontend interconnected to physical rendering backend through dynamic accelerated data structure generator
CN105528371A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 Method, device, and system for executing writing task
CN105955687A (en) * 2016-04-29 2016-09-21 华为技术有限公司 Image processing method, apparatus and system
CN106340055A (en) * 2016-08-19 2017-01-18 江苏电力信息技术有限公司 Multithreading-based OpenGL quick drawing method
US20180047203A1 (en) * 2016-08-15 2018-02-15 Microsoft Technology Licensing, Llc Variable rate shading

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105427236A (en) * 2015-12-18 2016-03-23 魅族科技(中国)有限公司 Method and device for image rendering
CN106909354A (en) * 2015-12-22 2017-06-30 北京奇虎科技有限公司 image display method and device
CN106504295B (en) * 2016-09-22 2020-11-10 北京小米移动软件有限公司 Method and device for rendering picture
CN108510428A (en) * 2018-03-09 2018-09-07 广东欧珀移动通信有限公司 picture drawing method and related product

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8102391B2 (en) * 2008-04-11 2012-01-24 International Business Machines Corporation Hybrid rendering of image data utilizing streaming geometry frontend interconnected to physical rendering backend through dynamic accelerated data structure generator
CN105528371A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 Method, device, and system for executing writing task
CN105955687A (en) * 2016-04-29 2016-09-21 华为技术有限公司 Image processing method, apparatus and system
US20180047203A1 (en) * 2016-08-15 2018-02-15 Microsoft Technology Licensing, Llc Variable rate shading
CN106340055A (en) * 2016-08-19 2017-01-18 江苏电力信息技术有限公司 Multithreading-based OpenGL quick drawing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
帕特里克 卡兹,凯文 瑞恩: "《三维数字地球引擎设计》", 30 November 2017, 国防工业出版社 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019170126A1 (en) * 2018-03-09 2019-09-12 Oppo广东移动通信有限公司 Picture drawing method and related products
CN109508229A (en) * 2018-09-19 2019-03-22 安徽慧视金瞳科技有限公司 A kind of matching process that multiple spot is drawn simultaneously
CN109960543A (en) * 2019-03-18 2019-07-02 广州视源电子科技股份有限公司 Writing operation processing method and device
CN109960543B (en) * 2019-03-18 2022-07-19 广州视源电子科技股份有限公司 Writing operation processing method and device
CN109978971A (en) * 2019-03-29 2019-07-05 深圳市万普拉斯科技有限公司 UI drawing practice, device and mobile terminal
CN109978971B (en) * 2019-03-29 2023-07-07 深圳市万普拉斯科技有限公司 UI drawing method, device and mobile terminal
CN110211022A (en) * 2019-05-16 2019-09-06 北京奇艺世纪科技有限公司 A kind of image processing method, device and electronic equipment
CN114570020A (en) * 2022-03-03 2022-06-03 阿里巴巴(中国)有限公司 Data processing method and system

Also Published As

Publication number Publication date
WO2019170126A1 (en) 2019-09-12

Similar Documents

Publication Publication Date Title
CN108510428A (en) picture drawing method and related product
CN115904563B (en) Data processing method, device and storage medium in application program starting
CN107786748A (en) Method for displaying image and equipment
CN112241932A (en) Picture processing method and device
US10198174B2 (en) Electronic device and method of managing memory of electronic device
CN108509240A (en) Picture method for drafting and Related product
CN110908707A (en) Resource packaging method, device, server and storage medium
CN107888970A (en) Method for processing video frequency, device, embedded device and storage medium
CN109857553A (en) EMS memory management process and device
WO2020078323A1 (en) Watermark embedding method and device, terminal, and storage medium
WO2024169368A1 (en) Map rendering method, apparatus and device, and program product
CN107423291A (en) A kind of data translating method and client device
EP4459558A1 (en) Rendering method and apparatus, and device and storage medium
WO2023005751A1 (en) Rendering method and electronic device
CN108124157A (en) Information interacting method, apparatus and system
CN109582401B (en) Promotion picture generation method and device, storage medium and computer equipment
US10643252B2 (en) Banner display method of electronic device and electronic device thereof
EP4455986A1 (en) Data processing method and apparatus, and device and storage medium
CN103780860B (en) Screen recording method, device and system
CN107437174A (en) virtual card management method and device
CN116740241B (en) Image processing method and electronic equipment
CN113961357A (en) Method, device, electronic device and storage medium for data priority processing
CN111191063A (en) Picture classification method and device, terminal and storage medium
CN116680133B (en) Black screen detection method and electronic device
CN113724370B (en) A three-dimensional reconstruction method, device and system based on graphics processor

Legal Events

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

Application publication date: 20180907

RJ01 Rejection of invention patent application after publication