@@ -49,7 +49,7 @@ unsigned int DisplayListGLComplexityCalculator::GLHelper::BatchedComplexity() {
49
49
}
50
50
51
51
void DisplayListGLComplexityCalculator::GLHelper::saveLayer (
52
- const SkRect & bounds,
52
+ const DlRect & bounds,
53
53
const SaveLayerOptions options,
54
54
const DlImageFilter* backdrop) {
55
55
if (IsComplex ()) {
@@ -64,8 +64,8 @@ void DisplayListGLComplexityCalculator::GLHelper::saveLayer(
64
64
save_layer_count_++;
65
65
}
66
66
67
- void DisplayListGLComplexityCalculator::GLHelper::drawLine (const SkPoint & p0,
68
- const SkPoint & p1) {
67
+ void DisplayListGLComplexityCalculator::GLHelper::drawLine (const DlPoint & p0,
68
+ const DlPoint & p1) {
69
69
if (IsComplex ()) {
70
70
return ;
71
71
}
@@ -89,7 +89,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawLine(const SkPoint& p0,
89
89
90
90
// Use an approximation for the distance to avoid floating point or
91
91
// sqrt() calls.
92
- SkScalar distance = abs (p0.x () - p1.x ()) + abs (p0.y () - p1.y () );
92
+ DlScalar distance = abs (p0.x - p1.x ) + abs (p0.y - p1.y );
93
93
94
94
// The baseline complexity is for a hairline stroke with no AA.
95
95
// m = 1/40
@@ -107,10 +107,10 @@ void DisplayListGLComplexityCalculator::GLHelper::drawDashedLine(
107
107
DlScalar off_length) {
108
108
// Dashing is slightly more complex than a regular drawLine, but this
109
109
// op is so rare it is not worth measuring the difference.
110
- drawLine (ToSkPoint (p0), ToSkPoint (p1) );
110
+ drawLine (p0, p1 );
111
111
}
112
112
113
- void DisplayListGLComplexityCalculator::GLHelper::drawRect (const SkRect & rect) {
113
+ void DisplayListGLComplexityCalculator::GLHelper::drawRect (const DlRect & rect) {
114
114
if (IsComplex ()) {
115
115
return ;
116
116
}
@@ -126,14 +126,14 @@ void DisplayListGLComplexityCalculator::GLHelper::drawRect(const SkRect& rect) {
126
126
// currently use it anywhere in Flutter.
127
127
if (DrawStyle () == DlDrawStyle::kFill ) {
128
128
// No real difference for AA with filled styles
129
- unsigned int area = rect.width () * rect.height ();
129
+ unsigned int area = rect.GetWidth () * rect.GetHeight ();
130
130
131
131
// m = 1/3500
132
132
// c = 0
133
133
complexity = area * 2 / 175 ;
134
134
} else {
135
135
// Take the average of the width and height.
136
- unsigned int length = (rect.width () + rect.height ()) / 2 ;
136
+ unsigned int length = (rect.GetWidth () + rect.GetHeight ()) / 2 ;
137
137
138
138
if (IsAntiAliased ()) {
139
139
// m = 1/30
@@ -160,7 +160,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawRect(const SkRect& rect) {
160
160
}
161
161
162
162
void DisplayListGLComplexityCalculator::GLHelper::drawOval (
163
- const SkRect & bounds) {
163
+ const DlRect & bounds) {
164
164
if (IsComplex ()) {
165
165
return ;
166
166
}
@@ -169,7 +169,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
169
169
//
170
170
// Filled styles and stroked styles with AA scale linearly with the bounding
171
171
// box area.
172
- unsigned int area = bounds.width () * bounds.height ();
172
+ unsigned int area = bounds.GetWidth () * bounds.GetHeight ();
173
173
174
174
unsigned int complexity;
175
175
@@ -187,7 +187,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
187
187
complexity = area / 20 ;
188
188
} else {
189
189
// Take the average of the width and height.
190
- unsigned int length = (bounds.width () + bounds.height ()) / 2 ;
190
+ unsigned int length = (bounds.GetWidth () + bounds.GetHeight ()) / 2 ;
191
191
192
192
// m = 1/75
193
193
// c = 0
@@ -199,8 +199,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
199
199
}
200
200
201
201
void DisplayListGLComplexityCalculator::GLHelper::drawCircle (
202
- const SkPoint & center,
203
- SkScalar radius) {
202
+ const DlPoint & center,
203
+ DlScalar radius) {
204
204
if (IsComplex ()) {
205
205
return ;
206
206
}
@@ -372,9 +372,9 @@ void DisplayListGLComplexityCalculator::GLHelper::drawPath(const SkPath& path) {
372
372
}
373
373
374
374
void DisplayListGLComplexityCalculator::GLHelper::drawArc (
375
- const SkRect & oval_bounds,
376
- SkScalar start_degrees,
377
- SkScalar sweep_degrees,
375
+ const DlRect & oval_bounds,
376
+ DlScalar start_degrees,
377
+ DlScalar sweep_degrees,
378
378
bool use_center) {
379
379
if (IsComplex ()) {
380
380
return ;
@@ -383,7 +383,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
383
383
// Stroked styles without AA scale linearly with the log of the diameter.
384
384
// Stroked styles with AA scale linearly with the area.
385
385
// Filled styles scale lienarly with the area.
386
- unsigned int area = oval_bounds.width () * oval_bounds.height ();
386
+ unsigned int area = oval_bounds.GetWidth () * oval_bounds.GetHeight ();
387
387
unsigned int complexity;
388
388
389
389
// These values were worked out by creating a straight line graph (y=mx+c)
@@ -398,7 +398,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
398
398
// c = 12
399
399
complexity = (area + 45600 ) / 171 ;
400
400
} else {
401
- unsigned int diameter = (oval_bounds.width () + oval_bounds.height ()) / 2 ;
401
+ unsigned int diameter =
402
+ (oval_bounds.GetWidth () + oval_bounds.GetHeight ()) / 2 ;
402
403
// m = 15
403
404
// c = -100
404
405
// This should never go negative though, so use std::max to ensure
@@ -426,7 +427,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
426
427
void DisplayListGLComplexityCalculator::GLHelper::drawPoints (
427
428
DlCanvas::PointMode mode,
428
429
uint32_t count,
429
- const SkPoint points[]) {
430
+ const DlPoint points[]) {
430
431
if (IsComplex ()) {
431
432
return ;
432
433
}
@@ -514,7 +515,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawVertices(
514
515
515
516
void DisplayListGLComplexityCalculator::GLHelper::drawImage (
516
517
const sk_sp<DlImage> image,
517
- const SkPoint point,
518
+ const DlPoint& point,
518
519
DlImageSampling sampling,
519
520
bool render_with_attributes) {
520
521
if (IsComplex ()) {
@@ -594,8 +595,8 @@ void DisplayListGLComplexityCalculator::GLHelper::ImageRect(
594
595
595
596
void DisplayListGLComplexityCalculator::GLHelper::drawImageNine (
596
597
const sk_sp<DlImage> image,
597
- const SkIRect & center,
598
- const SkRect & dst,
598
+ const DlIRect & center,
599
+ const DlRect & dst,
599
600
DlFilterMode filter,
600
601
bool render_with_attributes) {
601
602
if (IsComplex ()) {
@@ -619,13 +620,13 @@ void DisplayListGLComplexityCalculator::GLHelper::drawImageNine(
619
620
620
621
void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList (
621
622
const sk_sp<DisplayList> display_list,
622
- SkScalar opacity) {
623
+ DlScalar opacity) {
623
624
if (IsComplex ()) {
624
625
return ;
625
626
}
626
627
GLHelper helper (Ceiling () - CurrentComplexityScore ());
627
628
if (opacity < SK_Scalar1 && !display_list->can_apply_group_opacity ()) {
628
- auto bounds = display_list->bounds ();
629
+ auto bounds = display_list->GetBounds ();
629
630
helper.saveLayer (bounds, SaveLayerOptions::kWithAttributes , nullptr );
630
631
}
631
632
display_list->Dispatch (helper);
@@ -634,8 +635,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList(
634
635
635
636
void DisplayListGLComplexityCalculator::GLHelper::drawTextBlob (
636
637
const sk_sp<SkTextBlob> blob,
637
- SkScalar x,
638
- SkScalar y) {
638
+ DlScalar x,
639
+ DlScalar y) {
639
640
if (IsComplex ()) {
640
641
return ;
641
642
}
@@ -650,15 +651,15 @@ void DisplayListGLComplexityCalculator::GLHelper::drawTextBlob(
650
651
651
652
void DisplayListGLComplexityCalculator::GLHelper::drawTextFrame (
652
653
const std::shared_ptr<impeller::TextFrame>& text_frame,
653
- SkScalar x,
654
- SkScalar y) {}
654
+ DlScalar x,
655
+ DlScalar y) {}
655
656
656
657
void DisplayListGLComplexityCalculator::GLHelper::drawShadow (
657
658
const SkPath& path,
658
659
const DlColor color,
659
- const SkScalar elevation,
660
+ const DlScalar elevation,
660
661
bool transparent_occluder,
661
- SkScalar dpr) {
662
+ DlScalar dpr) {
662
663
if (IsComplex ()) {
663
664
return ;
664
665
}
0 commit comments