@@ -336,7 +336,7 @@ void Canvas::RestoreToCount(size_t count) {
336
336
void Canvas::DrawPath (const Path& path, const Paint& paint) {
337
337
Entity entity;
338
338
entity.SetTransform (GetCurrentTransform ());
339
- entity.SetClipDepth (GetClipDepth ());
339
+ entity.SetClipDepth (GetClipHeight ());
340
340
entity.SetBlendMode (paint.blend_mode );
341
341
entity.SetContents (CreatePathContentsWithFilters (paint, path));
342
342
@@ -346,7 +346,7 @@ void Canvas::DrawPath(const Path& path, const Paint& paint) {
346
346
void Canvas::DrawPaint (const Paint& paint) {
347
347
Entity entity;
348
348
entity.SetTransform (GetCurrentTransform ());
349
- entity.SetClipDepth (GetClipDepth ());
349
+ entity.SetClipDepth (GetClipHeight ());
350
350
entity.SetBlendMode (paint.blend_mode );
351
351
entity.SetContents (CreateCoverContentsWithFilters (paint));
352
352
@@ -427,7 +427,7 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect,
427
427
428
428
Entity blurred_rrect_entity;
429
429
blurred_rrect_entity.SetTransform (GetCurrentTransform ());
430
- blurred_rrect_entity.SetClipDepth (GetClipDepth ());
430
+ blurred_rrect_entity.SetClipDepth (GetClipHeight ());
431
431
blurred_rrect_entity.SetBlendMode (rrect_paint.blend_mode );
432
432
433
433
rrect_paint.mask_blur_descriptor = std::nullopt;
@@ -447,7 +447,7 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect,
447
447
// Then, draw the non-blurred RRect on top.
448
448
Entity entity;
449
449
entity.SetTransform (GetCurrentTransform ());
450
- entity.SetClipDepth (GetClipDepth ());
450
+ entity.SetClipDepth (GetClipHeight ());
451
451
entity.SetBlendMode (rrect_paint.blend_mode );
452
452
entity.SetContents (CreateContentsForGeometryWithFilters (
453
453
rrect_paint, Geometry::MakeRoundRect (rect, corner_radii)));
@@ -474,7 +474,7 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect,
474
474
void Canvas::DrawLine (const Point & p0, const Point & p1, const Paint& paint) {
475
475
Entity entity;
476
476
entity.SetTransform (GetCurrentTransform ());
477
- entity.SetClipDepth (GetClipDepth ());
477
+ entity.SetClipDepth (GetClipHeight ());
478
478
entity.SetBlendMode (paint.blend_mode );
479
479
entity.SetContents (CreateContentsForGeometryWithFilters (
480
480
paint, Geometry::MakeLine (p0, p1, paint.stroke_width , paint.stroke_cap )));
@@ -494,7 +494,7 @@ void Canvas::DrawRect(const Rect& rect, const Paint& paint) {
494
494
495
495
Entity entity;
496
496
entity.SetTransform (GetCurrentTransform ());
497
- entity.SetClipDepth (GetClipDepth ());
497
+ entity.SetClipDepth (GetClipHeight ());
498
498
entity.SetBlendMode (paint.blend_mode );
499
499
entity.SetContents (
500
500
CreateContentsForGeometryWithFilters (paint, Geometry::MakeRect (rect)));
@@ -521,7 +521,7 @@ void Canvas::DrawOval(const Rect& rect, const Paint& paint) {
521
521
522
522
Entity entity;
523
523
entity.SetTransform (GetCurrentTransform ());
524
- entity.SetClipDepth (GetClipDepth ());
524
+ entity.SetClipDepth (GetClipHeight ());
525
525
entity.SetBlendMode (paint.blend_mode );
526
526
entity.SetContents (
527
527
CreateContentsForGeometryWithFilters (paint, Geometry::MakeOval (rect)));
@@ -539,7 +539,7 @@ void Canvas::DrawRRect(const Rect& rect,
539
539
if (paint.style == Paint::Style ::kFill ) {
540
540
Entity entity;
541
541
entity.SetTransform (GetCurrentTransform ());
542
- entity.SetClipDepth (GetClipDepth ());
542
+ entity.SetClipDepth (GetClipHeight ());
543
543
entity.SetBlendMode (paint.blend_mode );
544
544
entity.SetContents (CreateContentsForGeometryWithFilters (
545
545
paint, Geometry::MakeRoundRect (rect, corner_radii)));
@@ -568,7 +568,7 @@ void Canvas::DrawCircle(const Point& center,
568
568
569
569
Entity entity;
570
570
entity.SetTransform (GetCurrentTransform ());
571
- entity.SetClipDepth (GetClipDepth ());
571
+ entity.SetClipDepth (GetClipHeight ());
572
572
entity.SetBlendMode (paint.blend_mode );
573
573
auto geometry =
574
574
paint.style == Paint::Style ::kStroke
@@ -680,7 +680,7 @@ void Canvas::ClipGeometry(const std::shared_ptr<Geometry>& geometry,
680
680
Entity entity;
681
681
entity.SetTransform (GetCurrentTransform ());
682
682
entity.SetContents (std::move (contents));
683
- entity.SetClipDepth (GetClipDepth ());
683
+ entity.SetClipDepth (GetClipHeight ());
684
684
685
685
GetCurrentPass ().PushClip (std::move (entity));
686
686
@@ -719,7 +719,7 @@ void Canvas::RestoreClip() {
719
719
// This path is empty because ClipRestoreContents just generates a quad that
720
720
// takes up the full render target.
721
721
entity.SetContents (std::make_shared<ClipRestoreContents>());
722
- entity.SetClipDepth (GetClipDepth ());
722
+ entity.SetClipDepth (GetClipHeight ());
723
723
724
724
AddEntityToCurrentPass (std::move (entity));
725
725
}
@@ -734,7 +734,7 @@ void Canvas::DrawPoints(std::vector<Point> points,
734
734
735
735
Entity entity;
736
736
entity.SetTransform (GetCurrentTransform ());
737
- entity.SetClipDepth (GetClipDepth ());
737
+ entity.SetClipDepth (GetClipHeight ());
738
738
entity.SetBlendMode (paint.blend_mode );
739
739
entity.SetContents (CreateContentsForGeometryWithFilters (
740
740
paint,
@@ -790,7 +790,7 @@ void Canvas::DrawImageRect(const std::shared_ptr<Image>& image,
790
790
791
791
Entity entity;
792
792
entity.SetBlendMode (paint.blend_mode );
793
- entity.SetClipDepth (GetClipDepth ());
793
+ entity.SetClipDepth (GetClipHeight ());
794
794
entity.SetContents (paint.WithFilters (contents));
795
795
entity.SetTransform (GetCurrentTransform ());
796
796
@@ -818,7 +818,7 @@ EntityPass& Canvas::GetCurrentPass() {
818
818
return *current_pass_;
819
819
}
820
820
821
- size_t Canvas::GetClipDepth () const {
821
+ size_t Canvas::GetClipHeight () const {
822
822
return transform_stack_.back ().clip_height ;
823
823
}
824
824
@@ -866,7 +866,7 @@ void Canvas::DrawTextFrame(const std::shared_ptr<TextFrame>& text_frame,
866
866
Point position,
867
867
const Paint& paint) {
868
868
Entity entity;
869
- entity.SetClipDepth (GetClipDepth ());
869
+ entity.SetClipDepth (GetClipHeight ());
870
870
entity.SetBlendMode (paint.blend_mode );
871
871
872
872
auto text_contents = std::make_shared<TextContents>();
@@ -918,7 +918,7 @@ void Canvas::DrawVertices(const std::shared_ptr<VerticesGeometry>& vertices,
918
918
919
919
Entity entity;
920
920
entity.SetTransform (GetCurrentTransform ());
921
- entity.SetClipDepth (GetClipDepth ());
921
+ entity.SetClipDepth (GetClipHeight ());
922
922
entity.SetBlendMode (paint.blend_mode );
923
923
924
924
// If there are no vertex color or texture coordinates. Or if there
@@ -1011,7 +1011,7 @@ void Canvas::DrawAtlas(const std::shared_ptr<Image>& atlas,
1011
1011
1012
1012
Entity entity;
1013
1013
entity.SetTransform (GetCurrentTransform ());
1014
- entity.SetClipDepth (GetClipDepth ());
1014
+ entity.SetClipDepth (GetClipHeight ());
1015
1015
entity.SetBlendMode (paint.blend_mode );
1016
1016
entity.SetContents (paint.WithFilters (contents));
1017
1017
0 commit comments