forked from apache/incubator-weex
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEEX-648][Android]native batch for dom operations generating from Ja…
…vaScript introduce a native batch for dom operations generating from JavaScript wrap a series of dom operations with beginBatch and endBatch directives, when every V-sync signal comes, we try to ensure that the operations between beginBatch and endBatch can be performed in current V-sync, this policy can drop frames maybe, for our policy dropping frames, we only allow 20 frames at most. see iOS pull request apache#1644 feature:648
- Loading branch information
Showing
6 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionBatchAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.taobao.weex.ui.action; | ||
|
||
import com.taobao.weex.WXSDKInstance; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class GraphicActionBatchAction extends BasicGraphicAction { | ||
private List<BasicGraphicAction> mActions; | ||
|
||
public GraphicActionBatchAction(WXSDKInstance instance, String ref, List<BasicGraphicAction> mActions) { | ||
super(instance, ref); | ||
this.mActions = new ArrayList<>(mActions); | ||
} | ||
|
||
@Override | ||
public void executeAction() { | ||
for (int i = 0;i < mActions.size();i ++) { | ||
mActions.get(i).executeAction(); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionBatchBegin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.taobao.weex.ui.action; | ||
|
||
import com.taobao.weex.WXSDKInstance; | ||
|
||
public class GraphicActionBatchBegin extends BasicGraphicAction { | ||
public GraphicActionBatchBegin(WXSDKInstance instance, String ref) { | ||
super(instance, ref); | ||
this.mActionType = ActionTypeBatchBegin; | ||
} | ||
|
||
@Override | ||
public void executeAction() { | ||
|
||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
android/sdk/src/main/java/com/taobao/weex/ui/action/GraphicActionBatchEnd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.taobao.weex.ui.action; | ||
|
||
import com.taobao.weex.WXSDKInstance; | ||
|
||
public class GraphicActionBatchEnd extends BasicGraphicAction { | ||
public GraphicActionBatchEnd(WXSDKInstance instance, String ref) { | ||
super(instance, ref); | ||
this.mActionType = ActionTypeBatchEnd; | ||
} | ||
|
||
@Override | ||
public void executeAction() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters