Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0c3eda0

Browse files
committed
split DisplayListBuilder into DlCanvas optimizer and Op recorder classes
1 parent 7ba90e6 commit 0c3eda0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3726
-3556
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,20 +715,24 @@ ORIGIN: ../../../flutter/display_list/benchmarking/dl_complexity_helper.h + ../.
715715
ORIGIN: ../../../flutter/display_list/benchmarking/dl_complexity_metal.cc + ../../../flutter/LICENSE
716716
ORIGIN: ../../../flutter/display_list/benchmarking/dl_complexity_metal.h + ../../../flutter/LICENSE
717717
ORIGIN: ../../../flutter/display_list/benchmarking/dl_region_benchmarks.cc + ../../../flutter/LICENSE
718+
ORIGIN: ../../../flutter/display_list/display_list_builder.cc + ../../../flutter/LICENSE
719+
ORIGIN: ../../../flutter/display_list/display_list_builder.h + ../../../flutter/LICENSE
718720
ORIGIN: ../../../flutter/display_list/display_list.cc + ../../../flutter/LICENSE
719721
ORIGIN: ../../../flutter/display_list/display_list.h + ../../../flutter/LICENSE
720722
ORIGIN: ../../../flutter/display_list/dl_attributes.h + ../../../flutter/LICENSE
721723
ORIGIN: ../../../flutter/display_list/dl_blend_mode.cc + ../../../flutter/LICENSE
722724
ORIGIN: ../../../flutter/display_list/dl_blend_mode.h + ../../../flutter/LICENSE
723-
ORIGIN: ../../../flutter/display_list/dl_builder.cc + ../../../flutter/LICENSE
724-
ORIGIN: ../../../flutter/display_list/dl_builder.h + ../../../flutter/LICENSE
725+
ORIGIN: ../../../flutter/display_list/dl_canvas_to_receiver.cc + ../../../flutter/LICENSE
726+
ORIGIN: ../../../flutter/display_list/dl_canvas_to_receiver.h + ../../../flutter/LICENSE
725727
ORIGIN: ../../../flutter/display_list/dl_canvas.cc + ../../../flutter/LICENSE
726728
ORIGIN: ../../../flutter/display_list/dl_canvas.h + ../../../flutter/LICENSE
727729
ORIGIN: ../../../flutter/display_list/dl_color.h + ../../../flutter/LICENSE
728730
ORIGIN: ../../../flutter/display_list/dl_op_flags.cc + ../../../flutter/LICENSE
729731
ORIGIN: ../../../flutter/display_list/dl_op_flags.h + ../../../flutter/LICENSE
730732
ORIGIN: ../../../flutter/display_list/dl_op_receiver.cc + ../../../flutter/LICENSE
731733
ORIGIN: ../../../flutter/display_list/dl_op_receiver.h + ../../../flutter/LICENSE
734+
ORIGIN: ../../../flutter/display_list/dl_op_recorder.cc + ../../../flutter/LICENSE
735+
ORIGIN: ../../../flutter/display_list/dl_op_recorder.h + ../../../flutter/LICENSE
732736
ORIGIN: ../../../flutter/display_list/dl_op_records.cc + ../../../flutter/LICENSE
733737
ORIGIN: ../../../flutter/display_list/dl_op_records.h + ../../../flutter/LICENSE
734738
ORIGIN: ../../../flutter/display_list/dl_paint.cc + ../../../flutter/LICENSE
@@ -3438,20 +3442,24 @@ FILE: ../../../flutter/display_list/benchmarking/dl_complexity_helper.h
34383442
FILE: ../../../flutter/display_list/benchmarking/dl_complexity_metal.cc
34393443
FILE: ../../../flutter/display_list/benchmarking/dl_complexity_metal.h
34403444
FILE: ../../../flutter/display_list/benchmarking/dl_region_benchmarks.cc
3445+
FILE: ../../../flutter/display_list/display_list_builder.cc
3446+
FILE: ../../../flutter/display_list/display_list_builder.h
34413447
FILE: ../../../flutter/display_list/display_list.cc
34423448
FILE: ../../../flutter/display_list/display_list.h
34433449
FILE: ../../../flutter/display_list/dl_attributes.h
34443450
FILE: ../../../flutter/display_list/dl_blend_mode.cc
34453451
FILE: ../../../flutter/display_list/dl_blend_mode.h
3446-
FILE: ../../../flutter/display_list/dl_builder.cc
3447-
FILE: ../../../flutter/display_list/dl_builder.h
3452+
FILE: ../../../flutter/display_list/dl_canvas_to_receiver.cc
3453+
FILE: ../../../flutter/display_list/dl_canvas_to_receiver.h
34483454
FILE: ../../../flutter/display_list/dl_canvas.cc
34493455
FILE: ../../../flutter/display_list/dl_canvas.h
34503456
FILE: ../../../flutter/display_list/dl_color.h
34513457
FILE: ../../../flutter/display_list/dl_op_flags.cc
34523458
FILE: ../../../flutter/display_list/dl_op_flags.h
34533459
FILE: ../../../flutter/display_list/dl_op_receiver.cc
34543460
FILE: ../../../flutter/display_list/dl_op_receiver.h
3461+
FILE: ../../../flutter/display_list/dl_op_recorder.cc
3462+
FILE: ../../../flutter/display_list/dl_op_recorder.h
34553463
FILE: ../../../flutter/display_list/dl_op_records.cc
34563464
FILE: ../../../flutter/display_list/dl_op_records.h
34573465
FILE: ../../../flutter/display_list/dl_paint.cc

display_list/BUILD.gn

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,22 @@ source_set("display_list") {
2525
"benchmarking/dl_complexity_metal.h",
2626
"display_list.cc",
2727
"display_list.h",
28+
"display_list_builder.cc",
29+
"display_list_builder.h",
2830
"dl_attributes.h",
2931
"dl_blend_mode.cc",
3032
"dl_blend_mode.h",
31-
"dl_builder.cc",
32-
"dl_builder.h",
3333
"dl_canvas.cc",
3434
"dl_canvas.h",
35+
"dl_canvas_to_receiver.cc",
36+
"dl_canvas_to_receiver.h",
3537
"dl_color.h",
3638
"dl_op_flags.cc",
3739
"dl_op_flags.h",
3840
"dl_op_receiver.cc",
3941
"dl_op_receiver.h",
42+
"dl_op_recorder.cc",
43+
"dl_op_recorder.h",
4044
"dl_op_records.cc",
4145
"dl_op_records.h",
4246
"dl_paint.cc",

display_list/benchmarking/dl_benchmarks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "flutter/display_list/benchmarking/dl_benchmarks.h"
6-
#include "flutter/display_list/dl_builder.h"
6+
#include "flutter/display_list/display_list_builder.h"
77
#include "flutter/display_list/dl_op_flags.h"
88
#include "flutter/display_list/skia/dl_sk_canvas.h"
99

display_list/benchmarking/dl_complexity_gl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawVertices(
503503
}
504504

505505
void DisplayListGLComplexityCalculator::GLHelper::drawImage(
506-
const sk_sp<DlImage> image,
506+
const sk_sp<DlImage>& image,
507507
const SkPoint point,
508508
DlImageSampling sampling,
509509
bool render_with_attributes) {
@@ -583,7 +583,7 @@ void DisplayListGLComplexityCalculator::GLHelper::ImageRect(
583583
}
584584

585585
void DisplayListGLComplexityCalculator::GLHelper::drawImageNine(
586-
const sk_sp<DlImage> image,
586+
const sk_sp<DlImage>& image,
587587
const SkIRect& center,
588588
const SkRect& dst,
589589
DlFilterMode filter,
@@ -608,7 +608,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawImageNine(
608608
}
609609

610610
void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList(
611-
const sk_sp<DisplayList> display_list,
611+
const sk_sp<DisplayList>& display_list,
612612
SkScalar opacity) {
613613
if (IsComplex()) {
614614
return;
@@ -622,7 +622,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList(
622622
}
623623

624624
void DisplayListGLComplexityCalculator::GLHelper::drawTextBlob(
625-
const sk_sp<SkTextBlob> blob,
625+
const sk_sp<SkTextBlob>& blob,
626626
SkScalar x,
627627
SkScalar y) {
628628
if (IsComplex()) {

display_list/benchmarking/dl_complexity_gl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ class DisplayListGLComplexityCalculator
5656
uint32_t count,
5757
const SkPoint points[]) override;
5858
void drawVertices(const DlVertices* vertices, DlBlendMode mode) override;
59-
void drawImage(const sk_sp<DlImage> image,
59+
void drawImage(const sk_sp<DlImage>& image,
6060
const SkPoint point,
6161
DlImageSampling sampling,
6262
bool render_with_attributes) override;
63-
void drawImageNine(const sk_sp<DlImage> image,
63+
void drawImageNine(const sk_sp<DlImage>& image,
6464
const SkIRect& center,
6565
const SkRect& dst,
6666
DlFilterMode filter,
6767
bool render_with_attributes) override;
68-
void drawDisplayList(const sk_sp<DisplayList> display_list,
68+
void drawDisplayList(const sk_sp<DisplayList>& display_list,
6969
SkScalar opacity) override;
70-
void drawTextBlob(const sk_sp<SkTextBlob> blob,
70+
void drawTextBlob(const sk_sp<SkTextBlob>& blob,
7171
SkScalar x,
7272
SkScalar y) override;
7373
void drawShadow(const SkPath& path,

display_list/benchmarking/dl_complexity_helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class ComplexityCalculatorHelper
146146
}
147147

148148
void drawImageRect(
149-
const sk_sp<DlImage> image,
149+
const sk_sp<DlImage>& image,
150150
const SkRect& src,
151151
const SkRect& dst,
152152
DlImageSampling sampling,
@@ -159,7 +159,7 @@ class ComplexityCalculatorHelper
159159
render_with_attributes, constraint == SrcRectConstraint::kStrict);
160160
}
161161

162-
void drawAtlas(const sk_sp<DlImage> atlas,
162+
void drawAtlas(const sk_sp<DlImage>& atlas,
163163
const SkRSXform xform[],
164164
const SkRect tex[],
165165
const DlColor colors[],

display_list/benchmarking/dl_complexity_metal.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ void DisplayListMetalComplexityCalculator::MetalHelper::drawVertices(
455455
}
456456

457457
void DisplayListMetalComplexityCalculator::MetalHelper::drawImage(
458-
const sk_sp<DlImage> image,
458+
const sk_sp<DlImage>& image,
459459
const SkPoint point,
460460
DlImageSampling sampling,
461461
bool render_with_attributes) {
@@ -532,7 +532,7 @@ void DisplayListMetalComplexityCalculator::MetalHelper::ImageRect(
532532
}
533533

534534
void DisplayListMetalComplexityCalculator::MetalHelper::drawImageNine(
535-
const sk_sp<DlImage> image,
535+
const sk_sp<DlImage>& image,
536536
const SkIRect& center,
537537
const SkRect& dst,
538538
DlFilterMode filter,
@@ -552,7 +552,7 @@ void DisplayListMetalComplexityCalculator::MetalHelper::drawImageNine(
552552
}
553553

554554
void DisplayListMetalComplexityCalculator::MetalHelper::drawDisplayList(
555-
const sk_sp<DisplayList> display_list,
555+
const sk_sp<DisplayList>& display_list,
556556
SkScalar opacity) {
557557
if (IsComplex()) {
558558
return;
@@ -566,7 +566,7 @@ void DisplayListMetalComplexityCalculator::MetalHelper::drawDisplayList(
566566
}
567567

568568
void DisplayListMetalComplexityCalculator::MetalHelper::drawTextBlob(
569-
const sk_sp<SkTextBlob> blob,
569+
const sk_sp<SkTextBlob>& blob,
570570
SkScalar x,
571571
SkScalar y) {
572572
if (IsComplex()) {

display_list/benchmarking/dl_complexity_metal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ class DisplayListMetalComplexityCalculator
5656
uint32_t count,
5757
const SkPoint points[]) override;
5858
void drawVertices(const DlVertices* vertices, DlBlendMode mode) override;
59-
void drawImage(const sk_sp<DlImage> image,
59+
void drawImage(const sk_sp<DlImage>& image,
6060
const SkPoint point,
6161
DlImageSampling sampling,
6262
bool render_with_attributes) override;
63-
void drawImageNine(const sk_sp<DlImage> image,
63+
void drawImageNine(const sk_sp<DlImage>& image,
6464
const SkIRect& center,
6565
const SkRect& dst,
6666
DlFilterMode filter,
6767
bool render_with_attributes) override;
68-
void drawDisplayList(const sk_sp<DisplayList> display_list,
68+
void drawDisplayList(const sk_sp<DisplayList>& display_list,
6969
SkScalar opacity) override;
70-
void drawTextBlob(const sk_sp<SkTextBlob> blob,
70+
void drawTextBlob(const sk_sp<SkTextBlob>& blob,
7171
SkScalar x,
7272
SkScalar y) override;
7373
void drawShadow(const SkPath& path,

display_list/benchmarking/dl_complexity_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "flutter/display_list/benchmarking/dl_complexity_gl.h"
77
#include "flutter/display_list/benchmarking/dl_complexity_metal.h"
88
#include "flutter/display_list/display_list.h"
9-
#include "flutter/display_list/dl_builder.h"
9+
#include "flutter/display_list/display_list_builder.h"
1010
#include "flutter/display_list/dl_sampling_options.h"
1111
#include "flutter/display_list/testing/dl_test_snippets.h"
1212
#include "flutter/testing/testing.h"
@@ -102,7 +102,7 @@ TEST(DisplayListComplexity, StrokeWidth) {
102102
auto display_list_stroke_0 = builder_stroke_0.Build();
103103

104104
DisplayListBuilder builder_stroke_1;
105-
builder_stroke_0.DrawLine(SkPoint::Make(0, 0), SkPoint::Make(100, 100),
105+
builder_stroke_1.DrawLine(SkPoint::Make(0, 0), SkPoint::Make(100, 100),
106106
DlPaint().setStrokeWidth(1.0f));
107107
auto display_list_stroke_1 = builder_stroke_1.Build();
108108

0 commit comments

Comments
 (0)