[go: up one dir, main page]

CN106502662A - Multizone pattern drawing method and device for intelligent operating system - Google Patents

Multizone pattern drawing method and device for intelligent operating system Download PDF

Info

Publication number
CN106502662A
CN106502662A CN201610902201.XA CN201610902201A CN106502662A CN 106502662 A CN106502662 A CN 106502662A CN 201610902201 A CN201610902201 A CN 201610902201A CN 106502662 A CN106502662 A CN 106502662A
Authority
CN
China
Prior art keywords
rendering
graphics
threads
operating system
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.)
Granted
Application number
CN201610902201.XA
Other languages
Chinese (zh)
Other versions
CN106502662B (en
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.)
Beijing Rubu Technology Co ltd
Original Assignee
Beijing Intelligent Housekeeper 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 Beijing Intelligent Housekeeper Technology Co Ltd filed Critical Beijing Intelligent Housekeeper Technology Co Ltd
Priority to CN201610902201.XA priority Critical patent/CN106502662B/en
Publication of CN106502662A publication Critical patent/CN106502662A/en
Application granted granted Critical
Publication of CN106502662B publication Critical patent/CN106502662B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Image Generation (AREA)

Abstract

The present invention proposes a kind of multizone pattern drawing method and device for intelligent operating system.The method is comprised the following steps:Multiple threads that render that Java ends create are bound with multiple rendering engine examples that Native ends create;One or more of figure rendering tasks are submitted to Native ends based on the corresponding thread that renders;Obtain at Native ends and rendered with carrying out figure with the rendering engine example for rendering thread binding corresponding to one or more of figure rendering tasks;And in the screen area corresponding to the rendering engine example that the rendering result of one or more of figure rendering tasks is respectively displayed on and is rendered.Present invention achieves multiple Open GL context environmentals are managed in the process simultaneously, with thread independence, internal memory and multizone can not be limited while the advantage that renders while carry out the technique effect of graphic plotting in multiple regions so as to reach.

Description

用于智能操作系统的多区域图形绘制方法及装置Multi-area graphics drawing method and device for intelligent operating system

技术领域technical field

本发明涉及图形绘制领域,更具体地,涉及一种用于智能操作系统的多区域图形绘制方法及装置。The present invention relates to the field of graphics drawing, and more specifically, to a multi-region graphics drawing method and device for an intelligent operating system.

背景技术Background technique

一般地,智能操作系统提供封装好的视图框架以实现图形绘制、变换、动画等功能。这种方式最明显的缺陷在于图形的渲染是运行于业务逻辑线程的,对于有频繁图形刷新需求的场景,会对业务逻辑线程造成压力,从而导致图形刷新的卡顿。另一方面,这种方式下,对于使用大量图片的场景,图片的加载将会消耗大量的应用层内存。但是对于单个应用来说,它分配的内存是很有限的,这种场景很容易造成应用的崩溃。Generally, a smart operating system provides a packaged view framework to implement functions such as graphics drawing, transformation, and animation. The most obvious defect of this method is that the rendering of graphics runs on the business logic thread. For scenarios with frequent graphics refresh requirements, it will put pressure on the business logic thread, resulting in graphics refresh lag. On the other hand, in this way, for scenes that use a large number of pictures, the loading of pictures will consume a lot of application layer memory. But for a single application, the allocated memory is very limited, and this scenario can easily cause the application to crash.

智能操作系统中通常实现Open GL(Open Graphics Library)作为对图形渲染的支持。这个图形库是直接操作显卡进行渲染的,一方面这个库是原生方式实现(C,C++),因此渲染时所占用的内存并不属于应用层内存,所以不会有内存分配的限制;另一方面,使用这个库进行的渲染是可以在独立的线程完成的。Open GL (Open Graphics Library) is usually implemented in a smart operating system as a support for graphics rendering. This graphics library directly operates the graphics card for rendering. On the one hand, this library is implemented in a native way (C, C++), so the memory occupied during rendering does not belong to the application layer memory, so there will be no memory allocation restrictions; on the other hand On the other hand, rendering using this library can be done in a separate thread.

发明人发现,目前封装Open GL的图形引擎的解决方案中,比如Cocos2d,只允许同时在一个进程内渲染一块区域,这极大的限制了使用场景。因此,有必要开发一种同时在屏幕的多块区域进行图形渲染的方法及装置。The inventors found that in the current graphics engine solutions that encapsulate Open GL, such as Cocos2d, only one area is allowed to be rendered in one process at the same time, which greatly limits the usage scenarios. Therefore, it is necessary to develop a method and device for rendering graphics on multiple areas of the screen at the same time.

公开于本发明背景技术部分的信息仅仅旨在加深对本发明的一般背景技术的理解,而不应当被视为承认或以任何形式暗示该信息构成已为本领域技术人员所公知的现有技术。The information disclosed in the background of the present invention is only intended to deepen the understanding of the general background of the present invention, and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art known to those skilled in the art.

发明内容Contents of the invention

本发明的目的是提供一种高性能的用于智能操作系统的多区域图形绘制方法及装置,以实现同时在屏幕的多块区域进行图形渲染。The purpose of the present invention is to provide a high-performance multi-area graphics drawing method and device for an intelligent operating system, so as to realize graphics rendering in multiple areas of the screen at the same time.

根据本发明的一方面,提出了一种用于智能操作系统的多区域图形绘制方法。该方法可以包括以下步骤:将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定;将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端;在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染;以及将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中。According to one aspect of the present invention, a multi-region graphics drawing method for an intelligent operating system is proposed. The method may include the following steps: binding multiple rendering threads created on the Java side to multiple rendering engine instances created on the Native side; submitting one or more graphics rendering tasks received by the Java side to different rendering threads respectively , and submit the one or more graphics rendering tasks to the Native side based on the corresponding rendering threads; obtain the rendering engine instance bound to the rendering threads corresponding to the one or more graphics rendering tasks on the Native side to performing graphics rendering; and displaying the rendering results of the one or more graphics rendering tasks in the screen areas corresponding to the rendering engine instances performing rendering.

优选地,通过将所述多个渲染引擎实例置入线程私有数据来进行与所述多个渲染线程的绑定。Preferably, the binding to the plurality of rendering threads is performed by putting the plurality of rendering engine instances into thread private data.

优选地,Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例。Preferably, the Natvie side acquires the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task.

优选地,所述渲染引擎通过Open GL命令进行图形渲染。Preferably, the rendering engine performs graphics rendering through Open GL commands.

优选地,所述方法进一步包括:在图形渲染任务完成之后,Native端将渲染状态回调至Java端。Preferably, the method further includes: after the graphics rendering task is completed, the Native end calls back the rendering status to the Java end.

根据本发明的另一方面,提出了一种用于智能操作系统的多区域图形绘制装置。该装置可以包括:用于将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定的单元;用于将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端的单元;用于在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染的单元;以及用于将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中的单元。According to another aspect of the present invention, a multi-region graphics rendering device for an intelligent operating system is proposed. The device may include: a unit for binding multiple rendering threads created by the Java end to multiple rendering engine instances created by the Native end; for submitting one or more graphics rendering tasks received by the Java end to the In different rendering threads, and submit the one or more graphics rendering tasks to the unit of the Native side based on the corresponding rendering threads; for obtaining the rendering threads corresponding to the one or more graphics rendering tasks at the Native side A bound rendering engine instance for graphics rendering; and a unit for displaying the rendering results of the one or more graphics rendering tasks in screen areas corresponding to the rendering engine instances performing rendering.

优选地,通过将所述多个渲染引擎实例置入线程私有数据来进行与所述多个渲染线程的绑定。Preferably, the binding to the plurality of rendering threads is performed by putting the plurality of rendering engine instances into thread private data.

优选地,Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例。Preferably, the Natvie side acquires the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task.

优选地,所述渲染引擎通过Open GL命令进行图形渲染。Preferably, the rendering engine performs graphics rendering through Open GL commands.

优选地,所述装置进一步包括:用于在图形渲染任务完成之后,使Native端将渲染状态回调至Java端的单元。Preferably, the device further includes: a unit for causing the Native side to call back the rendering state to the Java side after the graphics rendering task is completed.

本发明通过Native部分的单例设计模式和线程私有数据TSD,结合Java部分多线程的方式,实现在一个进程内同时管理多个Open GL上下文环境,从而达到可以同时在多个区域进行图形绘制的技术效果。具有线程独立、不限制内存和多区域同时渲染的优势。The present invention realizes simultaneous management of multiple Open GL context environments in one process through the singleton design mode of the Native part and the thread private data TSD, combined with the multi-threading method of the Java part, so as to achieve the ability to draw graphics in multiple areas at the same time technical effect. It has the advantages of thread independence, unlimited memory and simultaneous rendering of multiple regions.

本发明的方法具有其它的特性和优点,这些特性和优点从并入本文中的附图和随后的具体实施例中将是显而易见的,或者将在并入本文中的附图和随后的具体实施例中进行详细陈述,这些附图和具体实施例共同用于解释本发明的特定原理。The method of the present invention has other features and advantages that will be apparent from, or will be apparent from, the drawings and detailed description that follow, incorporated herein. The drawings and specific examples are set forth in detail in the examples, and these drawings and specific examples together serve to explain certain principles of the invention.

附图说明Description of drawings

通过结合附图对本发明示例性实施例进行更详细的描述,本发明的上述以及其它目的、特征和优势将变得更加明显,其中,在本发明示例性实施例中,相同的参考标号通常代表相同部件。The above and other objects, features and advantages of the present invention will become more apparent by describing the exemplary embodiments of the present invention in more detail with reference to the accompanying drawings, wherein, in the exemplary embodiments of the present invention, the same reference numerals generally represent same parts.

图1为根据本发明的一个实施例的用于智能操作系统的多区域绘图方法的流程图。FIG. 1 is a flowchart of a multi-region drawing method for an intelligent operating system according to an embodiment of the present invention.

图2为包括两个图形绘制区域的屏幕,其中,左上图为p1,右下图为p2。Fig. 2 is a screen including two graphics drawing areas, wherein the upper left figure is p1, and the lower right figure is p2.

具体实施方式detailed description

下面将参照附图更详细地描述本发明。虽然附图中显示了本发明的优选实施例,然而应该理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。The present invention will be described in more detail below with reference to the accompanying drawings. Although preferred embodiments of the invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

图1示出了根据本发明的一个实施例的用于智能操作系统的多区域图形绘制方法。Fig. 1 shows a multi-region graphics drawing method for an intelligent operating system according to an embodiment of the present invention.

本实施例的智能操作系统环境为Android,支持Open GL。实现步骤大致上可以分为两个部分,分别Java部分和Native部分。其中,Java部分由Java语言程序实现,运行于Android虚拟机;Native部分通过C/C++语言实现,运行于本地服务器。The intelligent operating system environment of this embodiment is Android, which supports Open GL. The implementation steps can be roughly divided into two parts, namely the Java part and the Native part. Among them, the Java part is realized by the Java language program and runs on the Android virtual machine; the Native part is realized by the C/C++ language and runs on the local server.

Open GL具有两个主要特点:Open GL has two main characteristics:

