Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize accounting for render op depths #54794

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions display_list/dl_op_records.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ struct DrawImageRectOp final : DrawOpBase {
#define DEFINE_DRAW_IMAGE_NINE_OP(name, render_with_attributes) \
struct name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::k##name; \
static constexpr uint32_t kDepthInc = 9; \
Copy link
Member

Choose a reason for hiding this comment

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

Does this get used somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In DisplayListBuilder::Push

\
name##Op(const sk_sp<DlImage>& image, \
const SkIRect& center, \
Expand Down
14 changes: 7 additions & 7 deletions display_list/testing/dl_test_snippets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -835,37 +835,37 @@ std::vector<DisplayListInvocationGroup> CreateAllRenderingOps() {
}},
{"DrawImageNine",
{
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage1, {10, 10, 20, 20}, {10, 10, 80, 80},
DlFilterMode::kNearest, false);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage1, {10, 10, 20, 20}, {10, 10, 80, 80},
DlFilterMode::kNearest, true);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage1, {10, 10, 25, 20}, {10, 10, 80, 80},
DlFilterMode::kNearest, false);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage1, {10, 10, 20, 20}, {10, 10, 85, 80},
DlFilterMode::kNearest, false);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage1, {10, 10, 20, 20}, {10, 10, 80, 80},
DlFilterMode::kLinear, false);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
r.drawImageNine(TestImage2, {10, 10, 15, 15}, {10, 10, 80, 80},
DlFilterMode::kNearest, false);
}},
{1, 48, 1,
{1, 48, 9,
[](DlOpReceiver& r) {
auto dl_image = DlImage::Make(TestSkImage);
r.drawImageNine(dl_image, {10, 10, 15, 15}, {10, 10, 80, 80},
Expand Down
3 changes: 3 additions & 0 deletions impeller/aiks/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ class Canvas {

Picture EndRecordingAsPicture();

uint64_t GetOpDepth() const { return current_depth_; }
uint64_t GetMaxOpDepth() const { return transform_stack_.back().clip_depth; }

protected:
std::deque<CanvasStackEntry> transform_stack_;
std::optional<Rect> initial_cull_rect_;
Expand Down
Loading