1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,16 @@ public boolean scheduleRenderTask(RenderTask task) {
150
150
}
151
151
}
152
152
153
+ public int scheduleRenderTasks (RenderTask ... tasks ) {
154
+ synchronized (this .renderTasks ) {
155
+ int count = 0 ;
156
+ for (RenderTask task : tasks ) {
157
+ if (scheduleRenderTask (task )) count ++;
158
+ }
159
+ return count ;
160
+ }
161
+ }
162
+
153
163
public boolean scheduleRenderTaskNext (RenderTask task ) {
154
164
synchronized (this .renderTasks ) {
155
165
if (renderTasks .size () <= 1 ) return scheduleRenderTask (task );
@@ -164,6 +174,9 @@ public boolean scheduleRenderTaskNext(RenderTask task) {
164
174
165
175
public int scheduleRenderTasksNext (RenderTask ... tasks ) {
166
176
synchronized (this .renderTasks ) {
177
+ if (renderTasks .size () <= 1 )
178
+ return scheduleRenderTasks (tasks );
179
+
167
180
int count = 0 ;
168
181
for (int i = tasks .length - 1 ; i >= 0 ; i --) {
169
182
if (scheduleRenderTaskNext (tasks [i ])) count ++;
0 commit comments