1、它是与硬件无关的软件接口,可以在不同的平台之间进行移植;1. It is a software interface that has nothing to do with hardware and can be transplanted between different platforms;

2、可以在客户机/服务器系统中工作,即具有网络功能。2. It can work in a client/server system, that is, it has network functions.

本实施例的用于智能操作系统的多区域图形绘制方法可以包括以下步骤:The multi-region graphics drawing method for an intelligent operating system in this embodiment may include the following steps:

1)将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定。1) Bind multiple rendering threads created on the Java side with multiple rendering engine instances created on the Native side.

在Java端可以同时创建多个渲染线程,相应地,为Native端提供多个渲染线程环境,并生成多个上下文环境。即在Java端创建多个渲染视图实例。Multiple rendering threads can be created at the same time on the Java side. Correspondingly, multiple rendering thread environments are provided for the Native side and multiple contexts are generated. That is, create multiple rendering view instances on the Java side.

渲染视图实质上是用于在Java端控制Native端的渲染的控制器。渲染视图类可以包括表面视图(GLSurfaceView)实例和纹理视图(GLTexureView)实例,它们为Native端提供渲染线程环境。The rendering view is essentially a controller used to control the rendering of the Native side on the Java side. The rendering view class can include surface view (GLSurfaceView) instances and texture view (GLTexureView) instances, which provide the rendering thread environment for the Native side.

Java端通过Open GL库接口生成用于使用Open GL库渲染图形的上下文环境。The Java side generates a context environment for rendering graphics using the Open GL library interface through the Open GL library interface.

Open GL上下文环境,即GLContext,用于存储Open GL绘图的所有状态信息。它实际上代表了渲染命令绘图的默认帧缓存(framebuffer),GLContext被销毁,Open GL也不复存在。The Open GL context environment, namely GLContext, is used to store all state information of Open GL drawing. It actually represents the default framebuffer for rendering command graphics, the GLContext is destroyed, and Open GL no longer exists.

创建多个线程,即生成多个用于Open GL的上下文环境,而一个线程只能拥有一个上下文,与此对应,一个上下文环境只能属于一个线程,不能被不同线程同时共享。Create multiple threads, that is, generate multiple contexts for Open GL, and a thread can only have one context. Correspondingly, a context can only belong to one thread and cannot be shared by different threads at the same time.

在Java端创建的多个渲染线程是独立于主线程之外的线程,这是为了保证渲染性能不受业务逻辑线程的影响。The multiple rendering threads created on the Java side are threads independent of the main thread, in order to ensure that the rendering performance is not affected by the business logic thread.

在Native端,基于Java端所创建的多个渲染线程环境创建渲染引擎实例。同时,通过所述渲染引擎实例初始化Open GL渲染环境。On the Native side, a rendering engine instance is created based on the multiple rendering thread environments created on the Java side. At the same time, an Open GL rendering environment is initialized through the rendering engine instance.

初始化Open GL渲染环境主要是设置Open GL窗口的重要属性,包括像素格式和缓冲模式,颜色位数以及深度位数等等。Initializing the Open GL rendering environment is mainly to set the important properties of the Open GL window, including pixel format and buffer mode, color bits and depth bits, and so on.

Open GL提供两种颜色模式:RGB(RGBA)模式和颜色索引模式。在RGBA模式下所有颜色的定义用RGB三个值来表示,有时候也加上表示透明度的Alpha值。颜色索引模式下每个像素的颜色是用颜色索引表中的某个颜色索引值表示。Open GL provides two color modes: RGB (RGBA) mode and color index mode. In the RGBA mode, the definition of all colors is represented by three RGB values, and sometimes an Alpha value representing transparency is also added. The color of each pixel in the color index mode is represented by a certain color index value in the color index table.

Open GL可以提供双缓存来绘制图像。即在显示前台缓存中的图像同时,后台缓存绘制第2幅图像。当后台绘制完成后,后台缓存中的图像就显示出来。此时原来的前台缓存开始绘制第3幅图像,如此循环往复,以增加图像的输出速度。Open GL can provide double buffering to draw images. That is, while displaying the image in the front buffer, the background buffer draws the second image. When the background drawing is completed, the image in the background buffer is displayed. At this time, the original front buffer begins to draw the third image, and so on, so as to increase the output speed of the image.

由Native端所创建的每一个渲染引擎实例对应于屏幕的一块区域。Each rendering engine instance created by the Native side corresponds to an area of the screen.

渲染引擎实例实际上完成所有的图形渲染工作,即完成Open GL渲染环境初始化、纹理生成、坐标变化、色彩设置、图形渲染等。The rendering engine instance actually completes all graphics rendering work, that is, completes Open GL rendering environment initialization, texture generation, coordinate change, color setting, graphics rendering, etc.

所述渲染引擎实例通过Open GL库接口初始化Open GL渲染环境。The rendering engine instance initializes the Open GL rendering environment through the Open GL library interface.

将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定。在一个示例性实施方式中,通过将所述多个渲染引擎实例置入线程私有数据(TSD)来进行与所述多个渲染线程的绑定。Bind multiple rendering threads created on the Java side with multiple rendering engine instances created on the Native side. In an exemplary embodiment, the binding to the plurality of rendering threads is performed by putting the plurality of rendering engine instances into thread private data (TSD).

众所周知,在多线程环境下,由于数据空间是共享的,因此全局变量也为所有线程所共有。一个全局变量,所有线程都可以使用它,改变它的值,因此其中一个线程对全局变量的修改将影响到另一个线程的访问。因而在应用程序设计中有必要提供线程私有的全局变量,其使用同名而不同变量地址的线程相关数据结构。表面看起来其为全局变量,所有线程都可以使用它,而它的值在每一个线程中又是单独存储的。这样的数据结构被称为线程私有数据。As we all know, in a multi-threaded environment, since the data space is shared, global variables are also shared by all threads. A global variable, all threads can use it and change its value, so one thread's modification of the global variable will affect the access of another thread. Therefore, it is necessary to provide thread-private global variables in application design, which use thread-related data structures with the same name but different variable addresses. On the surface, it seems that it is a global variable, which can be used by all threads, and its value is stored separately in each thread. Such data structures are called thread-private data.

在分配线程私有数据之前,需要创建与线程私有数据相关联的键(key),并且设置线程私有数据的key值。虽然线程私有数据TSD的key在多个线程之间是共享的,然而对于每个线程该key值可以是不同的。Before allocating thread-private data, it is necessary to create a key (key) associated with the thread-private data, and set the key value of the thread-private data. Although the key of the thread-private data TSD is shared among multiple threads, the key value can be different for each thread.

在Native端,渲染引擎对外是单例模式的,但在进行多区域图形绘制时,实际上需要它是多例的。在本实例中通过单例模式结合线程私有数据技术来实现基于线程的多例模式,即线程不同,通过单例模式取到的实例也不同,即取到的实例与线程是对应的。On the Native side, the rendering engine is in singleton mode externally, but it is actually required to be multi-instance when drawing multi-region graphics. In this example, the thread-based multi-instance mode is realized by combining the singleton mode with the thread private data technology, that is, the instances obtained through the singleton mode are also different for different threads, that is, the obtained instances correspond to the threads.

具体地,在Java端可以创建多个渲染线程,多个线程之间可以共享线程私有数据TSD的key,也就是说,线程私有数据的访问权在多个渲染线程间共享。在Native端,在每个渲染线程所提供的渲染线程环境中分别新建了渲染引擎实例,将每个渲染引擎实例置入与它相关的渲染线程的TSD中。也就是说,在每个渲染线程中的线程私有数据的key值表示其相关联的渲染引擎。通过这种方式实现了渲染线程与渲染引擎的绑定,渲染实例的管理通过与之绑定的渲染线程完成,而渲染实例也只对与之绑定的线程可见。Specifically, multiple rendering threads can be created on the Java side, and the key of the thread-private data TSD can be shared between multiple threads, that is, the access right of thread-private data is shared among multiple rendering threads. On the Native side, a new rendering engine instance is created in the rendering thread environment provided by each rendering thread, and each rendering engine instance is placed in the TSD of its related rendering thread. That is to say, the key value of the thread private data in each rendering thread represents its associated rendering engine. In this way, the binding of the rendering thread and the rendering engine is realized, and the management of the rendering instance is completed through the rendering thread bound to it, and the rendering instance is only visible to the thread bound to it.

这种方式的优点是使得Native端可以按照单例的设计模式进行设计,省去了对多个实例的管理。传统的单例设计即当前类对外只有一个实例,一般来说对外只通过一个接口提供该实例。而通过引入TSD技术,虽然仍使用单例的设计模式,即对外也只提供一个接口获取实例,但对于同一个线程获取到的实例总是相同的,对于不同的线程获取到的是不同的实例。即该线程内,任何一个地方,都通过同一个的接口获取到相同的实例。在这种方式下,同一个线程内,省去了对多个实例的管理。The advantage of this method is that the Native side can be designed according to the singleton design pattern, eliminating the need to manage multiple instances. The traditional singleton design means that the current class has only one instance externally, and generally speaking, this instance is only provided externally through one interface. With the introduction of TSD technology, although the singleton design pattern is still used, that is, only one interface is provided to obtain instances externally, the instances obtained by the same thread are always the same, and different instances are obtained by different threads. . That is to say, in this thread, anywhere, the same instance is obtained through the same interface. In this way, the management of multiple instances is omitted in the same thread.

2)将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端。2) Submit one or more graphics rendering tasks received by the Java side to different rendering threads, and submit the one or more graphics rendering tasks to the Native side based on the corresponding rendering threads.

当Java端接收到多个图形渲染任务时,将不同的图形渲染任务提交到不同的渲染线程中,并且基于各自的渲染线程被提交到Native端。When the Java side receives multiple graphics rendering tasks, different graphics rendering tasks are submitted to different rendering threads, and are submitted to the Native side based on their respective rendering threads.

3)在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染。3) Obtain a rendering engine instance bound to the rendering thread corresponding to the one or more graphics rendering tasks on the Native side to perform graphics rendering.

Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例,进行图形渲染。The Natvie side acquires the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task, and performs graphics rendering.

渲染引擎实例通过Open GL命令进行图形渲染。The rendering engine instance performs graphics rendering through Open GL commands.

图形渲染通常包括以下几个阶段:Graphics rendering usually includes the following stages:

a)指定几何对象,例如点、线、三角形等一些几何单元。a) Designate geometric objects, such as some geometric units such as points, lines, and triangles.

b)顶点处理操作。这个阶段所接收到的数据是每个顶点的属性特征,输出的则是变换后的顶点数据。b) Vertex processing operations. The data received at this stage is the attribute characteristics of each vertex, and the output is the transformed vertex data.

c)图元组装。在顶点处理之后,顶点的全部属性都已经被确定,在这个阶段顶点会根据图元规则被组装成图元。c) Primitive assembly. After vertex processing, all the attributes of the vertices have been determined, and at this stage the vertices will be assembled into primitives according to primitive rules.

d)图元处理,主要是裁剪和消陷。d) Graphic element processing, mainly cropping and collapse.

