CN109947519A - Hardware-accelerated control method, terminal and computer readable storage medium - Google Patents

Hardware-accelerated control method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109947519A
CN109947519A CN201910239542.7A CN201910239542A CN109947519A CN 109947519 A CN109947519 A CN 109947519A CN 201910239542 A CN201910239542 A CN 201910239542A CN 109947519 A CN109947519 A CN 109947519A
Authority
CN
China
Prior art keywords
hardware
function
view
application
terminal
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
CN201910239542.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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201910239542.7A priority Critical patent/CN109947519A/en
Publication of CN109947519A publication Critical patent/CN109947519A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The invention discloses a kind of hardware-accelerated control method, terminal and computer readable storage mediums, method includes: when application request calls the preset interface of terminal system to close function of hardware acceleration, and whether the hardware for detecting the terminal supports function of hardware acceleration;When detecting support function of hardware acceleration, the view that the application is drawn using function of hardware acceleration is forced by the preset interface.When application request special interface closes function of hardware acceleration, first determine whether terminal hardware supports function of hardware acceleration, when terminal hardware supports function of hardware acceleration, it is forbidden to close function of hardware acceleration, and it forces to draw application view using function of hardware acceleration, this is conducive to the performance for making full use of terminal hardware, Lai Liuchang drawing view, to avoid occurring Caton in drawing process.

Description

Hardware-accelerated control method, terminal and computer readable storage medium
Technical field
The present invention relates to field of mobile terminals more particularly to a kind of hardware-accelerated control methods, terminal and computer-readable Storage medium.
Background technique
At present on the mobile phone of android system, the interface View (view) of some third-party applications is shown for compatibility not With the equipment of version and hardware, can be forcibly closed by setLayerType (a kind of interface) interface in invocation framenort View should The hardware-accelerated logic (not supporting because of certain low side devices hardware-accelerated) of View rendering, is mounted in if this results in the application In some stronger equipment of performance when (equipment support function of hardware acceleration), due to closing function of hardware acceleration, rendering If the content shown in View when drafting is more complicated, rendering can only be carried out by CPU (central processing unit) to Caton occur The problem of falling frame.
And these application developers can only provide an APK (application installation package), need to be adapted to different Android versions and When the equipment of hardware configuration, often it can only give up rendering performance by guaranteeing the compatibility of application operation.
Therefore, it is necessary to a kind of new technical solutions, can efficiently use high performance device hardware drawing view, avoid sending out It is raw to draw Caton phenomenon.
Summary of the invention
It is a primary object of the present invention to propose a kind of hardware-accelerated control method, terminal and computer-readable storage medium Matter, it is intended to high performance device hardware drawing view can be efficiently used, avoid occurring to draw Caton phenomenon.
To achieve the above object, the present invention provides a kind of hardware-accelerated control methods, comprising: calls eventually in application request When the preset interface of end system is to close function of hardware acceleration, whether the hardware for detecting the terminal supports function of hardware acceleration; When detecting support function of hardware acceleration, forced using function of hardware acceleration by the preset interface to draw the application View.
To achieve the above object, the present invention provides a kind of terminal, the terminal includes processor, memory, communicates always Line;The communication bus is for realizing the connection communication between processor and memory;The processor is for executing memory The program of middle storage, the step of to realize preceding method.
To achieve the above object, the present invention provides a kind of computer readable storage medium, the computer-readable storages Media storage has one or more program, and one or more of programs can be executed by one or more processor, with The step of realizing preceding method.
According to above technical scheme, it is known that hardware-accelerated control method, terminal and computer-readable storage medium of the invention Matter has at least the following advantages:
When application request special interface closes function of hardware acceleration, it is hardware-accelerated to first determine whether terminal hardware is supported Function, when terminal hardware supports function of hardware acceleration, it is forbidden to close function of hardware acceleration, and force using function of hardware acceleration Application view is drawn, this is conducive to the performance for making full use of terminal hardware, Lai Liuchang drawing view, to be avoided in drawing process There is Caton.
Detailed description of the invention
The hardware structural diagram of Fig. 1 mobile terminal of each embodiment to realize the present invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the flow chart according to the hardware-accelerated control method of one embodiment of the present of invention;
Fig. 4 is the flow chart according to the hardware-accelerated control method of one embodiment of the present of invention;
Fig. 5 is the schematic diagram according to the hardware-accelerated control method of one embodiment of the present of invention;
Fig. 6 is the flow chart according to the hardware-accelerated control method of one embodiment of the present of invention;
Fig. 7 is the block diagram according to the terminal of one embodiment of the present of invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element Be conducive to explanation of the invention, itself there is no a distinctive meaning.Therefore, " module ", " component " or " unit " can mix Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1 Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram, Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102 Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103 Audio output relevant to the peculiar function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model. Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition) The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071 Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel 1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example, External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation 204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS (Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201 Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the method for the present invention is proposed.
As shown in figure 3, providing a kind of hardware-accelerated control method in one embodiment of the present of invention, comprising:
Step S310, when application request calls the preset interface of terminal system to close function of hardware acceleration, detection is eventually Whether the hardware at end supports function of hardware acceleration.
In the present embodiment, the type of terminal system is not limited, such as can be android system.In this reality It applies in example, preset interface is not limited, by taking android system as an example, the interface for being used to control function of hardware acceleration is SetLayerType interface.In the present embodiment, by taking android system as an example, view, that is, view is presented as figure circle of application Face.
In the present embodiment, for hardware (usually have draw function module) the higher equipment of performance, in order to Higher graphic plotting effect is enough improved, often supports function of hardware acceleration, after function of hardware acceleration is opened, related hardware can It is drawn in work with participating in, gives full play to self performance, reduce the load of central processing unit, improve rendering quality.
Step S320 forces to use function of hardware acceleration by preset interface when detecting support function of hardware acceleration To draw the view of application.
It is first determined whether according to the technical solution of the present embodiment when application request special interface closes function of hardware acceleration Whether terminal hardware supports function of hardware acceleration, when terminal hardware supports function of hardware acceleration, it is forbidden to close hardware-accelerated function Can, and force using function of hardware acceleration drawing view, this is conducive to the performance for making full use of terminal hardware, carrys out smooth drafting view Figure, to avoid occurring Caton in drawing process.
As shown in figure 4, providing a kind of hardware-accelerated control method in one embodiment of the present of invention, comprising:
Step S410, when application request calls the preset interface of terminal system to close function of hardware acceleration, detection view Whether the title of figure has been recorded.
Step S420, when the title of view is not recorded, whether the hardware for detecting terminal supports function of hardware acceleration.
In the present embodiment, when application request calling interface turns off function of hardware acceleration, the name of the view is detected first Claim whether to be recorded, hardware is continued to test if not being recorded and whether supports hardware-accelerated, and is forcing to add using hardware The title of view is recorded in after fast function, explanation has carried out detection judgement for the view if being recorded, and determines direct The view is drawn using function of hardware acceleration.
Step S430 is detecting whether detection is surpassed using processor drawing view when supporting function of hardware acceleration When or fall frame.
Step S440 is detecting time-out occur or when falling frame, by preset interface force using function of hardware acceleration with Drawing view records the title of view.
In the present embodiment, if processor carrys out drawing view and will appear Caton or fall frame phenomenon, illustrate at this time very It is necessary to the performances using other hardware, to share the burden of processor, while improving the quality of graphic plotting.
Step S450, when the title of view is recorded, execute by preset interface force use function of hardware acceleration with Drawing view, concrete mode are to set the corresponding application of view to force to use function of hardware acceleration drawing view.
In the present embodiment, then for the drafting of the view, hardware-accelerated function can directly be used according to setting every time Application view can be drawn.
One specific embodiment of the present embodiment is as shown in Figure 5.
The realization principle of the present embodiment technical solution is the setLayerType in android system frame View code Increase in interface and intercept decision logic, when judgement application is attempted by calling this interface to close hardware-accelerated, judgement is current Whether system equipment hardware supports hardware-accelerated movement, and measures and records the title of this View and render whether time-consuming occurs Time-out, if device hardware itself is supported hardware-accelerated, and there is time-out and falls frame in the color applying drawing of the View, then forces setting should View calls setLayerType interface to be closed using the hardware-accelerated View for carrying out color applying drawing and ignoring the next title Hardware-accelerated movement is closed, guarantees the performance of interface rendering display.
It according to the technical solution of the present embodiment, promotes interface View and renders performance, reduce since application closing is hardware-accelerated Caused by rendering Caton behavior.
As shown in fig. 6, providing a kind of hardware-accelerated control method in one embodiment of the present of invention, comprising:
Step S610, when application request calls the preset interface of terminal system to close function of hardware acceleration, detection is eventually Whether the hardware at end supports function of hardware acceleration.
Step S620, when detecting support function of hardware acceleration, the load of measurement processor.
In the present embodiment, when the load of processor is higher, illustrate to complete View Drawing by processor, it may The phenomenon that Caton occur or falling frame, function of hardware acceleration can be used at this time and carry out drawing view, to reduce the burden of processor, And promote drawing quality.
Step S630 forces to use function of hardware acceleration by preset interface when the load of processor is more than preset value To draw the view of application.
In the technical scheme of this embodiment, the step of measurement processor loads can also be replaced by following steps: Identify the classification of the corresponding application of view.In the present embodiment, when application belongs to pre-set categories, then pass through preset interface pressure The view of application is drawn using function of hardware acceleration.
This is because the application for such as game class, to the more demanding of View Drawing, and the resource needed compared with It is more, for the view of such application, need using function of hardware acceleration, to ensure the quality of graphic plotting.
As shown in fig. 7, providing a kind of terminal in one embodiment of the present of invention, terminal includes processor 710, memory 720, communication bus 730;Communication bus 730 is for realizing the connection communication between processor 710 and memory 720;Processor 710 execute program for executing the calculating task stored in memory 720, to perform the steps of
When application request calls the preset interface of terminal system to close function of hardware acceleration, the hardware for detecting terminal is No support function of hardware acceleration.
In the present embodiment, the type of terminal system is not limited, such as can be android system.In this reality It applies in example, preset interface is not limited, by taking android system as an example, the interface for being used to control function of hardware acceleration is SetLayerType interface.In the present embodiment, by taking android system as an example, view, that is, view is presented as figure circle of application Face.
In the present embodiment, for hardware (usually have draw function module) the higher equipment of performance, in order to Higher graphic plotting effect is enough improved, often supports function of hardware acceleration, after function of hardware acceleration is opened, related hardware can It is drawn in work with participating in, gives full play to self performance, reduce the load of central processing unit, improve rendering quality.
When detecting support function of hardware acceleration, forced using function of hardware acceleration by preset interface to draw application View.
It is first determined whether according to the technical solution of the present embodiment when application request special interface closes function of hardware acceleration Whether terminal hardware supports function of hardware acceleration, when terminal hardware supports function of hardware acceleration, it is forbidden to close hardware-accelerated function Can, and force using function of hardware acceleration drawing view, this is conducive to the performance for making full use of terminal hardware, carrys out smooth drafting view Figure, to avoid occurring Caton in drawing process.
As shown in fig. 7, providing a kind of terminal in one embodiment of the present of invention, terminal includes processor 710, memory 720, communication bus 730;Communication bus 730 is for realizing the connection communication between processor 710 and memory 720;Processor 710 execute program for executing the calculating task stored in memory 720, to perform the steps of
When application request calls the preset interface of terminal system to close function of hardware acceleration, the title for detecting view is It is no to be recorded.
When the title of view is not recorded, whether the hardware for detecting terminal supports function of hardware acceleration.
In the present embodiment, when application request calling interface turns off function of hardware acceleration, the name of the view is detected first Claim whether to be recorded, hardware is continued to test if not being recorded and whether supports hardware-accelerated, and is forcing to add using hardware The title of view is recorded in after fast function, explanation has carried out detection judgement for the view if being recorded, and determines direct The view is drawn using function of hardware acceleration.
Detecting whether detection time-out occurs using processor drawing view or fall frame when supporting function of hardware acceleration.
It is detecting time-out occur or when falling frame, is being forced using function of hardware acceleration by preset interface with drawing view, Record the title of view.
In the present embodiment, if processor carrys out drawing view and will appear Caton or fall frame phenomenon, illustrate at this time very It is necessary to the performances using other hardware, to share the burden of processor, while improving the quality of graphic plotting.
When the title of view is recorded, executes and forces to use function of hardware acceleration with drawing view by preset interface, Concrete mode is to set the corresponding application of view to force to use function of hardware acceleration drawing view.
In the present embodiment, then for the drafting of the view, hardware-accelerated function can directly be used according to setting every time Application view can be drawn.
One specific embodiment of the present embodiment is as shown in Figure 5.
The realization principle of the present embodiment technical solution is the setLayerType in android system frame View code Increase in interface and intercept decision logic, when judgement application is attempted by calling this interface to close hardware-accelerated, judgement is current Whether system equipment hardware supports hardware-accelerated movement, and measures and records the title of this View and render whether time-consuming occurs Time-out, if device hardware itself is supported hardware-accelerated, and there is time-out and falls frame in the color applying drawing of the View, then forces setting should View calls setLayerType interface to be closed using the hardware-accelerated View for carrying out color applying drawing and ignoring the next title Hardware-accelerated movement is closed, guarantees the performance of interface rendering display.
It according to the technical solution of the present embodiment, promotes interface View and renders performance, reduce since application closing is hardware-accelerated Caused by rendering Caton behavior.
As shown in fig. 7, providing a kind of terminal in one embodiment of the present of invention, terminal includes processor 710, memory 720, communication bus 730;Communication bus 730 is for realizing the connection communication between processor 710 and memory 720;Processor 710 execute program for executing the calculating task stored in memory 720, to perform the steps of
When application request calls the preset interface of terminal system to close function of hardware acceleration, the hardware for detecting terminal is No support function of hardware acceleration.
When detecting support function of hardware acceleration, the load of measurement processor.
In the present embodiment, when the load of processor is higher, illustrate to complete View Drawing by processor, it may The phenomenon that Caton occur or falling frame, function of hardware acceleration can be used at this time and carry out drawing view, to reduce the burden of processor, And promote drawing quality.
When the load of processor is more than preset value, forced using function of hardware acceleration by preset interface to draw application View.
In the technical scheme of this embodiment, the step of measurement processor loads can also be replaced by following steps: Identify the classification of the corresponding application of view.In the present embodiment, when application belongs to pre-set categories, then pass through preset interface pressure The view of application is drawn using function of hardware acceleration.
This is because the application for such as game class, to the more demanding of View Drawing, and the resource needed compared with It is more, for the view of such application, need using function of hardware acceleration, to ensure the quality of graphic plotting.
A kind of computer readable storage medium, computer-readable recording medium storage are provided in one embodiment of the present of invention There is one or more program, one or more program can be executed by one or more processor, to realize claim Following steps:
When application request calls the preset interface of terminal system to close function of hardware acceleration, the hardware for detecting terminal is No support function of hardware acceleration.
In the present embodiment, the type of terminal system is not limited, such as can be android system.In this reality It applies in example, preset interface is not limited, by taking android system as an example, the interface for being used to control function of hardware acceleration is SetLayerType interface.In the present embodiment, by taking android system as an example, view, that is, view is presented as figure circle of application Face.
In the present embodiment, for hardware (usually have draw function module) the higher equipment of performance, in order to Higher graphic plotting effect is enough improved, often supports function of hardware acceleration, after function of hardware acceleration is opened, related hardware can It is drawn in work with participating in, gives full play to self performance, reduce the load of central processing unit, improve rendering quality.
When detecting support function of hardware acceleration, forced using function of hardware acceleration by preset interface to draw application View.
It is first determined whether according to the technical solution of the present embodiment when application request special interface closes function of hardware acceleration Whether terminal hardware supports function of hardware acceleration, when terminal hardware supports function of hardware acceleration, it is forbidden to close hardware-accelerated function Can, and force using function of hardware acceleration drawing view, this is conducive to the performance for making full use of terminal hardware, carrys out smooth drafting view Figure, to avoid occurring Caton in drawing process.
A kind of computer readable storage medium, computer-readable recording medium storage are provided in one embodiment of the present of invention There is one or more program, one or more program can be executed by one or more processor, to realize claim Following steps:
When application request calls the preset interface of terminal system to close function of hardware acceleration, the title for detecting view is It is no to be recorded.
When the title of view is not recorded, whether the hardware for detecting terminal supports function of hardware acceleration.
In the present embodiment, when application request calling interface turns off function of hardware acceleration, the name of the view is detected first Claim whether to be recorded, hardware is continued to test if not being recorded and whether supports hardware-accelerated, and is forcing to add using hardware The title of view is recorded in after fast function, explanation has carried out detection judgement for the view if being recorded, and determines direct The view is drawn using function of hardware acceleration.
Detecting whether detection time-out occurs using processor drawing view or fall frame when supporting function of hardware acceleration.
It is detecting time-out occur or when falling frame, is being forced using function of hardware acceleration by preset interface with drawing view, Record the title of view.
In the present embodiment, if processor carrys out drawing view and will appear Caton or fall frame phenomenon, illustrate at this time very It is necessary to the performances using other hardware, to share the burden of processor, while improving the quality of graphic plotting.
When the title of view is recorded, executes and forces to use function of hardware acceleration with drawing view by preset interface, Concrete mode is to set the corresponding application of view to force to use function of hardware acceleration drawing view.
In the present embodiment, then for the drafting of the view, hardware-accelerated function can directly be used according to setting every time Application view can be drawn.
One specific embodiment of the present embodiment is as shown in Figure 5.
The realization principle of the present embodiment technical solution is the setLayerType in android system frame View code Increase in interface and intercept decision logic, when judgement application is attempted by calling this interface to close hardware-accelerated, judgement is current Whether system equipment hardware supports hardware-accelerated movement, and measures and records the title of this View and render whether time-consuming occurs Time-out, if device hardware itself is supported hardware-accelerated, and there is time-out and falls frame in the color applying drawing of the View, then forces setting should View calls setLayerType interface to be closed using the hardware-accelerated View for carrying out color applying drawing and ignoring the next title Hardware-accelerated movement is closed, guarantees the performance of interface rendering display.
It according to the technical solution of the present embodiment, promotes interface View and renders performance, reduce since application closing is hardware-accelerated Caused by rendering Caton behavior.
A kind of computer readable storage medium, computer-readable recording medium storage are provided in one embodiment of the present of invention There is one or more program, one or more program can be executed by one or more processor, to realize claim Following steps:
When application request calls the preset interface of terminal system to close function of hardware acceleration, the hardware for detecting terminal is No support function of hardware acceleration.
When detecting support function of hardware acceleration, the load of measurement processor.
In the present embodiment, when the load of processor is higher, illustrate to complete View Drawing by processor, it may The phenomenon that Caton occur or falling frame, function of hardware acceleration can be used at this time and carry out drawing view, to reduce the burden of processor, And promote drawing quality.
When the load of processor is more than preset value, forced using function of hardware acceleration by preset interface to draw application View.
In the technical scheme of this embodiment, the step of measurement processor loads can also be replaced by following steps: Identify the classification of the corresponding application of view.In the present embodiment, when application belongs to pre-set categories, then pass through preset interface pressure The view of application is drawn using function of hardware acceleration.
This is because the application for such as game class, to the more demanding of View Drawing, and the resource needed compared with It is more, for the view of such application, need using function of hardware acceleration, to ensure the quality of graphic plotting.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form, all of these belong to the protection of the present invention.

Claims (10)

1. a kind of hardware-accelerated control method characterized by comprising
When application request calls the preset interface of terminal system to close function of hardware acceleration, the hardware for detecting the terminal is No support function of hardware acceleration;
When detecting support function of hardware acceleration, forced by the preset interface described to draw using function of hardware acceleration The view of application.
2. the method according to claim 1, wherein forcing to add using hardware by the preset interface described Before view of the fast function to draw the application, further includes:
Detection draws the view using processor and time-out whether occurs or fall frame;
Detecting that when time-out occur or falling frame, execution is described to be forced using function of hardware acceleration by the preset interface to draw Make the view of the application.
3. the method according to claim 1, wherein forcing to add using hardware by the preset interface described Before view of the fast function to draw the application, further includes:
Detect the load of the processor;
When the load of the processor is more than preset value, execution is described to be forced to use hardware-accelerated function by the preset interface It can be to draw the view of the application.
4. the method according to claim 1, wherein forcing to add using hardware by the preset interface described Before view of the fast function to draw the application, further includes:
Identify the classification of the application;
When the application belongs to pre-set categories, execution is described to be forced using function of hardware acceleration by the preset interface to draw Make the view.
5. the method according to claim 1, wherein whether the hardware in the detection terminal supports hardware Before acceleration function, further includes:
Whether the title for detecting the view has been recorded;
When the title of the view is not recorded, whether the hardware for executing the detection terminal supports hardware-accelerated function Energy.
6. according to the method described in claim 5, it is characterized in that, forcing to add using hardware by the preset interface described After view of the fast function to draw the application, further includes:
Record the title of the view.
7. according to the method described in claim 5, it is characterized by further comprising:
When the title of the view is recorded, execution is described to be forced using function of hardware acceleration by the preset interface to draw Make the view of the application.
8. the method according to claim 1, wherein described forced by the preset interface using hardware-accelerated Function is to draw the application view, comprising:
The corresponding application of the view is set as forcing to draw the view using function of hardware acceleration.
9. a kind of terminal, which is characterized in that the terminal includes processor, memory, communication bus;The communication bus is used for Realize the connection communication between processor and memory;The processor is for executing the program stored in memory, to realize Step described in any item of the claim 1 to 8.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage have one or Multiple programs, one or more of programs can be executed by one or more processor, to realize in claim 1 to 8 The step of described in any item methods.
CN201910239542.7A 2019-03-27 2019-03-27 Hardware-accelerated control method, terminal and computer readable storage medium Pending CN109947519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910239542.7A CN109947519A (en) 2019-03-27 2019-03-27 Hardware-accelerated control method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910239542.7A CN109947519A (en) 2019-03-27 2019-03-27 Hardware-accelerated control method, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109947519A true CN109947519A (en) 2019-06-28

Family

ID=67012017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910239542.7A Pending CN109947519A (en) 2019-03-27 2019-03-27 Hardware-accelerated control method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109947519A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199149A (en) * 2020-10-16 2021-01-08 维沃移动通信有限公司 Interface rendering method and device and electronic equipment
CN112650465A (en) * 2021-01-12 2021-04-13 北京字节跳动网络技术有限公司 Terminal control method and device, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090322764A1 (en) * 2008-06-26 2009-12-31 Microsoft Corporation Dynamically transitioning between hardware-accelerated and software rendering
CN103617191A (en) * 2013-11-07 2014-03-05 北京奇虎科技有限公司 Browser and method for rendering same by means of hardware acceleration
US20140215453A1 (en) * 2013-01-31 2014-07-31 Htc Corporation Methods for application management in an electronic device supporting hardware acceleration
US20140313209A1 (en) * 2011-12-30 2014-10-23 Ningxin Hu Selective hardware acceleration in video playback systems
CN106600670A (en) * 2016-10-19 2017-04-26 上海斐讯数据通信技术有限公司 Hardware acceleration control method and system in view drafting

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090322764A1 (en) * 2008-06-26 2009-12-31 Microsoft Corporation Dynamically transitioning between hardware-accelerated and software rendering
US20140313209A1 (en) * 2011-12-30 2014-10-23 Ningxin Hu Selective hardware acceleration in video playback systems
US20140215453A1 (en) * 2013-01-31 2014-07-31 Htc Corporation Methods for application management in an electronic device supporting hardware acceleration
CN103617191A (en) * 2013-11-07 2014-03-05 北京奇虎科技有限公司 Browser and method for rendering same by means of hardware acceleration
CN106600670A (en) * 2016-10-19 2017-04-26 上海斐讯数据通信技术有限公司 Hardware acceleration control method and system in view drafting

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199149A (en) * 2020-10-16 2021-01-08 维沃移动通信有限公司 Interface rendering method and device and electronic equipment
CN112650465A (en) * 2021-01-12 2021-04-13 北京字节跳动网络技术有限公司 Terminal control method and device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN108391025A (en) A kind of network access management method, mobile terminal and computer readable storage medium
CN109538538A (en) A kind of processing method of fan noise, mobile terminal and storage medium
CN108512991A (en) A kind of based reminding method, mobile terminal and computer readable storage medium
CN110187808A (en) Dynamic wallpaper setting method, device and computer readable storage medium
CN109462700A (en) A kind of call method, mobile terminal and computer readable storage medium
CN109428923A (en) Information push method, server, terminal and computer readable storage medium
CN110290269A (en) Display control method, mobile terminal and computer readable storage medium
CN109348071A (en) Call-information display methods, terminal and computer readable storage medium
CN109947519A (en) Hardware-accelerated control method, terminal and computer readable storage medium
CN108966162A (en) Data communications method, communication processing equipment, terminal and readable storage medium storing program for executing
CN108495302A (en) SIM card initializes accelerated method, mobile terminal and readable storage medium storing program for executing
CN110099173A (en) Method, terminal and the storage medium of touch experience pattern switching
CN110096173A (en) Method for controlling mobile terminal, mobile terminal and computer readable storage medium
CN109714460A (en) Press key expansion device, terminal, key expansion method and storage medium
CN109582565A (en) Prevent the method, terminal and computer storage medium of application crashes
CN108833687A (en) Terminal prot open method, terminal and computer readable storage medium
CN109151201A (en) A kind of Anti-addiction method, mobile terminal and computer storage medium
CN109151163A (en) A kind of method for controlling mobile terminal, mobile terminal and computer readable storage medium
CN108879117A (en) Mobile terminal and its antenna structure
CN108650404A (en) Port start-up circuit, device and mobile terminal
CN109739676A (en) A kind of operational monitoring method, mobile terminal and computer readable storage medium
CN109616128A (en) Voice transmitting method, device and computer readable storage medium
CN110069291A (en) A kind of display control method, mobile terminal and computer readable storage medium
CN110083402A (en) Using starting method, terminal and computer readable storage medium
CN110046011A (en) A kind of display methods, mobile terminal and computer readable storage medium

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