@@ -49,7 +49,7 @@ unsigned int DisplayListGLComplexityCalculator::GLHelper::BatchedComplexity() {
4949}
5050
5151void DisplayListGLComplexityCalculator::GLHelper::saveLayer (
52- const SkRect & bounds,
52+ const DlRect & bounds,
5353 const SaveLayerOptions options,
5454 const DlImageFilter* backdrop) {
5555 if (IsComplex ()) {
@@ -64,8 +64,8 @@ void DisplayListGLComplexityCalculator::GLHelper::saveLayer(
6464 save_layer_count_++;
6565}
6666
67- void DisplayListGLComplexityCalculator::GLHelper::drawLine (const SkPoint & p0,
68- const SkPoint & p1) {
67+ void DisplayListGLComplexityCalculator::GLHelper::drawLine (const DlPoint & p0,
68+ const DlPoint & p1) {
6969 if (IsComplex ()) {
7070 return ;
7171 }
@@ -89,7 +89,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawLine(const SkPoint& p0,
8989
9090 // Use an approximation for the distance to avoid floating point or
9191 // 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 );
9393
9494 // The baseline complexity is for a hairline stroke with no AA.
9595 // m = 1/40
@@ -107,10 +107,10 @@ void DisplayListGLComplexityCalculator::GLHelper::drawDashedLine(
107107 DlScalar off_length) {
108108 // Dashing is slightly more complex than a regular drawLine, but this
109109 // op is so rare it is not worth measuring the difference.
110- drawLine (ToSkPoint (p0), ToSkPoint (p1) );
110+ drawLine (p0, p1 );
111111}
112112
113- void DisplayListGLComplexityCalculator::GLHelper::drawRect (const SkRect & rect) {
113+ void DisplayListGLComplexityCalculator::GLHelper::drawRect (const DlRect & rect) {
114114 if (IsComplex ()) {
115115 return ;
116116 }
@@ -126,14 +126,14 @@ void DisplayListGLComplexityCalculator::GLHelper::drawRect(const SkRect& rect) {
126126 // currently use it anywhere in Flutter.
127127 if (DrawStyle () == DlDrawStyle::kFill ) {
128128 // No real difference for AA with filled styles
129- unsigned int area = rect.width () * rect.height ();
129+ unsigned int area = rect.GetWidth () * rect.GetHeight ();
130130
131131 // m = 1/3500
132132 // c = 0
133133 complexity = area * 2 / 175 ;
134134 } else {
135135 // 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 ;
137137
138138 if (IsAntiAliased ()) {
139139 // m = 1/30
@@ -160,7 +160,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawRect(const SkRect& rect) {
160160}
161161
162162void DisplayListGLComplexityCalculator::GLHelper::drawOval (
163- const SkRect & bounds) {
163+ const DlRect & bounds) {
164164 if (IsComplex ()) {
165165 return ;
166166 }
@@ -169,7 +169,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
169169 //
170170 // Filled styles and stroked styles with AA scale linearly with the bounding
171171 // box area.
172- unsigned int area = bounds.width () * bounds.height ();
172+ unsigned int area = bounds.GetWidth () * bounds.GetHeight ();
173173
174174 unsigned int complexity;
175175
@@ -187,7 +187,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
187187 complexity = area / 20 ;
188188 } else {
189189 // 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 ;
191191
192192 // m = 1/75
193193 // c = 0
@@ -199,8 +199,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawOval(
199199}
200200
201201void DisplayListGLComplexityCalculator::GLHelper::drawCircle (
202- const SkPoint & center,
203- SkScalar radius) {
202+ const DlPoint & center,
203+ DlScalar radius) {
204204 if (IsComplex ()) {
205205 return ;
206206 }
@@ -372,9 +372,9 @@ void DisplayListGLComplexityCalculator::GLHelper::drawPath(const SkPath& path) {
372372}
373373
374374void 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,
378378 bool use_center) {
379379 if (IsComplex ()) {
380380 return ;
@@ -383,7 +383,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
383383 // Stroked styles without AA scale linearly with the log of the diameter.
384384 // Stroked styles with AA scale linearly with the area.
385385 // 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 ();
387387 unsigned int complexity;
388388
389389 // These values were worked out by creating a straight line graph (y=mx+c)
@@ -398,7 +398,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
398398 // c = 12
399399 complexity = (area + 45600 ) / 171 ;
400400 } else {
401- unsigned int diameter = (oval_bounds.width () + oval_bounds.height ()) / 2 ;
401+ unsigned int diameter =
402+ (oval_bounds.GetWidth () + oval_bounds.GetHeight ()) / 2 ;
402403 // m = 15
403404 // c = -100
404405 // This should never go negative though, so use std::max to ensure
@@ -426,7 +427,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawArc(
426427void DisplayListGLComplexityCalculator::GLHelper::drawPoints (
427428 DlCanvas::PointMode mode,
428429 uint32_t count,
429- const SkPoint points[]) {
430+ const DlPoint points[]) {
430431 if (IsComplex ()) {
431432 return ;
432433 }
@@ -514,7 +515,7 @@ void DisplayListGLComplexityCalculator::GLHelper::drawVertices(
514515
515516void DisplayListGLComplexityCalculator::GLHelper::drawImage (
516517 const sk_sp<DlImage> image,
517- const SkPoint point,
518+ const DlPoint& point,
518519 DlImageSampling sampling,
519520 bool render_with_attributes) {
520521 if (IsComplex ()) {
@@ -594,8 +595,8 @@ void DisplayListGLComplexityCalculator::GLHelper::ImageRect(
594595
595596void DisplayListGLComplexityCalculator::GLHelper::drawImageNine (
596597 const sk_sp<DlImage> image,
597- const SkIRect & center,
598- const SkRect & dst,
598+ const DlIRect & center,
599+ const DlRect & dst,
599600 DlFilterMode filter,
600601 bool render_with_attributes) {
601602 if (IsComplex ()) {
@@ -619,13 +620,13 @@ void DisplayListGLComplexityCalculator::GLHelper::drawImageNine(
619620
620621void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList (
621622 const sk_sp<DisplayList> display_list,
622- SkScalar opacity) {
623+ DlScalar opacity) {
623624 if (IsComplex ()) {
624625 return ;
625626 }
626627 GLHelper helper (Ceiling () - CurrentComplexityScore ());
627628 if (opacity < SK_Scalar1 && !display_list->can_apply_group_opacity ()) {
628- auto bounds = display_list->bounds ();
629+ auto bounds = display_list->GetBounds ();
629630 helper.saveLayer (bounds, SaveLayerOptions::kWithAttributes , nullptr );
630631 }
631632 display_list->Dispatch (helper);
@@ -634,8 +635,8 @@ void DisplayListGLComplexityCalculator::GLHelper::drawDisplayList(
634635
635636void DisplayListGLComplexityCalculator::GLHelper::drawTextBlob (
636637 const sk_sp<SkTextBlob> blob,
637- SkScalar x,
638- SkScalar y) {
638+ DlScalar x,
639+ DlScalar y) {
639640 if (IsComplex ()) {
640641 return ;
641642 }
@@ -650,15 +651,15 @@ void DisplayListGLComplexityCalculator::GLHelper::drawTextBlob(
650651
651652void DisplayListGLComplexityCalculator::GLHelper::drawTextFrame (
652653 const std::shared_ptr<impeller::TextFrame>& text_frame,
653- SkScalar x,
654- SkScalar y) {}
654+ DlScalar x,
655+ DlScalar y) {}
655656
656657void DisplayListGLComplexityCalculator::GLHelper::drawShadow (
657658 const SkPath& path,
658659 const DlColor color,
659- const SkScalar elevation,
660+ const DlScalar elevation,
660661 bool transparent_occluder,
661- SkScalar dpr) {
662+ DlScalar dpr) {
662663 if (IsComplex ()) {
663664 return ;
664665 }
0 commit comments