e)栅格化操作。由图元处理阶段传递过来的图元数据在该阶段将会被分解成更小的单元并对应帧缓冲区的各个像素,这些单元被称之为片元。一个片元可能包含窗口左边、深度、颜色、纹理坐标等属性。e) Rasterization operation. The primitive data passed by the primitive processing stage will be decomposed into smaller units and correspond to each pixel of the frame buffer. These units are called fragments. A fragment may contain properties such as window left, depth, color, texture coordinates, etc.

f)片元处理。包括上纹理理,即通过纹理坐标取得纹理内存中相对应的颜色;雾化,通过片元距离对当前视点位置修改颜色;颜色汇总:将纹理、主定义的颜色、雾化的颜色、次颜色的光照阶段计算的颜色汇总到一起。f) Fragment processing. Including texture texture, that is, to obtain the corresponding color in the texture memory through texture coordinates; atomization, to modify the color of the current viewpoint position through the fragment distance; color summary: texture, main defined color, atomized color, secondary color The colors computed by the lighting stages are summed together.

g)逐个片元的操作。包括像素所有权、剪切、Alpha测试、模版测试、深度测试、混合等,这些操作最终会影响其在帧缓冲区的颜色值。g) Fragment-by-fragment operations. Including pixel ownership, clipping, alpha testing, stencil testing, depth testing, mixing, etc., these operations will eventually affect its color value in the frame buffer.

h)帧缓冲操作。在图形渲染完成之后,渲染引擎通过Open GL接口将渲染结果交换到显示缓冲区,完成显示。由于每一个渲染引擎实例对应于屏幕的一块区域,因此渲染的结果将直接显示到对应的屏幕区域。h) Frame buffer operation. After the graphics rendering is completed, the rendering engine exchanges the rendering results to the display buffer through the Open GL interface to complete the display. Since each rendering engine instance corresponds to an area of the screen, the rendered result will be directly displayed on the corresponding screen area.

4)将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中。4) Displaying the rendering results of the one or more graphics rendering tasks in the screen areas corresponding to the rendering engine instances performing rendering.

由于不同的渲染引擎实例对应于屏幕的不同区域,因此由不同渲染引擎实例执行的图形渲染任务的渲染结果可以同时在屏幕的不同区域中进行显示。由此实现了智能操作系统的多区域的图形绘制。Since different rendering engine instances correspond to different areas of the screen, rendering results of graphics rendering tasks executed by different rendering engine instances may be displayed in different areas of the screen at the same time. In this way, the multi-region graphics drawing of the intelligent operating system is realized.

在示例性实施例中,该用于智能操作系统的多区域图形绘制方法可以进一步包括:在图形渲染任务完成之后,Native端将渲染状态回调至Java端。In an exemplary embodiment, the multi-region graphics drawing method for an intelligent operating system may further include: after the graphics rendering task is completed, the Native side calls back the rendering state to the Java side.

当Native端的渲染引擎结束渲染,渲染引擎会将渲染状态返回Java端的渲染视图。即通知Java端渲染已完成或者渲染失败。When the rendering engine on the Native end finishes rendering, the rendering engine will return the rendering state to the rendering view on the Java end. That is, the Java side is notified that the rendering has been completed or the rendering failed.

本实施例的用于智能操作系统的多区域图形绘制方法的优点在于:The advantage of the multi-region graphics drawing method for the intelligent operating system of this embodiment is:

(1)图形渲染任务由Native端的渲染引擎实例执行,因此不受内存的限制。(1) The graphics rendering task is executed by the rendering engine instance on the Native side, so it is not limited by memory.

(2)渲染线程独立于主线程,不受业务逻辑线程影响;(2) The rendering thread is independent of the main thread and is not affected by the business logic thread;

(3)可以同时在屏幕的多个区域同时渲染;(3) It can be simultaneously rendered in multiple areas of the screen at the same time;

(4)通过渲染引擎的单例模式+线程私有数据技术实现基于线程的多例模式。(4) Realize thread-based multi-instance mode through the single-instance mode + thread private data technology of the rendering engine.

根据本发明的另一实施例,提供了一种用于智能操作系统的多区域图形绘制装置。该装置可以包括:用于将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定的单元;用于将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端的单元;用于在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染的单元;以及用于将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中的单元。According to another embodiment of the present invention, a multi-region graphics drawing device for an intelligent operating system is provided. The device may include: a unit for binding multiple rendering threads created by the Java end to multiple rendering engine instances created by the Native end; for submitting one or more graphics rendering tasks received by the Java end to the In different rendering threads, and submit the one or more graphics rendering tasks to the unit of the Native side based on the corresponding rendering threads; for obtaining the rendering threads corresponding to the one or more graphics rendering tasks at the Native side A bound rendering engine instance for graphics rendering; and a unit for displaying the rendering results of the one or more graphics rendering tasks in screen areas corresponding to the rendering engine instances performing rendering.

在示例性实施方式中,通过将所述多个渲染引擎实例置入线程私有数据来进行与所述多个渲染线程的绑定。In an exemplary embodiment, the binding to the plurality of rendering threads is performed by placing the plurality of rendering engine instances into thread private data.

在示例性实施方式中,Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例。In an exemplary implementation, the Natvie side obtains respectively the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task.

在示例性实施方式中,所述渲染引擎通过Open GL命令进行图形渲染。In an exemplary embodiment, the rendering engine performs graphics rendering through Open GL commands.

在示例性实施方式中,所述装置进一步包括:用于在图形渲染任务完成之后,使Native端将渲染状态回调至Java端的单元。In an exemplary embodiment, the device further includes: a unit for causing the Native side to call back the rendering status to the Java side after the graphics rendering task is completed.

本实施例通过Native部分的单例设计模式和线程私有数据TSD,结合Java部分多线程的方式,实现在一个进程内同时管理多个Open GL上下文环境,从而达到可以同时在多个区域进行图形绘制的技术效果。具有线程独立、不限制内存和多区域同时渲染的优势。In this embodiment, through the singleton design mode of the Native part and the thread private data TSD, combined with the multi-threading method of the Java part, it is possible to manage multiple Open GL contexts in one process at the same time, so that graphics can be drawn in multiple areas at the same time technical effect. It has the advantages of thread independence, unlimited memory and simultaneous rendering of multiple regions.

应用示例Application example

为便于理解本发明实施例的方案及其效果,以下给出一个具体应用示例。本领域技术人员应理解,该示例仅为了便于理解本发明,其任何具体细节并非意在以任何方式限制本发明。In order to facilitate the understanding of the solutions and effects of the embodiments of the present invention, a specific application example is given below. Those skilled in the art will understand that this example is only for the purpose of facilitating the understanding of the present invention, and any specific details thereof are not intended to limit the present invention in any way.

以下示例通过本发明的用于智能操作系统的多区域图形绘制方法及装置在屏幕中的两个区域分别绘制两张图形,左上图为p1,右下图为p2。在该示例中,智能操作系统环境为Android,支持Open GL 2.0。The following example draws two graphics in two areas of the screen through the multi-region graphics drawing method and device for an intelligent operating system of the present invention, the upper left picture is p1, and the lower right picture is p2. In this example, the smart operating system environment is Android, which supports Open GL 2.0.

具体步骤如下:Specific steps are as follows:

1)在Java端创建第一渲染线程和第二渲染进程。1) Create a first rendering thread and a second rendering process on the Java side.

具体地,在Java端创建第一渲染线程和第二渲染进程,分别为Native端提供渲染线程环境,并生成两个Open GL上下文环境。Specifically, a first rendering thread and a second rendering process are created on the Java side, respectively provide rendering thread environments for the Native side, and generate two Open GL context environments.

2)在Native端,分别在两个渲染线程提供的渲染环境中创建第一渲染引擎实例和第二渲染引擎实例。2) On the Native side, create a first rendering engine instance and a second rendering engine instance in the rendering environments provided by the two rendering threads.

3)将第一渲染引擎实例和第二渲染引擎实例分别置入第一渲染线程和第二渲染线程的TSD中,以将第一渲染引擎实例与第一渲染线程进行绑定,并且将第二渲染实例与第二渲染线程进行绑定。3) Put the first rendering engine instance and the second rendering engine instance into the TSDs of the first rendering thread and the second rendering thread respectively, so as to bind the first rendering engine instance to the first rendering thread, and bind the second rendering engine instance The rendering instance is bound to the second rendering thread.

4)基于第一渲染线程向与它绑定的Native端的第一渲染引擎提交p1的渲染任务,该任务指向p1的路径;基于第二渲染线程向与它绑定的Native端的第二渲染引擎提交p2的渲染任务,该任务指向p2的路径。4) Based on the first rendering thread, submit the rendering task of p1 to the first rendering engine on the native side bound to it, and the task points to the path of p1; based on the second rendering thread, submit it to the second rendering engine on the native side bound to it The rendering task of p2, which points to the path of p2.

5)第一渲染引擎和第二渲染引擎分别得到渲染任务,需要渲染的类型皆为图片,随之第一渲染引擎和第二渲染引擎调用Open GL接口将p1和p2作为纹理加载到内存,并通过Open GL接口将该内存缓存交换到显示缓冲区,完成在第一渲染引擎和第二渲染引擎各自对应的屏幕区域的显示。5) The first rendering engine and the second rendering engine get rendering tasks respectively, and the types to be rendered are all images, and then the first rendering engine and the second rendering engine call the Open GL interface to load p1 and p2 as textures into the memory, and The memory buffer is exchanged to the display buffer through the Open GL interface, and the display in the corresponding screen areas of the first rendering engine and the second rendering engine is completed.

由于通过多线程实现,因此p1和p2的显示是同时的。Due to the implementation of multi-threading, the display of p1 and p2 is simultaneous.

本领域技术人员应理解,上面对本发明的实施例的描述的目的仅为了示例性地说明本发明的实施例的有益效果,并不意在将本发明的实施例限制于所给出的任何示例。Those skilled in the art should understand that the purpose of the above description of the embodiments of the present invention is only to illustrate the beneficial effects of the embodiments of the present invention, and is not intended to limit the embodiments of the present invention to any given examples.

本发明可以是装置、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本发明的各个方面的计算机可读程序指令。The invention may be an apparatus, method and/or computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present invention.

计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.

这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .

用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect). In some embodiments, an electronic circuit, such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA), can be customized by utilizing state information of computer-readable program instructions, which can Various aspects of the invention are implemented by executing computer readable program instructions.

这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.

这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.

也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.

附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.

以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present invention, the foregoing description is illustrative, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.

Claims (10)

1.一种用于智能操作系统的多区域图形绘制方法,其特征在于,包括以下步骤:1. A method for drawing multi-region graphics for an intelligent operating system, comprising the following steps: 将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定;Bind multiple rendering threads created on the Java side with multiple rendering engine instances created on the Native side; 将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端;Submitting one or more graphics rendering tasks received by the Java end to different rendering threads, and submitting the one or more graphics rendering tasks to the Native end based on the corresponding rendering threads; 在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染;以及Obtain a rendering engine instance bound to the rendering thread corresponding to the one or more graphics rendering tasks on the Native side to perform graphics rendering; and 将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中。The rendering results of the one or more graphics rendering tasks are respectively displayed in the screen areas corresponding to the rendering engine instances performing rendering. 2.根据权利要求1所述的用于智能操作系统的多区域图形绘制方法,其中,通过将所述多个渲染引擎实例置入线程私有数据来进行与所述多个渲染线程的绑定。2. The multi-region graphics drawing method for an intelligent operating system according to claim 1, wherein the binding to the multiple rendering threads is performed by putting the multiple rendering engine instances into thread private data. 3.根据权利要求2所述的用于智能操作系统的多区域图形绘制方法,其中,Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例。3. The multi-region graphics drawing method for an intelligent operating system according to claim 2, wherein, the Natvie side acquires respectively the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task. 4.根据权利要求1所述的用于智能操作系统的多区域图形绘制方法,其中,所述渲染引擎通过Open GL命令进行图形渲染。4. The multi-region graphics drawing method for an intelligent operating system according to claim 1, wherein the rendering engine performs graphics rendering through Open GL commands. 5.根据权利要求1所述的用于智能操作系统的多区域图形绘制方法,其中,所述方法进一步包括:5. The multi-region graphics drawing method for an intelligent operating system according to claim 1, wherein said method further comprises: 在图形渲染任务完成之后,Native端将渲染状态回调至Java端。After the graphics rendering task is completed, the Native side will call back the rendering status to the Java side. 6.一种用于智能操作系统的多区域图形绘制装置,其特征在于,所述装置包括:6. A multi-region graphics drawing device for an intelligent operating system, characterized in that the device comprises: 用于将Java端创建的多个渲染线程与Native端创建的多个渲染引擎实例进行绑定的单元;A unit for binding multiple rendering threads created on the Java side with multiple rendering engine instances created on the Native side; 用于将Java端接收到的一个或多个图形渲染任务分别提交到不同的渲染线程中,并且将所述一个或多个图形渲染任务基于所对应的渲染线程提交到Native端的单元;A unit for submitting one or more graphics rendering tasks received by the Java side to different rendering threads, and submitting the one or more graphics rendering tasks to the Native side based on the corresponding rendering threads; 用于在Native端获取与所述一个或多个图形渲染任务所对应的渲染线程绑定的渲染引擎实例以进行图形渲染的单元;以及A unit for obtaining a rendering engine instance bound to a rendering thread corresponding to the one or more graphics rendering tasks on the Native side for graphics rendering; and 用于将所述一个或多个图形渲染任务的渲染结果分别显示在与进行渲染的渲染引擎实例所对应的屏幕区域中的单元。A unit for displaying the rendering results of the one or more graphics rendering tasks in the screen areas corresponding to the rendering engine instances performing rendering. 7.根据权利要求6所述的用于智能操作系统的多区域图形绘制装置,其中,通过将所述多个渲染引擎实例置入线程私有数据来进行与所述多个渲染线程的绑定。7. The multi-region graphics rendering device for an intelligent operating system according to claim 6, wherein the binding to the plurality of rendering threads is performed by putting the plurality of rendering engine instances into thread private data. 8.根据权利要求7所述的用于智能操作系统的多区域图形绘制装置,其中,Natvie端基于所述图形渲染任务对应的线程私有数据分别获取与所述渲染线程绑定的渲染引擎实例。8 . The multi-region graphics drawing device for an intelligent operating system according to claim 7 , wherein the Natvie side obtains the rendering engine instances bound to the rendering threads based on the thread private data corresponding to the graphics rendering task. 9.根据权利要求6所述的用于智能操作系统的多区域图形绘制装置,其中,所述渲染引擎通过Open GL命令进行图形渲染。9. The multi-region graphics drawing device for an intelligent operating system according to claim 6, wherein the rendering engine performs graphics rendering through Open GL commands. 10.根据权利要求6所述的用于智能操作系统的多区域图形绘制装置,其中,所述装置进一步包括:10. The multi-region graphics drawing device for an intelligent operating system according to claim 6, wherein said device further comprises: 用于在图形渲染任务完成之后,使Native端将渲染状态回调至Java端的单元。It is used to make the Native side call back the rendering state to the Java side unit after the graphics rendering task is completed.
CN201610902201.XA 2016-10-17 2016-10-17 Multi-region graphics rendering method and device for intelligent operating system Expired - Fee Related CN106502662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610902201.XA CN106502662B (en) 2016-10-17 2016-10-17 Multi-region graphics rendering method and device for intelligent operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610902201.XA CN106502662B (en) 2016-10-17 2016-10-17 Multi-region graphics rendering method and device for intelligent operating system

Publications (2)

Publication Number Publication Date
CN106502662A true CN106502662A (en) 2017-03-15
CN106502662B CN106502662B (en) 2019-06-14

Family

ID=58295058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610902201.XA Expired - Fee Related CN106502662B (en) 2016-10-17 2016-10-17 Multi-region graphics rendering method and device for intelligent operating system

Country Status (1)

