Skip to content

Conversation

@bulloo
Copy link
Collaborator

@bulloo bulloo commented Oct 18, 2025

Proposed Changes

Testing

Test: Describe how you tested your changes. Note that this line (with Test:) is required, your PR will not build without it!

Issues Fixed

Fixes: [Optional] The bug on https://issuetracker.google.com being fixed

Google CLA

You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.

@sebuntin
Copy link
Owner

LGTM

@sebuntin sebuntin self-assigned this Oct 23, 2025
@sebuntin sebuntin requested a review from Copilot October 23, 2025 12:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a wrapper for OH_HiTrace tracing functionality by adding a new SystraceSection RAII helper class and integrating it into the canvas drawing code for performance profiling.

Key changes:

  • Created oh_systrace_section.h with a SystraceSection RAII wrapper for automatic trace start/finish
  • Integrated the new tracing utility into drawRect method for performance monitoring

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
oh_systrace_section.h Defines new SystraceSection RAII class for scoped OH_HiTrace tracing
oh_native_canvas_proxy.cpp Adds trace instrumentation to the drawRect method using the new wrapper

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


namespace OH {
struct SystraceSection {
public:
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant public: access specifier. Members of a struct are public by default in C++.

Suggested change
public:

Copilot uses AI. Check for mistakes.
#include <sstream>

namespace OH {
struct SystraceSection {
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SystraceSection class is not copyable or movable, which could lead to issues if accidentally copied. Add SystraceSection(const SystraceSection&) = delete; and SystraceSection& operator=(const SystraceSection&) = delete; to prevent copying.

Copilot uses AI. Check for mistakes.
OH_HiTrace_FinishTrace();
}
};
}//namespace OH
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Add a space before the comment: } // namespace OH to follow standard C++ formatting conventions.

Suggested change
}//namespace OH
} // namespace OH

Copilot uses AI. Check for mistakes.
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch 3 times, most recently from 1d59d24 to 3a977da Compare October 24, 2025 06:17
@bulloo bulloo merged commit 90b3e66 into sebuntin:ohos-compose-1.6.1-20250919 Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants