From c3d8758ea23d9cf741d906875b2f8f8be7fc7b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=8B=E8=83=BD=5F=E5=BC=A0=E5=BE=B7=E7=9B=9B?= Date: Sat, 11 Oct 2025 11:05:29 +0800 Subject: [PATCH] =?UTF-8?q?MaliangGPU=E5=B7=A5=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MaliangGPU/README.md | 43 +++++++++++++++++++ .../main/ets/entryability/EntryAbility.ets | 15 +++++++ .../entrybackupability/EntryBackupAbility.ets | 15 +++++++ MaliangGPU/entry/src/main/ets/pages/Index.ets | 15 +++++++ .../entry/src/main/ets/pages/field.glsl | 15 +++++++ .../entry/src/main/ets/pages/shader.frag | 15 +++++++ .../main/resources/base/element/string.json | 2 +- 7 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 MaliangGPU/README.md diff --git a/MaliangGPU/README.md b/MaliangGPU/README.md new file mode 100644 index 00000000..e7c3509c --- /dev/null +++ b/MaliangGPU/README.md @@ -0,0 +1,43 @@ +# 马良GPU渲染优化样例代码工程 + +## 介绍 + +本示例为马良GPU渲染优化样例代码工程,包含最佳实践文档中涉及的分析方法、优化建议、问题案例等内容的局部样例代码。工程本身不具备实际功能,开发者请直接阅读具体源码结合文档来理解马良GPU渲染优化。 + +## 效果预览 + +不涉及 + +## 工程目录 + +``` +├──entry/src/main +│ └──ets +│ └──pages +│ ├──field.glsl // GLSL样例代码 +│ ├──Index.ets // 首页 +│ └──shader.frag // GLSL样例代码 +└──entry/src/main/resources // 资源文件目录 +``` + +## 具体实现 + +不涉及。 + +## 相关权限 + +不涉及。 + +## 依赖 + +不涉及。 + +## 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:华为手机、华为PC/2in1设备、华为平板。 + +2. HarmonyOS系统:HarmonyOS NEXT 5.0.5 Release及以上。 + +3. DevEco Studio版本:DevEco Studio NEXT 5.0.5 Release及以上。 + +4. HarmonyOS SDK版本:HarmonyOS NEXT 5.0.5 Release SDK及以上。 \ No newline at end of file diff --git a/MaliangGPU/entry/src/main/ets/entryability/EntryAbility.ets b/MaliangGPU/entry/src/main/ets/entryability/EntryAbility.ets index 2880ca09..6e8ddad7 100644 --- a/MaliangGPU/entry/src/main/ets/entryability/EntryAbility.ets +++ b/MaliangGPU/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed 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. + */ + import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; diff --git a/MaliangGPU/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/MaliangGPU/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets index 8e4de992..0a97e21b 100644 --- a/MaliangGPU/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +++ b/MaliangGPU/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed 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. + */ + import { hilog } from '@kit.PerformanceAnalysisKit'; import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; diff --git a/MaliangGPU/entry/src/main/ets/pages/Index.ets b/MaliangGPU/entry/src/main/ets/pages/Index.ets index e29b6f9b..84237249 100644 --- a/MaliangGPU/entry/src/main/ets/pages/Index.ets +++ b/MaliangGPU/entry/src/main/ets/pages/Index.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed 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. + */ + @Entry @Component struct Index { diff --git a/MaliangGPU/entry/src/main/ets/pages/field.glsl b/MaliangGPU/entry/src/main/ets/pages/field.glsl index 3e3c74f3..7e662fb0 100644 --- a/MaliangGPU/entry/src/main/ets/pages/field.glsl +++ b/MaliangGPU/entry/src/main/ets/pages/field.glsl @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed 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. + */ + /** * 最佳实践:马良GPU最佳实践 */ diff --git a/MaliangGPU/entry/src/main/ets/pages/shader.frag b/MaliangGPU/entry/src/main/ets/pages/shader.frag index 468124e1..8f3572d3 100644 --- a/MaliangGPU/entry/src/main/ets/pages/shader.frag +++ b/MaliangGPU/entry/src/main/ets/pages/shader.frag @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed 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. + */ + /** * 最佳实践:马良GPU最佳实践 */ diff --git a/MaliangGPU/entry/src/main/resources/base/element/string.json b/MaliangGPU/entry/src/main/resources/base/element/string.json index f9459551..b51d9a71 100644 --- a/MaliangGPU/entry/src/main/resources/base/element/string.json +++ b/MaliangGPU/entry/src/main/resources/base/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "MaliangGPU" } ] } \ No newline at end of file -- Gitee