Country Link
CN (1) CN106502662B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3425511A1 (en) * 2017-07-07 2019-01-09 Beijing Xiaomi Mobile Software Co., Ltd. Method and apparatus for monitoring virtual document object model
CN109544653A (en) * 2018-10-26 2019-03-29 深圳点猫科技有限公司 A kind of WebGL independent process rendering method and electronic equipment based on education operating system
CN109697101A (en) * 2019-01-16 2019-04-30 广州虎牙信息科技有限公司 Image display method, device, computer equipment and storage medium
CN110209447A (en) * 2019-04-28 2019-09-06 五八有限公司 A kind of list page data display method and list page data presentation device
CN110209451A (en) * 2019-05-28 2019-09-06 南京南方电讯有限公司 A kind of horse race lamp display system and method based on the superposition of different display engines
CN111210381A (en) * 2019-12-31 2020-05-29 广州市百果园信息技术有限公司 Data processing method and device, terminal equipment and computer readable medium
CN112765128A (en) * 2020-12-31 2021-05-07 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment
CN113837918A (en) * 2020-06-23 2021-12-24 北京字节跳动网络技术有限公司 Method and device for realizing rendering isolation by multiple processes
CN113970334A (en) * 2020-07-23 2022-01-25 阿里巴巴集团控股有限公司 Map rendering method, architecture, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030172127A1 (en) * 2002-02-06 2003-09-11 Northrup Charles J. Execution of process by references to directory service
CN102469064A (en) * 2010-11-03 2012-05-23 中兴通讯股份有限公司 Communication implementation method and communication equipment
CN102915375A (en) * 2012-11-08 2013-02-06 山东大学 Webpage loading method based on layout zoning
CN103617027A (en) * 2013-10-29 2014-03-05 合一网络技术(北京)有限公司 Android-based method and system for constructing image rendering engine
CN103761317A (en) * 2014-01-27 2014-04-30 北京京东尚科信息技术有限公司 Multithreading asynchronous rendering system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030172127A1 (en) * 2002-02-06 2003-09-11 Northrup Charles J. Execution of process by references to directory service
CN102469064A (en) * 2010-11-03 2012-05-23 中兴通讯股份有限公司 Communication implementation method and communication equipment
CN102915375A (en) * 2012-11-08 2013-02-06 山东大学 Webpage loading method based on layout zoning
CN103617027A (en) * 2013-10-29 2014-03-05 合一网络技术(北京)有限公司 Android-based method and system for constructing image rendering engine
CN103761317A (en) * 2014-01-27 2014-04-30 北京京东尚科信息技术有限公司 Multithreading asynchronous rendering system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆兴华 等: "基于Android系统的自适应跟踪场景渲染技术", 《计算机网络》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3425511A1 (en) * 2017-07-07 2019-01-09 Beijing Xiaomi Mobile Software Co., Ltd. Method and apparatus for monitoring virtual document object model
US10572308B2 (en) 2017-07-07 2020-02-25 Beijing Xiaomi Mobile Software Co., Ltd. Method and apparatus for monitoring virtual document object model
CN109544653A (en) * 2018-10-26 2019-03-29 深圳点猫科技有限公司 A kind of WebGL independent process rendering method and electronic equipment based on education operating system
CN109697101A (en) * 2019-01-16 2019-04-30 广州虎牙信息科技有限公司 Image display method, device, computer equipment and storage medium
CN110209447A (en) * 2019-04-28 2019-09-06 五八有限公司 A kind of list page data display method and list page data presentation device
CN110209451A (en) * 2019-05-28 2019-09-06 南京南方电讯有限公司 A kind of horse race lamp display system and method based on the superposition of different display engines
CN111210381A (en) * 2019-12-31 2020-05-29 广州市百果园信息技术有限公司 Data processing method and device, terminal equipment and computer readable medium
CN113837918A (en) * 2020-06-23 2021-12-24 北京字节跳动网络技术有限公司 Method and device for realizing rendering isolation by multiple processes
CN113970334A (en) * 2020-07-23 2022-01-25 阿里巴巴集团控股有限公司 Map rendering method, architecture, equipment and storage medium
CN112765128A (en) * 2020-12-31 2021-05-07 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment
CN112765128B (en) * 2020-12-31 2023-10-03 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment

Also Published As

Publication number Publication date
CN106502662B (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN106502662A (en) Multizone pattern drawing method and device for intelligent operating system
CN105518742B (en) Fault-tolerant preemption mechanism at arbitrary control points for graphics processing
TWI603286B (en) Method for displaying a 3d scene graph on a sreen
US9342322B2 (en) System and method for layering using tile-based renderers
EP3111318B1 (en) Cross-platform rendering engine
KR102122454B1 (en) Apparatus and Method for rendering a current frame using an image of previous tile
CN107209923B (en) Hybrid Rendering in Graphics Processing
EP1462936A2 (en) Visual and scene graph interfaces
JP5960368B2 (en) Rendering of graphics data using visibility information
KR102651126B1 (en) Graphic processing apparatus and method for processing texture in graphics pipeline
US20130127858A1 (en) Interception of Graphics API Calls for Optimization of Rendering
CN106575228A (en) Render target command reordering in graphics processing
KR102381945B1 (en) Graphic processing apparatus and method for performing graphics pipeline thereof
JP2011510407A (en) Multi-buffer support for off-screen surfaces in graphics processing systems
US8810587B2 (en) Conversion of contiguous interleaved image data for CPU readback
CN115705668A (en) View drawing method and device and storage medium
US8823715B2 (en) Efficient writing of pixels to tiled planar pixel arrays
KR102085701B1 (en) Method for rendering image
US20240242403A1 (en) System and Method for Creating a Design Tool Using a Clockwise Fill Rule
US20250104324A1 (en) Software graphics rendering
WO2022135050A1 (en) Rendering method, device, and system
CN117611723A (en) Display information processing method and device
CN119625151A (en) A method and system for implementing 3D model rendering on application software
HK1067208A (en) Visual and scene graph interfaces

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun District Economic Development Zone, Beijing 101500

Applicant after: BEIJING ROOBO TECHNOLOGY Co.,Ltd.

Address before: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun County Economic Development Zone, Beijing 101500

Applicant before: BEIJING INTELLIGENT STEWARD Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210908

Address after: 301-112, floor 3, building 2, No. 18, YANGFANGDIAN Road, Haidian District, Beijing 100038

Patentee after: Beijing Rubu Technology Co.,Ltd.

Address before: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun District Economic Development Zone, Beijing 101500

Patentee before: BEIJING ROOBO TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190614

CF01 Termination of patent right due to non-payment of annual fee