diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index e65b1c06c4877..7a32e9d105cda 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -83,9 +83,9 @@ TEST_P(AiksTest, RotateColorFilteredPath) { TEST_P(AiksTest, CanvasCTMCanBeUpdated) { Canvas canvas; Matrix identity; - ASSERT_MATRIX_NEAR(canvas.GetCurrentTransformation(), identity); + ASSERT_MATRIX_NEAR(canvas.GetCurrentTransform(), identity); canvas.Translate(Size{100, 100}); - ASSERT_MATRIX_NEAR(canvas.GetCurrentTransformation(), + ASSERT_MATRIX_NEAR(canvas.GetCurrentTransform(), Matrix::MakeTranslation({100.0, 100.0, 0.0})); } @@ -97,11 +97,11 @@ TEST_P(AiksTest, CanvasCanPushPopCTM) { canvas.Translate(Size{100, 100}); canvas.Save(); ASSERT_EQ(canvas.GetSaveCount(), 2u); - ASSERT_MATRIX_NEAR(canvas.GetCurrentTransformation(), + ASSERT_MATRIX_NEAR(canvas.GetCurrentTransform(), Matrix::MakeTranslation({100.0, 100.0, 0.0})); ASSERT_TRUE(canvas.Restore()); ASSERT_EQ(canvas.GetSaveCount(), 1u); - ASSERT_MATRIX_NEAR(canvas.GetCurrentTransformation(), + ASSERT_MATRIX_NEAR(canvas.GetCurrentTransform(), Matrix::MakeTranslation({100.0, 100.0, 0.0})); } @@ -1889,12 +1889,12 @@ TEST_P(AiksTest, ColorWheel) { TEST_P(AiksTest, TransformMultipliesCorrectly) { Canvas canvas; - ASSERT_MATRIX_NEAR(canvas.GetCurrentTransformation(), Matrix()); + ASSERT_MATRIX_NEAR(canvas.GetCurrentTransform(), Matrix()); // clang-format off canvas.Translate(Vector3(100, 200)); ASSERT_MATRIX_NEAR( - canvas.GetCurrentTransformation(), + canvas.GetCurrentTransform(), Matrix( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, @@ -1902,7 +1902,7 @@ TEST_P(AiksTest, TransformMultipliesCorrectly) { canvas.Rotate(Radians(kPiOver2)); ASSERT_MATRIX_NEAR( - canvas.GetCurrentTransformation(), + canvas.GetCurrentTransform(), Matrix( 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, @@ -1910,7 +1910,7 @@ TEST_P(AiksTest, TransformMultipliesCorrectly) { canvas.Scale(Vector3(2, 3)); ASSERT_MATRIX_NEAR( - canvas.GetCurrentTransformation(), + canvas.GetCurrentTransform(), Matrix( 0, 2, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, @@ -1918,7 +1918,7 @@ TEST_P(AiksTest, TransformMultipliesCorrectly) { canvas.Translate(Vector3(100, 200)); ASSERT_MATRIX_NEAR( - canvas.GetCurrentTransformation(), + canvas.GetCurrentTransform(), Matrix( 0, 2, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, @@ -1964,7 +1964,7 @@ TEST_P(AiksTest, SolidStrokesRenderCorrectly) { auto [handle_a, handle_b] = IMPELLER_PLAYGROUND_LINE( Point(60, 300), Point(600, 300), 20, Color::Red(), Color::Red()); - auto screen_to_canvas = canvas.GetCurrentTransformation().Invert(); + auto screen_to_canvas = canvas.GetCurrentTransform().Invert(); Point point_a = screen_to_canvas * handle_a * GetContentScale(); Point point_b = screen_to_canvas * handle_b * GetContentScale(); @@ -2105,7 +2105,7 @@ TEST_P(AiksTest, GradientStrokesRenderCorrectly) { auto [handle_a, handle_b] = IMPELLER_PLAYGROUND_LINE( Point(60, 300), Point(600, 300), 20, Color::Red(), Color::Red()); - auto screen_to_canvas = canvas.GetCurrentTransformation().Invert(); + auto screen_to_canvas = canvas.GetCurrentTransform().Invert(); Point point_a = screen_to_canvas * handle_a * GetContentScale(); Point point_b = screen_to_canvas * handle_b * GetContentScale(); @@ -3102,7 +3102,7 @@ TEST_P(AiksTest, OpaqueEntitiesGetCoercedToSource) { Entity entity; std::shared_ptr contents; picture.pass->IterateAllEntities([&e = entity, &contents](Entity& entity) { - if (ScalarNearlyEqual(entity.GetTransformation().GetScale().x, 1.618f)) { + if (ScalarNearlyEqual(entity.GetTransform().GetScale().x, 1.618f)) { e = entity; contents = std::static_pointer_cast(entity.GetContents()); diff --git a/impeller/aiks/canvas.cc b/impeller/aiks/canvas.cc index 0bcb16580d2f2..72a943b440bc3 100644 --- a/impeller/aiks/canvas.cc +++ b/impeller/aiks/canvas.cc @@ -41,7 +41,7 @@ void Canvas::Initialize(std::optional cull_rect) { initial_cull_rect_ = cull_rect; base_pass_ = std::make_unique(); current_pass_ = base_pass_.get(); - xformation_stack_.emplace_back(CanvasStackEntry{.cull_rect = cull_rect}); + transform_stack_.emplace_back(CanvasStackEntry{.cull_rect = cull_rect}); FML_DCHECK(GetSaveCount() == 1u); FML_DCHECK(base_pass_->GetSubpassesDepth() == 1u); } @@ -49,7 +49,7 @@ void Canvas::Initialize(std::optional cull_rect) { void Canvas::Reset() { base_pass_ = nullptr; current_pass_ = nullptr; - xformation_stack_ = {}; + transform_stack_ = {}; } void Canvas::Save() { @@ -60,9 +60,9 @@ void Canvas::Save(bool create_subpass, BlendMode blend_mode, const std::shared_ptr& backdrop_filter) { auto entry = CanvasStackEntry{}; - entry.xformation = xformation_stack_.back().xformation; - entry.cull_rect = xformation_stack_.back().cull_rect; - entry.clip_depth = xformation_stack_.back().clip_depth; + entry.transform = transform_stack_.back().transform; + entry.cull_rect = transform_stack_.back().cull_rect; + entry.clip_depth = transform_stack_.back().clip_depth; if (create_subpass) { entry.rendering_mode = Entity::RenderingMode::kSubpass; auto subpass = std::make_unique(); @@ -82,25 +82,25 @@ void Canvas::Save(bool create_subpass, } subpass->SetBlendMode(blend_mode); current_pass_ = GetCurrentPass().AddSubpass(std::move(subpass)); - current_pass_->SetTransformation(xformation_stack_.back().xformation); - current_pass_->SetClipDepth(xformation_stack_.back().clip_depth); + current_pass_->SetTransform(transform_stack_.back().transform); + current_pass_->SetClipDepth(transform_stack_.back().clip_depth); } - xformation_stack_.emplace_back(entry); + transform_stack_.emplace_back(entry); } bool Canvas::Restore() { - FML_DCHECK(xformation_stack_.size() > 0); - if (xformation_stack_.size() == 1) { + FML_DCHECK(transform_stack_.size() > 0); + if (transform_stack_.size() == 1) { return false; } - if (xformation_stack_.back().rendering_mode == + if (transform_stack_.back().rendering_mode == Entity::RenderingMode::kSubpass) { current_pass_ = GetCurrentPass().GetSuperpass(); FML_DCHECK(current_pass_); } - bool contains_clips = xformation_stack_.back().contains_clips; - xformation_stack_.pop_back(); + bool contains_clips = transform_stack_.back().contains_clips; + transform_stack_.pop_back(); if (contains_clips) { RestoreClip(); @@ -109,30 +109,30 @@ bool Canvas::Restore() { return true; } -void Canvas::Concat(const Matrix& xformation) { - xformation_stack_.back().xformation = GetCurrentTransformation() * xformation; +void Canvas::Concat(const Matrix& transform) { + transform_stack_.back().transform = GetCurrentTransform() * transform; } -void Canvas::PreConcat(const Matrix& xformation) { - xformation_stack_.back().xformation = xformation * GetCurrentTransformation(); +void Canvas::PreConcat(const Matrix& transform) { + transform_stack_.back().transform = transform * GetCurrentTransform(); } void Canvas::ResetTransform() { - xformation_stack_.back().xformation = {}; + transform_stack_.back().transform = {}; } -void Canvas::Transform(const Matrix& xformation) { - Concat(xformation); +void Canvas::Transform(const Matrix& transform) { + Concat(transform); } -const Matrix& Canvas::GetCurrentTransformation() const { - return xformation_stack_.back().xformation; +const Matrix& Canvas::GetCurrentTransform() const { + return transform_stack_.back().transform; } const std::optional Canvas::GetCurrentLocalCullingBounds() const { - auto cull_rect = xformation_stack_.back().cull_rect; + auto cull_rect = transform_stack_.back().cull_rect; if (cull_rect.has_value()) { - Matrix inverse = xformation_stack_.back().xformation.Invert(); + Matrix inverse = transform_stack_.back().transform.Invert(); cull_rect = cull_rect.value().TransformBounds(inverse); } return cull_rect; @@ -159,7 +159,7 @@ void Canvas::Rotate(Radians radians) { } size_t Canvas::GetSaveCount() const { - return xformation_stack_.size(); + return transform_stack_.size(); } void Canvas::RestoreToCount(size_t count) { @@ -172,7 +172,7 @@ void Canvas::RestoreToCount(size_t count) { void Canvas::DrawPath(const Path& path, const Paint& paint) { Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters(paint.CreateContentsForEntity(path))); @@ -182,7 +182,7 @@ void Canvas::DrawPath(const Path& path, const Paint& paint) { void Canvas::DrawPaint(const Paint& paint) { Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.CreateContentsForEntity({}, true)); @@ -216,7 +216,7 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect, new_paint.mask_blur_descriptor = std::nullopt; Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(new_paint.blend_mode); entity.SetContents(new_paint.WithFilters(std::move(contents))); @@ -239,7 +239,7 @@ void Canvas::DrawLine(const Point& p0, const Point& p1, const Paint& paint) { } Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters(paint.CreateContentsForGeometry( @@ -259,7 +259,7 @@ void Canvas::DrawRect(Rect rect, const Paint& paint) { } Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters( @@ -280,7 +280,7 @@ void Canvas::DrawRRect(Rect rect, Point corner_radii, const Paint& paint) { .TakePath(); if (paint.style == Paint::Style::kFill) { Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters( @@ -321,10 +321,10 @@ void Canvas::ClipPath(const Path& path, Entity::ClipOperation clip_op) { void Canvas::ClipRect(const Rect& rect, Entity::ClipOperation clip_op) { auto geometry = Geometry::MakeRect(rect); - auto& cull_rect = xformation_stack_.back().cull_rect; - if (clip_op == Entity::ClipOperation::kIntersect && // - cull_rect.has_value() && // - geometry->CoversArea(xformation_stack_.back().xformation, *cull_rect) // + auto& cull_rect = transform_stack_.back().cull_rect; + if (clip_op == Entity::ClipOperation::kIntersect && // + cull_rect.has_value() && // + geometry->CoversArea(transform_stack_.back().transform, *cull_rect) // ) { return; // This clip will do nothing, so skip it. } @@ -357,10 +357,10 @@ void Canvas::ClipRRect(const Rect& rect, ? rect.Expand(-corner_radii) : std::make_optional(); auto geometry = Geometry::MakeFillPath(path, inner_rect); - auto& cull_rect = xformation_stack_.back().cull_rect; - if (clip_op == Entity::ClipOperation::kIntersect && // - cull_rect.has_value() && // - geometry->CoversArea(xformation_stack_.back().xformation, *cull_rect) // + auto& cull_rect = transform_stack_.back().cull_rect; + if (clip_op == Entity::ClipOperation::kIntersect && // + cull_rect.has_value() && // + geometry->CoversArea(transform_stack_.back().transform, *cull_rect) // ) { return; // This clip will do nothing, so skip it. } @@ -397,19 +397,19 @@ void Canvas::ClipGeometry(std::unique_ptr geometry, contents->SetClipOperation(clip_op); Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetContents(std::move(contents)); entity.SetClipDepth(GetClipDepth()); GetCurrentPass().AddEntity(entity); - ++xformation_stack_.back().clip_depth; - xformation_stack_.back().contains_clips = true; + ++transform_stack_.back().clip_depth; + transform_stack_.back().contains_clips = true; } void Canvas::IntersectCulling(Rect clip_rect) { - clip_rect = clip_rect.TransformBounds(GetCurrentTransformation()); - std::optional& cull_rect = xformation_stack_.back().cull_rect; + clip_rect = clip_rect.TransformBounds(GetCurrentTransform()); + std::optional& cull_rect = transform_stack_.back().cull_rect; if (cull_rect.has_value()) { cull_rect = cull_rect .value() // @@ -421,9 +421,9 @@ void Canvas::IntersectCulling(Rect clip_rect) { } void Canvas::SubtractCulling(Rect clip_rect) { - std::optional& cull_rect = xformation_stack_.back().cull_rect; + std::optional& cull_rect = transform_stack_.back().cull_rect; if (cull_rect.has_value()) { - clip_rect = clip_rect.TransformBounds(GetCurrentTransformation()); + clip_rect = clip_rect.TransformBounds(GetCurrentTransform()); cull_rect = cull_rect .value() // .Cutout(clip_rect) // @@ -434,7 +434,7 @@ void Canvas::SubtractCulling(Rect clip_rect) { void Canvas::RestoreClip() { Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); // This path is empty because ClipRestoreContents just generates a quad that // takes up the full render target. entity.SetContents(std::make_shared()); @@ -452,7 +452,7 @@ void Canvas::DrawPoints(std::vector points, } Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters(paint.CreateContentsForGeometry( @@ -473,8 +473,7 @@ void Canvas::DrawPicture(const Picture& picture) { pass->IterateAllElements([&](auto& element) -> bool { if (auto entity = std::get_if(&element)) { entity->IncrementStencilDepth(GetClipDepth()); - entity->SetTransformation(GetCurrentTransformation() * - entity->GetTransformation()); + entity->SetTransform(GetCurrentTransform() * entity->GetTransform()); return true; } @@ -532,7 +531,7 @@ void Canvas::DrawImageRect(const std::shared_ptr& image, entity.SetBlendMode(paint.blend_mode); entity.SetClipDepth(GetClipDepth()); entity.SetContents(paint.WithFilters(contents)); - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); GetCurrentPass().AddEntity(entity); } @@ -553,7 +552,7 @@ EntityPass& Canvas::GetCurrentPass() { } size_t Canvas::GetClipDepth() const { - return xformation_stack_.back().clip_depth; + return transform_stack_.back().clip_depth; } void Canvas::SaveLayer(const Paint& paint, @@ -585,8 +584,8 @@ void Canvas::DrawTextFrame(const std::shared_ptr& text_frame, text_contents->SetTextFrame(text_frame); text_contents->SetColor(paint.color); - entity.SetTransformation(GetCurrentTransformation() * - Matrix::MakeTranslation(position)); + entity.SetTransform(GetCurrentTransform() * + Matrix::MakeTranslation(position)); // TODO(bdero): This mask blur application is a hack. It will always wind up // doing a gaussian blur that affects the color source itself @@ -628,7 +627,7 @@ void Canvas::DrawVertices(const std::shared_ptr& vertices, } Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); @@ -701,7 +700,7 @@ void Canvas::DrawAtlas(const std::shared_ptr& atlas, contents->SetAlpha(paint.color.alpha); Entity entity; - entity.SetTransformation(GetCurrentTransformation()); + entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters(contents)); diff --git a/impeller/aiks/canvas.h b/impeller/aiks/canvas.h index 1bee70b25f587..28287f7fb44b1 100644 --- a/impeller/aiks/canvas.h +++ b/impeller/aiks/canvas.h @@ -31,7 +31,7 @@ namespace impeller { class Entity; struct CanvasStackEntry { - Matrix xformation; + Matrix transform; // |cull_rect| is conservative screen-space bounds of the clipped output area std::optional cull_rect; size_t clip_depth = 0u; @@ -77,17 +77,17 @@ class Canvas { void RestoreToCount(size_t count); - const Matrix& GetCurrentTransformation() const; + const Matrix& GetCurrentTransform() const; const std::optional GetCurrentLocalCullingBounds() const; void ResetTransform(); - void Transform(const Matrix& xformation); + void Transform(const Matrix& transform); - void Concat(const Matrix& xformation); + void Concat(const Matrix& transform); - void PreConcat(const Matrix& xformation); + void PreConcat(const Matrix& transform); void Translate(const Vector3& offset); @@ -164,7 +164,7 @@ class Canvas { private: std::unique_ptr base_pass_; EntityPass* current_pass_ = nullptr; - std::deque xformation_stack_; + std::deque transform_stack_; std::optional initial_cull_rect_; void Initialize(std::optional cull_rect); diff --git a/impeller/aiks/canvas_recorder.h b/impeller/aiks/canvas_recorder.h index 360f39fa39878..cbffd833bfe76 100644 --- a/impeller/aiks/canvas_recorder.h +++ b/impeller/aiks/canvas_recorder.h @@ -118,8 +118,8 @@ class CanvasRecorder { count); } - const Matrix& GetCurrentTransformation() const { - return canvas_.GetCurrentTransformation(); + const Matrix& GetCurrentTransform() const { + return canvas_.GetCurrentTransform(); } const std::optional GetCurrentLocalCullingBounds() const { @@ -130,18 +130,18 @@ class CanvasRecorder { return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(ResetTransform)); } - void Transform(const Matrix& xformation) { + void Transform(const Matrix& transform) { return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(Transform), - xformation); + transform); } - void Concat(const Matrix& xformation) { - return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(Concat), xformation); + void Concat(const Matrix& transform) { + return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(Concat), transform); } - void PreConcat(const Matrix& xformation) { + void PreConcat(const Matrix& transform) { return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(PreConcat), - xformation); + transform); } void Translate(const Vector3& offset) { diff --git a/impeller/aiks/picture.cc b/impeller/aiks/picture.cc index d924caa8924ce..907bbf6ca49ba 100644 --- a/impeller/aiks/picture.cc +++ b/impeller/aiks/picture.cc @@ -45,9 +45,9 @@ std::shared_ptr Picture::RenderToTexture( pass->IterateAllEntities([&translate](auto& entity) -> bool { auto matrix = translate.has_value() - ? translate.value() * entity.GetTransformation() - : entity.GetTransformation(); - entity.SetTransformation(matrix); + ? translate.value() * entity.GetTransform() + : entity.GetTransform(); + entity.SetTransform(matrix); return true; }); diff --git a/impeller/compiler/shader_lib/impeller/gradient.glsl b/impeller/compiler/shader_lib/impeller/gradient.glsl index 871b4646ebdeb..53160385e0c0f 100644 --- a/impeller/compiler/shader_lib/impeller/gradient.glsl +++ b/impeller/compiler/shader_lib/impeller/gradient.glsl @@ -77,7 +77,7 @@ vec2 IPComputeConicalT(vec2 c0, float r0, vec2 c1, float r1, vec2 pos) { } // Apply mapping from [Cf, C1] to unit x, and apply the precalculations from - // steps 3 and 4, all in the same transformation. + // steps 3 and 4, all in the same transform. vec2 cf = c0 * (1.0 - f) + c1 * f; mat3 transform = IPMapToUnitX(cf, c1); diff --git a/impeller/compiler/types.cc b/impeller/compiler/types.cc index fed5bd09e4847..310a685f4f2d5 100644 --- a/impeller/compiler/types.cc +++ b/impeller/compiler/types.cc @@ -159,7 +159,7 @@ std::string ShaderCErrorToString(shaderc_compilation_status status) { case Status::shaderc_compilation_status_validation_error: return "Validation error"; case Status::shaderc_compilation_status_transformation_error: - return "Transformation error"; + return "Transform error"; case Status::shaderc_compilation_status_configuration_error: return "Configuration error"; } diff --git a/impeller/display_list/dl_dispatcher.cc b/impeller/display_list/dl_dispatcher.cc index 0d80da4b9ec3b..02fa2a6d4b41b 100644 --- a/impeller/display_list/dl_dispatcher.cc +++ b/impeller/display_list/dl_dispatcher.cc @@ -693,14 +693,14 @@ void DlDispatcher::transformFullPerspective(SkScalar mxx, // The order of arguments is row-major but Impeller matrices are // column-major. // clang-format off - auto xformation = Matrix{ + auto transform = Matrix{ mxx, myx, mzx, mwx, mxy, myy, mzy, mwy, mxz, myz, mzz, mwz, mxt, myt, mzt, mwt }; // clang-format on - canvas_.Transform(xformation); + canvas_.Transform(transform); } // |flutter::DlOpReceiver| @@ -989,7 +989,7 @@ void DlDispatcher::drawDisplayList( // Matrix and clip are left untouched, the current // transform is saved as the new base matrix, and paint // values are reset to defaults. - initial_matrix_ = canvas_.GetCurrentTransformation(); + initial_matrix_ = canvas_.GetCurrentTransform(); paint_ = Paint(); // Handle passed opacity in the most brute-force way by using @@ -1096,7 +1096,7 @@ void DlDispatcher::drawShadow(const SkPath& path, paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{ .style = FilterContents::BlurStyle::kNormal, .sigma = Radius{kLightRadius * occluder_z / - canvas_.GetCurrentTransformation().GetScale().y}, + canvas_.GetCurrentTransform().GetScale().y}, }; canvas_.Save(); diff --git a/impeller/display_list/dl_unittests.cc b/impeller/display_list/dl_unittests.cc index 88bb359e58321..7eb2a98691f5c 100644 --- a/impeller/display_list/dl_unittests.cc +++ b/impeller/display_list/dl_unittests.cc @@ -956,7 +956,7 @@ TEST_P(DisplayListTest, TransparentShadowProducesCorrectColor) { std::shared_ptr rrect_blur; picture.pass->IterateAllEntities([&rrect_blur](Entity& entity) { - if (ScalarNearlyEqual(entity.GetTransformation().GetScale().x, 1.618f)) { + if (ScalarNearlyEqual(entity.GetTransform().GetScale().x, 1.618f)) { rrect_blur = std::static_pointer_cast( entity.GetContents()); return false; diff --git a/impeller/entity/contents/atlas_contents.cc b/impeller/entity/contents/atlas_contents.cc index f92c3dbd3449b..412441b03be2c 100644 --- a/impeller/entity/contents/atlas_contents.cc +++ b/impeller/entity/contents/atlas_contents.cc @@ -148,9 +148,9 @@ std::shared_ptr AtlasContents::GenerateSubAtlas() const { std::optional AtlasContents::GetCoverage(const Entity& entity) const { if (cull_rect_.has_value()) { - return cull_rect_.value().TransformBounds(entity.GetTransformation()); + return cull_rect_.value().TransformBounds(entity.GetTransform()); } - return ComputeBoundingBox().TransformBounds(entity.GetTransformation()); + return ComputeBoundingBox().TransformBounds(entity.GetTransform()); } Rect AtlasContents::ComputeBoundingBox() const { @@ -283,7 +283,7 @@ bool AtlasContents::Render(const ContentContext& renderer, FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); auto uniform_view = host_buffer.EmplaceUniform(frame_info); VS::BindFrameInfo(cmd, uniform_view); @@ -338,7 +338,7 @@ AtlasTextureContents::~AtlasTextureContents() {} std::optional AtlasTextureContents::GetCoverage( const Entity& entity) const { - return coverage_.TransformBounds(entity.GetTransformation()); + return coverage_.TransformBounds(entity.GetTransform()); } void AtlasTextureContents::SetAlpha(Scalar alpha) { @@ -419,7 +419,7 @@ bool AtlasTextureContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.texture_sampler_y_coord_scale = texture->GetYCoordScale(); frame_info.alpha = alpha_; @@ -444,7 +444,7 @@ AtlasColorContents::~AtlasColorContents() {} std::optional AtlasColorContents::GetCoverage( const Entity& entity) const { - return coverage_.TransformBounds(entity.GetTransformation()); + return coverage_.TransformBounds(entity.GetTransform()); } void AtlasColorContents::SetAlpha(Scalar alpha) { @@ -507,7 +507,7 @@ bool AtlasColorContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); FS::FragInfo frag_info; frag_info.alpha = alpha_; diff --git a/impeller/entity/contents/clip_contents.cc b/impeller/entity/contents/clip_contents.cc index c6c173171f3b1..27f7deaeb8eb5 100644 --- a/impeller/entity/contents/clip_contents.cc +++ b/impeller/entity/contents/clip_contents.cc @@ -50,7 +50,7 @@ Contents::ClipCoverage ClipContents::GetClipCoverage( if (!geometry_) { return {.type = ClipCoverage::Type::kAppend, .coverage = std::nullopt}; } - auto coverage = geometry_->GetCoverage(entity.GetTransformation()); + auto coverage = geometry_->GetCoverage(entity.GetTransform()); if (!coverage.has_value() || !current_clip_coverage.has_value()) { return {.type = ClipCoverage::Type::kAppend, .coverage = std::nullopt}; } diff --git a/impeller/entity/contents/clip_contents.h b/impeller/entity/contents/clip_contents.h index cb1ea1bf85cfe..a74a070bb4406 100644 --- a/impeller/entity/contents/clip_contents.h +++ b/impeller/entity/contents/clip_contents.h @@ -65,7 +65,7 @@ class ClipRestoreContents final : public Contents { /// @brief The area on the pass texture where this clip restore will be /// applied. If unset, the entire pass texture will be restored. /// - /// @note This rectangle is not transformed by the entity's transformation. + /// @note This rectangle is not transformed by the entity's transform. void SetRestoreCoverage(std::optional coverage); // |Contents| diff --git a/impeller/entity/contents/color_source_contents.cc b/impeller/entity/contents/color_source_contents.cc index 8977b6d6026b1..48731f3d3fd2b 100644 --- a/impeller/entity/contents/color_source_contents.cc +++ b/impeller/entity/contents/color_source_contents.cc @@ -44,7 +44,7 @@ bool ColorSourceContents::IsSolidColor() const { std::optional ColorSourceContents::GetCoverage( const Entity& entity) const { - return geometry_->GetCoverage(entity.GetTransformation()); + return geometry_->GetCoverage(entity.GetTransform()); }; bool ColorSourceContents::CanInheritOpacity(const Entity& entity) const { diff --git a/impeller/entity/contents/color_source_contents.h b/impeller/entity/contents/color_source_contents.h index 72a36b0709f6f..a35d4d2277e2a 100644 --- a/impeller/entity/contents/color_source_contents.h +++ b/impeller/entity/contents/color_source_contents.h @@ -49,7 +49,7 @@ class ColorSourceContents : public Contents { //---------------------------------------------------------------------------- /// @brief Set the effect transform for this color source. /// - /// The effect transform is a transformation matrix that is applied to + /// The effect transform is a transform matrix that is applied to /// the shaded color output and does not impact geometry in any way. /// /// For example: With repeat tiling, any gradient or diff --git a/impeller/entity/contents/conical_gradient_contents.cc b/impeller/entity/contents/conical_gradient_contents.cc index a1e7320142494..7b7d9119763ee 100644 --- a/impeller/entity/contents/conical_gradient_contents.cc +++ b/impeller/entity/contents/conical_gradient_contents.cc @@ -90,7 +90,7 @@ bool ConicalGradientContents::RenderSSBO(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); Command cmd; diff --git a/impeller/entity/contents/contents.cc b/impeller/entity/contents/contents.cc index aefdfe16974c1..ba9b0efa10b0f 100644 --- a/impeller/entity/contents/contents.cc +++ b/impeller/entity/contents/contents.cc @@ -87,9 +87,9 @@ std::optional Contents::RenderToSnapshot( RenderPass& pass) -> bool { Entity sub_entity; sub_entity.SetBlendMode(BlendMode::kSourceOver); - sub_entity.SetTransformation( + sub_entity.SetTransform( Matrix::MakeTranslation(Vector3(-coverage->origin)) * - entity.GetTransformation()); + entity.GetTransform()); return contents.Render(renderer, sub_entity, pass); }, msaa_enabled); diff --git a/impeller/entity/contents/filters/blend_filter_contents.cc b/impeller/entity/contents/filters/blend_filter_contents.cc index 197b74d998e73..dc480f5e6cc7c 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/impeller/entity/contents/filters/blend_filter_contents.cc @@ -372,7 +372,7 @@ std::optional BlendFilterContents::CreateForegroundAdvancedBlend( FS::BindBlendInfo(cmd, blend_uniform); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); auto uniform_view = host_buffer.EmplaceUniform(frame_info); VS::BindFrameInfo(cmd, uniform_view); @@ -381,7 +381,7 @@ std::optional BlendFilterContents::CreateForegroundAdvancedBlend( }; CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); @@ -497,7 +497,7 @@ std::optional BlendFilterContents::CreateForegroundPorterDuffBlend( FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); auto uniform_view = host_buffer.EmplaceUniform(frame_info); VS::BindFrameInfo(cmd, uniform_view); @@ -507,7 +507,7 @@ std::optional BlendFilterContents::CreateForegroundPorterDuffBlend( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc b/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc index 196256c1484ed..c653f54a23dbb 100644 --- a/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc @@ -115,7 +115,7 @@ std::optional BorderMaskBlurFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.texture_sampler_y_coord_scale = input_snapshot->texture->GetYCoordScale(); @@ -136,7 +136,7 @@ std::optional BorderMaskBlurFilterContents::RenderFilter( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/filters/color_matrix_filter_contents.cc b/impeller/entity/contents/filters/color_matrix_filter_contents.cc index d9878896cd903..f0d9cfe5f2f3a 100644 --- a/impeller/entity/contents/filters/color_matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/color_matrix_filter_contents.cc @@ -78,7 +78,7 @@ std::optional ColorMatrixFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation() * input_snapshot->transform * + entity.GetTransform() * input_snapshot->transform * Matrix::MakeScale(Vector2(size)); frame_info.texture_sampler_y_coord_scale = input_snapshot->texture->GetYCoordScale(); @@ -109,7 +109,7 @@ std::optional ColorMatrixFilterContents::RenderFilter( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.cc index 47172e3ead1d5..4df745e1e4b18 100644 --- a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.cc @@ -95,7 +95,7 @@ std::optional DirectionalGaussianBlurFilterContents::RenderFilter( auto radius = Radius{ScaleSigma(blur_sigma_)}.radius; - auto transform = entity.GetTransformation() * effect_transform.Basis(); + auto transform = entity.GetTransform() * effect_transform.Basis(); auto transformed_blur_radius = transform.TransformDirection(blur_direction_ * radius); diff --git a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents_unittests.cc b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents_unittests.cc index cfe98445adaf4..c91ae493f9bac 100644 --- a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents_unittests.cc +++ b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents_unittests.cc @@ -48,7 +48,7 @@ TEST_P(DirectionalGaussianBlurFilterContentsTest, CoverageWithEffectTransform) { desc); FilterInput::Vector inputs = {FilterInput::Make(texture)}; Entity entity; - entity.SetTransformation(Matrix::MakeTranslation({100, 100, 0})); + entity.SetTransform(Matrix::MakeTranslation({100, 100, 0})); std::optional coverage = contents->GetFilterCoverage( inputs, entity, /*effect_transform=*/Matrix::MakeScale({2.0, 2.0, 1.0})); EXPECT_TRUE(coverage.has_value()); diff --git a/impeller/entity/contents/filters/filter_contents.cc b/impeller/entity/contents/filters/filter_contents.cc index 3414a24c96b30..27b2bd77dc404 100644 --- a/impeller/entity/contents/filters/filter_contents.cc +++ b/impeller/entity/contents/filters/filter_contents.cc @@ -203,8 +203,7 @@ std::optional FilterContents::GetLocalCoverage( std::optional FilterContents::GetCoverage(const Entity& entity) const { Entity entity_with_local_transform = entity; - entity_with_local_transform.SetTransformation( - GetTransform(entity.GetTransformation())); + entity_with_local_transform.SetTransform(GetTransform(entity.GetTransform())); return GetLocalCoverage(entity_with_local_transform); } @@ -271,8 +270,7 @@ std::optional FilterContents::GetEntity( const Entity& entity, const std::optional& coverage_hint) const { Entity entity_with_local_transform = entity; - entity_with_local_transform.SetTransformation( - GetTransform(entity.GetTransformation())); + entity_with_local_transform.SetTransform(GetTransform(entity.GetTransform())); auto coverage = GetLocalCoverage(entity_with_local_transform); if (!coverage.has_value() || coverage->IsEmpty()) { diff --git a/impeller/entity/contents/filters/filter_contents.h b/impeller/entity/contents/filters/filter_contents.h index 544080a6c5489..0b70e0ee3191a 100644 --- a/impeller/entity/contents/filters/filter_contents.h +++ b/impeller/entity/contents/filters/filter_contents.h @@ -170,8 +170,8 @@ class FilterContents : public Contents { Matrix GetTransform(const Matrix& parent_transform) const; /// @brief Returns true if this filter graph doesn't perform any basis - /// transformations to the filtered content. For example: Rotating, - /// scaling, and skewing are all basis transformations, but + /// transforms to the filtered content. For example: Rotating, + /// scaling, and skewing are all basis transforms, but /// translating is not. /// /// This is useful for determining whether a filtered object's space @@ -191,8 +191,8 @@ class FilterContents : public Contents { /// @brief Marks this filter chain as applying in a subpass scenario. /// /// Subpasses render in screenspace, and this setting informs filters - /// that the current transformation matrix of the entity is not stored - /// in the Entity transformation matrix. Instead, the effect transform + /// that the current transform matrix of the entity is not stored + /// in the Entity transform matrix. Instead, the effect transform /// is used in this case. virtual void SetRenderingMode(Entity::RenderingMode rendering_mode); diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 02b353a69e33b..1500f773a0743 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -250,7 +250,7 @@ std::optional GaussianBlurFilterContents::RenderFilter( Snapshot{ .texture = pass3_out_texture, .transform = - entity.GetTransformation() * + entity.GetTransform() * Matrix::MakeScale( {input_snapshot->texture->GetSize().width / static_cast(pass1_out_texture->GetSize().width), diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc index 93330a62fa37f..aff2aabba93d1 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc @@ -80,7 +80,7 @@ TEST_P(GaussianBlurFilterContentsTest, CoverageWithTexture) { desc); FilterInput::Vector inputs = {FilterInput::Make(texture)}; Entity entity; - entity.SetTransformation(Matrix::MakeTranslation({100, 100, 0})); + entity.SetTransform(Matrix::MakeTranslation({100, 100, 0})); std::optional coverage = contents.GetFilterCoverage(inputs, entity, /*effect_transform=*/Matrix()); ASSERT_EQ(coverage, Rect::MakeLTRB(99, 99, 201, 201)); @@ -98,7 +98,7 @@ TEST_P(GaussianBlurFilterContentsTest, CoverageWithEffectTransform) { desc); FilterInput::Vector inputs = {FilterInput::Make(texture)}; Entity entity; - entity.SetTransformation(Matrix::MakeTranslation({100, 100, 0})); + entity.SetTransform(Matrix::MakeTranslation({100, 100, 0})); std::optional coverage = contents.GetFilterCoverage( inputs, entity, /*effect_transform=*/Matrix::MakeScale({2.0, 2.0, 1.0})); ASSERT_EQ(coverage, Rect::MakeLTRB(100 - 2, 100 - 2, 200 + 2, 200 + 2)); @@ -159,7 +159,7 @@ TEST_P(GaussianBlurFilterContentsTest, std::shared_ptr renderer = GetContentContext(); Entity entity; - entity.SetTransformation(Matrix::MakeTranslation({100, 200, 0})); + entity.SetTransform(Matrix::MakeTranslation({100, 200, 0})); std::optional result = contents->GetEntity(*renderer, entity, /*coverage_hint=*/{}); EXPECT_TRUE(result.has_value()); @@ -196,8 +196,8 @@ TEST_P(GaussianBlurFilterContentsTest, std::shared_ptr renderer = GetContentContext(); Entity entity; - entity.SetTransformation(Matrix::MakeTranslation({400, 100, 0}) * - Matrix::MakeRotationZ(Degrees(90.0))); + entity.SetTransform(Matrix::MakeTranslation({400, 100, 0}) * + Matrix::MakeRotationZ(Degrees(90.0))); std::optional result = contents->GetEntity(*renderer, entity, /*coverage_hint=*/{}); EXPECT_TRUE(result.has_value()); diff --git a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc index eabefd380d882..200edc632d956 100644 --- a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc +++ b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc @@ -51,11 +51,11 @@ std::optional FilterContentsFilterInput::GetSourceCoverage( Matrix FilterContentsFilterInput::GetLocalTransform( const Entity& entity) const { - return filter_->GetLocalTransform(entity.GetTransformation()); + return filter_->GetLocalTransform(entity.GetTransform()); } Matrix FilterContentsFilterInput::GetTransform(const Entity& entity) const { - return filter_->GetTransform(entity.GetTransformation()); + return filter_->GetTransform(entity.GetTransform()); } void FilterContentsFilterInput::PopulateGlyphAtlas( diff --git a/impeller/entity/contents/filters/inputs/filter_input.cc b/impeller/entity/contents/filters/inputs/filter_input.cc index 34df9ed19b8c0..880e4c6b6f382 100644 --- a/impeller/entity/contents/filters/inputs/filter_input.cc +++ b/impeller/entity/contents/filters/inputs/filter_input.cc @@ -62,7 +62,7 @@ Matrix FilterInput::GetLocalTransform(const Entity& entity) const { std::optional FilterInput::GetLocalCoverage(const Entity& entity) const { Entity local_entity = entity; - local_entity.SetTransformation(GetLocalTransform(entity)); + local_entity.SetTransform(GetLocalTransform(entity)); return GetCoverage(local_entity); } @@ -73,7 +73,7 @@ std::optional FilterInput::GetSourceCoverage( } Matrix FilterInput::GetTransform(const Entity& entity) const { - return entity.GetTransformation() * GetLocalTransform(entity); + return entity.GetTransform() * GetLocalTransform(entity); } void FilterInput::PopulateGlyphAtlas( diff --git a/impeller/entity/contents/filters/inputs/filter_input.h b/impeller/entity/contents/filters/inputs/filter_input.h index 125a2eba3329a..9d1dd5189edd7 100644 --- a/impeller/entity/contents/filters/inputs/filter_input.h +++ b/impeller/entity/contents/filters/inputs/filter_input.h @@ -64,7 +64,7 @@ class FilterInput { virtual Matrix GetLocalTransform(const Entity& entity) const; /// @brief Get the transform of this `FilterInput`. This is equivalent to - /// calling `entity.GetTransformation() * GetLocalTransform()`. + /// calling `entity.GetTransform() * GetLocalTransform()`. virtual Matrix GetTransform(const Entity& entity) const; /// @see `Contents::PopulateGlyphAtlas` @@ -72,7 +72,7 @@ class FilterInput { const std::shared_ptr& lazy_glyph_atlas, Scalar scale); - /// @see `FilterContents::HasBasisTransformations` + /// @see `FilterContents::HasBasisTransforms` virtual bool IsTranslationOnly() const; /// @brief Returns `true` unless this input is a `FilterInput`, which may diff --git a/impeller/entity/contents/filters/inputs/filter_input_unittests.cc b/impeller/entity/contents/filters/inputs/filter_input_unittests.cc index a4683664eb514..ab924a13c5d4b 100644 --- a/impeller/entity/contents/filters/inputs/filter_input_unittests.cc +++ b/impeller/entity/contents/filters/inputs/filter_input_unittests.cc @@ -19,7 +19,7 @@ TEST(FilterInputTest, CanSetLocalTransformForTexture) { auto input = FilterInput::Make(texture, Matrix::MakeTranslation({1.0, 0.0, 0.0})); Entity e; - e.SetTransformation(Matrix::MakeTranslation({0.0, 2.0, 0.0})); + e.SetTransform(Matrix::MakeTranslation({0.0, 2.0, 0.0})); ASSERT_MATRIX_NEAR(input->GetLocalTransform(e), Matrix::MakeTranslation({1.0, 0.0, 0.0})); diff --git a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc index 8b42813e26c69..b476a6739680e 100644 --- a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc +++ b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc @@ -69,7 +69,7 @@ std::optional LinearToSrgbFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation() * input_snapshot->transform * + entity.GetTransform() * input_snapshot->transform * Matrix::MakeScale(Vector2(size)); frame_info.texture_sampler_y_coord_scale = input_snapshot->texture->GetYCoordScale(); @@ -90,7 +90,7 @@ std::optional LinearToSrgbFilterContents::RenderFilter( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/filters/matrix_filter_contents.cc b/impeller/entity/contents/filters/matrix_filter_contents.cc index ee566d49b431a..6bce41f2acfc7 100644 --- a/impeller/entity/contents/filters/matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/matrix_filter_contents.cc @@ -41,7 +41,7 @@ std::optional MatrixFilterContents::RenderFilter( } // The filter's matrix needs to be applied within the space defined by the - // scene's current transformation matrix (CTM). For example: If the CTM is + // scene's current transform matrix (CTM). For example: If the CTM is // scaled up, then translations applied by the matrix should be magnified // accordingly. // @@ -57,7 +57,7 @@ std::optional MatrixFilterContents::RenderFilter( auto transform = rendering_mode_ == Entity::RenderingMode::kSubpass ? effect_transform - : entity.GetTransformation(); + : entity.GetTransform(); snapshot->transform = transform * // matrix_ * // transform.Invert() * // diff --git a/impeller/entity/contents/filters/morphology_filter_contents.cc b/impeller/entity/contents/filters/morphology_filter_contents.cc index 3816a4edc7b71..d9c871dbbfc11 100644 --- a/impeller/entity/contents/filters/morphology_filter_contents.cc +++ b/impeller/entity/contents/filters/morphology_filter_contents.cc @@ -92,7 +92,7 @@ std::optional DirectionalMorphologyFilterContents::RenderFilter( frame_info.texture_sampler_y_coord_scale = input_snapshot->texture->GetYCoordScale(); - auto transform = entity.GetTransformation() * effect_transform.Basis(); + auto transform = entity.GetTransform() * effect_transform.Basis(); auto transformed_radius = transform.TransformDirection(direction_ * radius_.radius); auto transformed_texture_vertices = diff --git a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc index 2d47c79cad31b..2da4cb00be0ae 100644 --- a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc +++ b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc @@ -69,7 +69,7 @@ std::optional SrgbToLinearFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation() * input_snapshot->transform * + entity.GetTransform() * input_snapshot->transform * Matrix::MakeScale(Vector2(size)); frame_info.texture_sampler_y_coord_scale = input_snapshot->texture->GetYCoordScale(); @@ -90,7 +90,7 @@ std::optional SrgbToLinearFilterContents::RenderFilter( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc index 00f37d0824261..53962ed9473ab 100644 --- a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc +++ b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc @@ -97,7 +97,7 @@ std::optional YUVToRGBFilterContents::RenderFilter( VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation() * y_input_snapshot->transform * + entity.GetTransform() * y_input_snapshot->transform * Matrix::MakeScale(Vector2(size)); frame_info.texture_sampler_y_coord_scale = y_input_snapshot->texture->GetYCoordScale(); @@ -125,7 +125,7 @@ std::optional YUVToRGBFilterContents::RenderFilter( CoverageProc coverage_proc = [coverage](const Entity& entity) -> std::optional { - return coverage.TransformBounds(entity.GetTransformation()); + return coverage.TransformBounds(entity.GetTransform()); }; auto contents = AnonymousContents::Make(render_proc, coverage_proc); diff --git a/impeller/entity/contents/linear_gradient_contents.cc b/impeller/entity/contents/linear_gradient_contents.cc index 79bb69609a26a..f1fc10d437dd8 100644 --- a/impeller/entity/contents/linear_gradient_contents.cc +++ b/impeller/entity/contents/linear_gradient_contents.cc @@ -152,7 +152,7 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); Command cmd; diff --git a/impeller/entity/contents/radial_gradient_contents.cc b/impeller/entity/contents/radial_gradient_contents.cc index 6a2a651414d58..a7020706f26e2 100644 --- a/impeller/entity/contents/radial_gradient_contents.cc +++ b/impeller/entity/contents/radial_gradient_contents.cc @@ -89,7 +89,7 @@ bool RadialGradientContents::RenderSSBO(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); Command cmd; diff --git a/impeller/entity/contents/scene_contents.cc b/impeller/entity/contents/scene_contents.cc index 1db3c385a32c9..f0fd7ca4f233d 100644 --- a/impeller/entity/contents/scene_contents.cc +++ b/impeller/entity/contents/scene_contents.cc @@ -98,7 +98,7 @@ bool SceneContents::Render(const ContentContext& renderer, contents.SetGeometry(GetGeometry()); contents.SetTexture(subpass_target.GetRenderTargetTexture()); contents.SetEffectTransform( - Matrix::MakeScale(1 / entity.GetTransformation().GetScale())); + Matrix::MakeScale(1 / entity.GetTransform().GetScale())); return contents.Render(renderer, entity, pass); } diff --git a/impeller/entity/contents/solid_color_contents.cc b/impeller/entity/contents/solid_color_contents.cc index 071e3f3e86c7b..3f83874cb2f5d 100644 --- a/impeller/entity/contents/solid_color_contents.cc +++ b/impeller/entity/contents/solid_color_contents.cc @@ -42,7 +42,7 @@ std::optional SolidColorContents::GetCoverage( if (geometry == nullptr) { return std::nullopt; } - return geometry->GetCoverage(entity.GetTransformation()); + return geometry->GetCoverage(entity.GetTransform()); }; bool SolidColorContents::Render(const ContentContext& renderer, @@ -98,7 +98,7 @@ std::optional SolidColorContents::AsBackgroundColor( const Entity& entity, ISize target_size) const { Rect target_rect = Rect::MakeSize(target_size); - return GetGeometry()->CoversArea(entity.GetTransformation(), target_rect) + return GetGeometry()->CoversArea(entity.GetTransform(), target_rect) ? GetColor() : std::optional(); } diff --git a/impeller/entity/contents/solid_rrect_blur_contents.cc b/impeller/entity/contents/solid_rrect_blur_contents.cc index e549856dc1857..e0ee614a2f20d 100644 --- a/impeller/entity/contents/solid_rrect_blur_contents.cc +++ b/impeller/entity/contents/solid_rrect_blur_contents.cc @@ -57,7 +57,7 @@ std::optional SolidRRectBlurContents::GetCoverage( auto ltrb = rect_->GetLTRB(); Rect bounds = Rect::MakeLTRB(ltrb[0] - radius, ltrb[1] - radius, ltrb[2] + radius, ltrb[3] + radius); - return bounds.TransformBounds(entity.GetTransformation()); + return bounds.TransformBounds(entity.GetTransform()); }; bool SolidRRectBlurContents::Render(const ContentContext& renderer, @@ -108,7 +108,7 @@ bool SolidRRectBlurContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation() * + entity.GetTransform() * Matrix::MakeTranslation({positive_rect.origin}); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); diff --git a/impeller/entity/contents/sweep_gradient_contents.cc b/impeller/entity/contents/sweep_gradient_contents.cc index 14701170f2f54..caa29efd4b36f 100644 --- a/impeller/entity/contents/sweep_gradient_contents.cc +++ b/impeller/entity/contents/sweep_gradient_contents.cc @@ -95,7 +95,7 @@ bool SweepGradientContents::RenderSSBO(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); + entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); Command cmd; diff --git a/impeller/entity/contents/text_contents.cc b/impeller/entity/contents/text_contents.cc index dbd3d89960539..579c0167fc33b 100644 --- a/impeller/entity/contents/text_contents.cc +++ b/impeller/entity/contents/text_contents.cc @@ -61,7 +61,7 @@ void TextContents::SetOffset(Vector2 offset) { } std::optional TextContents::GetCoverage(const Entity& entity) const { - return frame_->GetBounds().TransformBounds(entity.GetTransformation()); + return frame_->GetBounds().TransformBounds(entity.GetTransform()); } void TextContents::PopulateGlyphAtlas( @@ -111,8 +111,8 @@ bool TextContents::Render(const ContentContext& renderer, static_cast(atlas->GetTexture()->GetSize().height)}; frame_info.offset = offset_; frame_info.is_translation_scale = - entity.GetTransformation().IsTranslationScaleOnly(); - frame_info.entity_transform = entity.GetTransformation(); + entity.GetTransform().IsTranslationScaleOnly(); + frame_info.entity_transform = entity.GetTransform(); frame_info.text_color = ToVector(color.Premultiply()); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index 01f3d4df8d0d3..9b9614aaf04f0 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -71,7 +71,7 @@ std::optional TextureContents::GetCoverage(const Entity& entity) const { if (GetOpacity() == 0) { return std::nullopt; } - return destination_rect_.TransformBounds(entity.GetTransformation()); + return destination_rect_.TransformBounds(entity.GetTransform()); }; std::optional TextureContents::RenderToSnapshot( @@ -90,7 +90,7 @@ std::optional TextureContents::RenderToSnapshot( auto scale = Vector2(bounds.size / Size(texture_->GetSize())); return Snapshot{ .texture = texture_, - .transform = entity.GetTransformation() * + .transform = entity.GetTransform() * Matrix::MakeTranslation(bounds.origin) * Matrix::MakeScale(scale), .sampler_descriptor = sampler_descriptor.value_or(sampler_descriptor_), @@ -143,7 +143,7 @@ bool TextureContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - capture.AddMatrix("Transform", entity.GetTransformation()); + capture.AddMatrix("Transform", entity.GetTransform()); frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); frame_info.alpha = capture.AddScalar("Alpha", GetOpacity()); diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index 20b8d09618f94..fae8ed89b630b 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -19,7 +19,7 @@ VerticesContents::VerticesContents() = default; VerticesContents::~VerticesContents() = default; std::optional VerticesContents::GetCoverage(const Entity& entity) const { - return geometry_->GetCoverage(entity.GetTransformation()); + return geometry_->GetCoverage(entity.GetTransform()); }; void VerticesContents::SetGeometry(std::shared_ptr geometry) { diff --git a/impeller/entity/entity.cc b/impeller/entity/entity.cc index 5bd509263b55f..339eabb606bb2 100644 --- a/impeller/entity/entity.cc +++ b/impeller/entity/entity.cc @@ -37,7 +37,7 @@ std::optional Entity::FromSnapshot( Entity entity; entity.SetBlendMode(blend_mode); entity.SetClipDepth(clip_depth); - entity.SetTransformation(snapshot->transform); + entity.SetTransform(snapshot->transform); entity.SetContents(contents); return entity; } @@ -46,12 +46,12 @@ Entity::Entity() = default; Entity::~Entity() = default; -const Matrix& Entity::GetTransformation() const { - return transformation_; +const Matrix& Entity::GetTransform() const { + return transform_; } -void Entity::SetTransformation(const Matrix& transformation) { - transformation_ = transformation; +void Entity::SetTransform(const Matrix& transform) { + transform_ = transform; } std::optional Entity::GetCoverage() const { @@ -167,7 +167,7 @@ bool Entity::Render(const ContentContext& renderer, } Scalar Entity::DeriveTextScale() const { - return GetTransformation().GetMaxBasisLengthXY(); + return GetTransform().GetMaxBasisLengthXY(); } Capture& Entity::GetCapture() const { diff --git a/impeller/entity/entity.h b/impeller/entity/entity.h index 9c1d64747a0ac..43ee892a0a5bb 100644 --- a/impeller/entity/entity.h +++ b/impeller/entity/entity.h @@ -24,12 +24,12 @@ class Entity { enum class RenderingMode { /// In direct mode, the Entity's transform is used as the current - /// local-to-screen transformation matrix. + /// local-to-screen transform matrix. kDirect, /// In subpass mode, the Entity passed through the filter is in screen space /// rather than local space, and so some filters (namely, /// MatrixFilterContents) need to interpret the given EffectTransform as the - /// current transformation matrix. + /// current transform matrix. kSubpass, }; @@ -70,11 +70,11 @@ class Entity { ~Entity(); - /// @brief Get the global transformation matrix for this Entity. - const Matrix& GetTransformation() const; + /// @brief Get the global transform matrix for this Entity. + const Matrix& GetTransform() const; - /// @brief Set the global transformation matrix for this Entity. - void SetTransformation(const Matrix& transformation); + /// @brief Set the global transform matrix for this Entity. + void SetTransform(const Matrix& transform); std::optional GetCoverage() const; @@ -114,7 +114,7 @@ class Entity { void SetCapture(Capture capture) const; private: - Matrix transformation_; + Matrix transform_; std::shared_ptr contents_; BlendMode blend_mode_ = BlendMode::kSourceOver; uint32_t clip_depth_ = 0u; diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index 35a5a739ee89d..f938f560e55de 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -126,7 +126,7 @@ std::optional EntityPass::GetElementsCoverage( std::shared_ptr backdrop_filter = subpass.backdrop_filter_proc_( FilterInput::Make(accumulated_coverage.value()), - subpass.xformation_, Entity::RenderingMode::kSubpass); + subpass.transform_, Entity::RenderingMode::kSubpass); if (backdrop_filter) { auto backdrop_coverage = backdrop_filter->GetCoverage({}); unfiltered_coverage = @@ -151,10 +151,10 @@ std::optional EntityPass::GetElementsCoverage( // we could potentially detect this case as zero coverage in the future. std::shared_ptr image_filter = subpass.delegate_->WithImageFilter(*unfiltered_coverage, - subpass.xformation_); + subpass.transform_); if (image_filter) { Entity subpass_entity; - subpass_entity.SetTransformation(subpass.xformation_); + subpass_entity.SetTransform(subpass.transform_); element_coverage = image_filter->GetCoverage(subpass_entity); } else { element_coverage = unfiltered_coverage; @@ -174,13 +174,13 @@ std::optional EntityPass::GetSubpassCoverage( const EntityPass& subpass, std::optional coverage_limit) const { std::shared_ptr image_filter = - subpass.delegate_->WithImageFilter(Rect(), subpass.xformation_); + subpass.delegate_->WithImageFilter(Rect(), subpass.transform_); // If the subpass has an image filter, then its coverage space may deviate // from the parent pass and make intersecting with the pass coverage limit // unsafe. if (image_filter && coverage_limit.has_value()) { - coverage_limit = image_filter->GetSourceCoverage(subpass.xformation_, + coverage_limit = image_filter->GetSourceCoverage(subpass.transform_, coverage_limit.value()); } @@ -194,7 +194,7 @@ std::optional EntityPass::GetSubpassCoverage( return entities_coverage; } auto user_bounds_coverage = - subpass.bounds_limit_->TransformBounds(subpass.xformation_); + subpass.bounds_limit_->TransformBounds(subpass.transform_); return entities_coverage->Intersection(user_bounds_coverage); } @@ -487,9 +487,9 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( // If the pass image is going to be rendered with a non-zero position, // apply the negative translation to entity copies before rendering them // so that they'll end up rendering to the correct on-screen position. - element_entity.SetTransformation( + element_entity.SetTransform( Matrix::MakeTranslation(Vector3(-global_pass_position)) * - element_entity.GetTransformation()); + element_entity.GetTransform()); } return EntityPass::EntityResult::Success(element_entity); } @@ -535,7 +535,7 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( const auto& proc = subpass->backdrop_filter_proc_; subpass_backdrop_filter_contents = proc(FilterInput::Make(std::move(texture)), - subpass->xformation_.Basis(), Entity::RenderingMode::kSubpass); + subpass->transform_.Basis(), Entity::RenderingMode::kSubpass); // If the very first thing we render in this EntityPass is a subpass that // happens to have a backdrop filter, than that backdrop filter will end @@ -648,7 +648,7 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( subpass->delegate_->CreateContentsForSubpassTarget( subpass_texture, Matrix::MakeTranslation(Vector3{-global_pass_position}) * - subpass->xformation_); + subpass->transform_); if (!offscreen_texture_contents) { // This is an error because the subpass delegate said the pass couldn't @@ -667,7 +667,7 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( element_entity.SetContents(std::move(offscreen_texture_contents)); element_entity.SetClipDepth(subpass->clip_depth_); element_entity.SetBlendMode(subpass->blend_mode_); - element_entity.SetTransformation(subpass_texture_capture.AddMatrix( + element_entity.SetTransform(subpass_texture_capture.AddMatrix( "Transform", Matrix::MakeTranslation(Vector3(subpass_coverage->origin - global_pass_position)))); @@ -862,7 +862,7 @@ bool EntityPass::OnRender( Entity backdrop_entity; backdrop_entity.SetContents(std::move(backdrop_filter_contents)); - backdrop_entity.SetTransformation( + backdrop_entity.SetTransform( Matrix::MakeTranslation(Vector3(-local_pass_position))); backdrop_entity.SetClipDepth(clip_depth_floor); @@ -947,8 +947,7 @@ bool EntityPass::OnRender( } FilterInput::Vector inputs = { - FilterInput::Make(texture, - result.entity.GetTransformation().Invert()), + FilterInput::Make(texture, result.entity.GetTransform().Invert()), FilterInput::Make(result.entity.GetContents())}; auto contents = ColorFilterContents::MakeBlend( result.entity.GetBlendMode(), inputs); @@ -1109,8 +1108,8 @@ std::unique_ptr EntityPass::Clone() const { return pass; } -void EntityPass::SetTransformation(Matrix xformation) { - xformation_ = xformation; +void EntityPass::SetTransform(Matrix transform) { + transform_ = transform; } void EntityPass::SetClipDepth(size_t clip_depth) { diff --git a/impeller/entity/entity_pass.h b/impeller/entity/entity_pass.h index b44fa0cc57aa9..af169be276e48 100644 --- a/impeller/entity/entity_pass.h +++ b/impeller/entity/entity_pass.h @@ -126,7 +126,7 @@ class EntityPass { /// size_t GetElementCount() const; - void SetTransformation(Matrix xformation); + void SetTransform(Matrix transform); void SetClipDepth(size_t clip_depth); @@ -281,7 +281,7 @@ class EntityPass { std::vector elements_; EntityPass* superpass_ = nullptr; - Matrix xformation_; + Matrix transform_; size_t clip_depth_ = 0u; BlendMode blend_mode_ = BlendMode::kSourceOver; bool flood_clip_ = false; diff --git a/impeller/entity/entity_unittests.cc b/impeller/entity/entity_unittests.cc index b2aaee9ae2d84..15fa315807954 100644 --- a/impeller/entity/entity_unittests.cc +++ b/impeller/entity/entity_unittests.cc @@ -59,7 +59,7 @@ INSTANTIATE_PLAYGROUND_SUITE(EntityTest); TEST_P(EntityTest, CanCreateEntity) { Entity entity; - ASSERT_TRUE(entity.GetTransformation().IsIdentity()); + ASSERT_TRUE(entity.GetTransform().IsIdentity()); } class TestPassDelegate final : public EntityPassDelegate { @@ -146,7 +146,7 @@ TEST_P(EntityTest, EntityPassCanMergeSubpassIntoParent) { pass.AddSubpass(std::move(subpass)); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto contents = std::make_unique(); contents->SetGeometry(Geometry::MakeRect(Rect::MakeLTRB(100, 100, 200, 200))); contents->SetColor(Color::Blue()); @@ -218,7 +218,7 @@ TEST_P(EntityTest, CanDrawRect) { contents->SetColor(Color::Red()); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); entity.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(entity)); @@ -234,7 +234,7 @@ TEST_P(EntityTest, CanDrawRRect) { contents->SetColor(Color::Red()); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); entity.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(entity)); @@ -259,7 +259,7 @@ TEST_P(EntityTest, ThreeStrokesInOnePath) { .TakePath(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto contents = std::make_unique(); contents->SetGeometry(Geometry::MakeStrokePath(path, 5.0)); contents->SetColor(Color::Red()); @@ -279,7 +279,7 @@ TEST_P(EntityTest, StrokeWithTextureContents) { .TakePath(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto contents = std::make_unique(); contents->SetGeometry(Geometry::MakeStrokePath(path, 100.0)); contents->SetTexture(bridge); @@ -319,7 +319,7 @@ TEST_P(EntityTest, TriangleInsideASquare) { .TakePath(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto contents = std::make_unique(); contents->SetGeometry(Geometry::MakeStrokePath(path, 20.0)); contents->SetColor(Color::Red()); @@ -361,7 +361,7 @@ TEST_P(EntityTest, StrokeCapAndJoinTest) { contents->SetColor(Color::Red()); Entity entity; - entity.SetTransformation(world_matrix); + entity.SetTransform(world_matrix); entity.SetContents(std::move(contents)); auto coverage = entity.GetCoverage(); @@ -469,12 +469,12 @@ TEST_P(EntityTest, CubicCurveTest) { .Close() .TakePath(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); entity.SetContents(SolidColorContents::Make(path, Color::Red())); ASSERT_TRUE(OpenPlaygroundHere(entity)); } -TEST_P(EntityTest, CanDrawCorrectlyWithRotatedTransformation) { +TEST_P(EntityTest, CanDrawCorrectlyWithRotatedTransform) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { const char* input_axis[] = {"X", "Y", "Z"}; static int rotation_axis_index = 0; @@ -513,7 +513,7 @@ TEST_P(EntityTest, CanDrawCorrectlyWithRotatedTransformation) { PathBuilder{}.AddRect(Rect::MakeXYWH(-300, -400, 600, 800)).TakePath(); Entity entity; - entity.SetTransformation(result_transform); + entity.SetTransform(result_transform); entity.SetContents(SolidColorContents::Make(path, Color::Red())); return entity.Render(context, pass); }; @@ -743,7 +743,7 @@ TEST_P(EntityTest, CubicCurveAndOverlapTest) { .Close() .TakePath(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); entity.SetContents(SolidColorContents::Make(path, Color::Red())); ASSERT_TRUE(OpenPlaygroundHere(entity)); } @@ -927,7 +927,7 @@ TEST_P(EntityTest, BezierCircleScaled) { ImGui::End(); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto path = PathBuilder{} .MoveTo({97.325, 34.818}) .CubicCurveTo({98.50862885295136, 34.81812293973836}, @@ -944,7 +944,7 @@ TEST_P(EntityTest, BezierCircleScaled) { {97.32499434685802, 34.81799797758954}) .Close() .TakePath(); - entity.SetTransformation( + entity.SetTransform( Matrix::MakeScale({scale, scale, 1.0}).Translate({-90, -20, 0})); entity.SetContents(SolidColorContents::Make(path, Color::Red())); return entity.Render(context, pass); @@ -971,9 +971,9 @@ TEST_P(EntityTest, Filters) { {FilterInput::Make(blend0), fi_bridge, fi_bridge, fi_bridge}); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(blend1); return entity.Render(context, pass); }; @@ -1105,7 +1105,7 @@ TEST_P(EntityTest, GaussianBlurFilter) { Entity entity; entity.SetContents(target_contents); - entity.SetTransformation(ctm); + entity.SetTransform(ctm); entity.Render(context, pass); @@ -1114,7 +1114,7 @@ TEST_P(EntityTest, GaussianBlurFilter) { Entity cover_entity; cover_entity.SetContents(SolidColorContents::Make( PathBuilder{}.AddRect(input_rect).TakePath(), cover_color)); - cover_entity.SetTransformation(ctm); + cover_entity.SetTransform(ctm); cover_entity.Render(context, pass); @@ -1128,7 +1128,7 @@ TEST_P(EntityTest, GaussianBlurFilter) { .AddRect(target_contents->GetCoverage(entity).value()) .TakePath(), bounds_color)); - bounds_entity.SetTransformation(Matrix()); + bounds_entity.SetTransform(Matrix()); bounds_entity.Render(context, pass); } @@ -1211,7 +1211,7 @@ TEST_P(EntityTest, MorphologyFilter) { Entity entity; entity.SetContents(contents); - entity.SetTransformation(ctm); + entity.SetTransform(ctm); entity.Render(context, pass); @@ -1220,7 +1220,7 @@ TEST_P(EntityTest, MorphologyFilter) { Entity cover_entity; cover_entity.SetContents(SolidColorContents::Make( PathBuilder{}.AddRect(input_rect).TakePath(), cover_color)); - cover_entity.SetTransformation(ctm); + cover_entity.SetTransform(ctm); cover_entity.Render(context, pass); @@ -1229,7 +1229,7 @@ TEST_P(EntityTest, MorphologyFilter) { bounds_entity.SetContents(SolidColorContents::Make( PathBuilder{}.AddRect(contents->GetCoverage(entity).value()).TakePath(), bounds_color)); - bounds_entity.SetTransformation(Matrix()); + bounds_entity.SetTransform(Matrix()); bounds_entity.Render(context, pass); @@ -1314,7 +1314,7 @@ TEST_P(EntityTest, BorderMaskBlurCoverageIsCorrect) { { Entity e; - e.SetTransformation(Matrix()); + e.SetTransform(Matrix()); auto actual = border_mask_blur->GetCoverage(e); auto expected = Rect::MakeXYWH(-3, -4, 306, 408); ASSERT_TRUE(actual.has_value()); @@ -1323,7 +1323,7 @@ TEST_P(EntityTest, BorderMaskBlurCoverageIsCorrect) { { Entity e; - e.SetTransformation(Matrix::MakeRotationZ(Radians{kPi / 4})); + e.SetTransform(Matrix::MakeRotationZ(Radians{kPi / 4})); auto actual = border_mask_blur->GetCoverage(e); auto expected = Rect::MakeXYWH(-287.792, -4.94975, 504.874, 504.874); ASSERT_TRUE(actual.has_value()); @@ -1357,7 +1357,7 @@ TEST_P(EntityTest, DrawAtlasNoColor) { contents->SetBlendMode(BlendMode::kSource); Entity e; - e.SetTransformation(Matrix::MakeScale(GetContentScale())); + e.SetTransform(Matrix::MakeScale(GetContentScale())); e.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(e)); @@ -1392,7 +1392,7 @@ TEST_P(EntityTest, DrawAtlasWithColorAdvanced) { contents->SetBlendMode(BlendMode::kModulate); Entity e; - e.SetTransformation(Matrix::MakeScale(GetContentScale())); + e.SetTransform(Matrix::MakeScale(GetContentScale())); e.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(e)); @@ -1428,7 +1428,7 @@ TEST_P(EntityTest, DrawAtlasWithColorSimple) { contents->SetBlendMode(BlendMode::kSourceATop); Entity e; - e.SetTransformation(Matrix::MakeScale(GetContentScale())); + e.SetTransform(Matrix::MakeScale(GetContentScale())); e.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(e)); @@ -1460,7 +1460,7 @@ TEST_P(EntityTest, DrawAtlasUsesProvidedCullRectForCoverage) { auto transform = Matrix::MakeScale(GetContentScale()); Entity e; - e.SetTransformation(transform); + e.SetTransform(transform); e.SetContents(contents); ASSERT_EQ(contents->GetCoverage(e).value(), @@ -1501,7 +1501,7 @@ TEST_P(EntityTest, DrawAtlasWithOpacity) { contents->SetAlpha(0.5); Entity e; - e.SetTransformation(Matrix::MakeScale(GetContentScale())); + e.SetTransform(Matrix::MakeScale(GetContentScale())); e.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(e)); @@ -1521,7 +1521,7 @@ TEST_P(EntityTest, DrawAtlasNoColorFullSize) { contents->SetBlendMode(BlendMode::kSource); Entity e; - e.SetTransformation(Matrix::MakeScale(GetContentScale())); + e.SetTransform(Matrix::MakeScale(GetContentScale())); e.SetContents(contents); ASSERT_TRUE(OpenPlaygroundHere(e)); @@ -1549,7 +1549,7 @@ TEST_P(EntityTest, SolidFillCoverageIsCorrect) { PathBuilder{}.AddRect(Rect::MakeLTRB(100, 110, 200, 220)).TakePath())); Entity entity; - entity.SetTransformation(Matrix::MakeTranslation(Vector2(4, 5))); + entity.SetTransform(Matrix::MakeTranslation(Vector2(4, 5))); entity.SetContents(std::move(fill)); auto coverage = entity.GetCoverage(); @@ -1716,7 +1716,7 @@ TEST_P(EntityTest, RRectShadowTest) { contents->SetSigma(Radius(blur_radius)); Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); entity.SetContents(std::move(contents)); entity.Render(context, pass); @@ -1755,7 +1755,7 @@ TEST_P(EntityTest, ColorMatrixFilterCoverageIsCorrect) { ColorFilterContents::MakeColorMatrix(FilterInput::Make(fill), matrix); Entity e; - e.SetTransformation(Matrix()); + e.SetTransform(Matrix()); // Confirm that the actual filter coverage matches the expected coverage. auto actual = filter->GetCoverage(e); @@ -1807,7 +1807,7 @@ TEST_P(EntityTest, ColorMatrixFilterEditable) { // Define the entity with the color matrix filter. Entity entity; - entity.SetTransformation( + entity.SetTransform( Matrix::MakeScale(GetContentScale()) * Matrix::MakeTranslation(Vector3(offset[0], offset[1])) * Matrix::MakeRotationZ(Radians(rotation)) * @@ -1834,7 +1834,7 @@ TEST_P(EntityTest, LinearToSrgbFilterCoverageIsCorrect) { ColorFilterContents::MakeLinearToSrgbFilter(FilterInput::Make(fill)); Entity e; - e.SetTransformation(Matrix()); + e.SetTransform(Matrix()); // Confirm that the actual filter coverage matches the expected coverage. auto actual = filter->GetCoverage(e); @@ -1855,18 +1855,18 @@ TEST_P(EntityTest, LinearToSrgbFilter) { // Define the entity that will serve as the control image as a Gaussian blur // filter with no filter at all. Entity entity_left; - entity_left.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({100, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity_left.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({100, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); auto unfiltered = FilterContents::MakeGaussianBlur(FilterInput::Make(image), Sigma{0}, Sigma{0}); entity_left.SetContents(unfiltered); // Define the entity that will be filtered from linear to sRGB. Entity entity_right; - entity_right.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity_right.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity_right.SetContents(filtered); return entity_left.Render(context, pass) && entity_right.Render(context, pass); @@ -1886,7 +1886,7 @@ TEST_P(EntityTest, SrgbToLinearFilterCoverageIsCorrect) { ColorFilterContents::MakeSrgbToLinearFilter(FilterInput::Make(fill)); Entity e; - e.SetTransformation(Matrix()); + e.SetTransform(Matrix()); // Confirm that the actual filter coverage matches the expected coverage. auto actual = filter->GetCoverage(e); @@ -1907,18 +1907,18 @@ TEST_P(EntityTest, SrgbToLinearFilter) { // Define the entity that will serve as the control image as a Gaussian blur // filter with no filter at all. Entity entity_left; - entity_left.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({100, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity_left.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({100, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); auto unfiltered = FilterContents::MakeGaussianBlur(FilterInput::Make(image), Sigma{0}, Sigma{0}); entity_left.SetContents(unfiltered); // Define the entity that will be filtered from sRGB to linear. Entity entity_right; - entity_right.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity_right.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity_right.SetContents(filtered); return entity_left.Render(context, pass) && entity_right.Render(context, pass); @@ -2082,7 +2082,7 @@ TEST_P(EntityTest, YUVToRGBFilter) { contents->SetTexture(snapshot->texture); contents->SetSourceRect(Rect::MakeSize(snapshot->texture->GetSize())); entity.SetContents(contents); - entity.SetTransformation( + entity.SetTransform( Matrix::MakeTranslation({static_cast(100 + 400 * i), 300})); entity.Render(context, pass); } @@ -2210,9 +2210,9 @@ TEST_P(EntityTest, ColorFilterWithForegroundColorAdvancedBlend) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(filter); return entity.Render(context, pass); }; @@ -2226,9 +2226,9 @@ TEST_P(EntityTest, ColorFilterWithForegroundColorClearBlend) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(filter); return entity.Render(context, pass); }; @@ -2242,9 +2242,9 @@ TEST_P(EntityTest, ColorFilterWithForegroundColorSrcBlend) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(filter); return entity.Render(context, pass); }; @@ -2258,9 +2258,9 @@ TEST_P(EntityTest, ColorFilterWithForegroundColorDstBlend) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(filter); return entity.Render(context, pass); }; @@ -2274,9 +2274,9 @@ TEST_P(EntityTest, ColorFilterWithForegroundColorSrcInBlend) { auto callback = [&](ContentContext& context, RenderPass& pass) -> bool { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale()) * - Matrix::MakeTranslation({500, 300}) * - Matrix::MakeScale(Vector2{0.5, 0.5})); + entity.SetTransform(Matrix::MakeScale(GetContentScale()) * + Matrix::MakeTranslation({500, 300}) * + Matrix::MakeScale(Vector2{0.5, 0.5})); entity.SetContents(filter); return entity.Render(context, pass); }; @@ -2386,7 +2386,7 @@ TEST_P(EntityTest, PointFieldGeometryCoverage) { TEST_P(EntityTest, ColorFilterContentsWithLargeGeometry) { Entity entity; - entity.SetTransformation(Matrix::MakeScale(GetContentScale())); + entity.SetTransform(Matrix::MakeScale(GetContentScale())); auto src_contents = std::make_shared(); src_contents->SetGeometry( Geometry::MakeRect(Rect::MakeLTRB(-300, -500, 30000, 50000))); @@ -2445,7 +2445,7 @@ TEST_P(EntityTest, AdvancedBlendCoverageHintIsNotResetByEntityPass) { contents->SetColor(Color::Red()); Entity entity; - entity.SetTransformation(Matrix::MakeScale(Vector3(2, 2, 1))); + entity.SetTransform(Matrix::MakeScale(Vector3(2, 2, 1))); entity.SetBlendMode(BlendMode::kColorBurn); entity.SetContents(contents); diff --git a/impeller/entity/geometry/cover_geometry.cc b/impeller/entity/geometry/cover_geometry.cc index cc7793a0ec40b..c534764b4055e 100644 --- a/impeller/entity/geometry/cover_geometry.cc +++ b/impeller/entity/geometry/cover_geometry.cc @@ -23,7 +23,7 @@ GeometryResult CoverGeometry::GetPositionBuffer(const ContentContext& renderer, .vertex_buffer = { .vertex_buffer = host_buffer.Emplace( - rect.GetTransformedPoints(entity.GetTransformation().Invert()) + rect.GetTransformedPoints(entity.GetTransform().Invert()) .data(), 8 * sizeof(float), alignof(float)), .index_buffer = host_buffer.Emplace( @@ -32,7 +32,7 @@ GeometryResult CoverGeometry::GetPositionBuffer(const ContentContext& renderer, .index_type = IndexType::k16bit, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/fill_path_geometry.cc b/impeller/entity/geometry/fill_path_geometry.cc index 1e721cc645e30..c856811710b4b 100644 --- a/impeller/entity/geometry/fill_path_geometry.cc +++ b/impeller/entity/geometry/fill_path_geometry.cc @@ -23,7 +23,7 @@ GeometryResult FillPathGeometry::GetPositionBuffer( if (path_.GetFillType() == FillType::kNonZero && // path_.IsConvex()) { auto points = renderer.GetTessellator()->TessellateConvex( - path_, entity.GetTransformation().GetMaxBasisLength()); + path_, entity.GetTransform().GetMaxBasisLength()); vertex_buffer.vertex_buffer = host_buffer.Emplace( points.data(), points.size() * sizeof(Point), alignof(Point)); @@ -34,13 +34,13 @@ GeometryResult FillPathGeometry::GetPositionBuffer( .type = PrimitiveType::kTriangleStrip, .vertex_buffer = vertex_buffer, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } auto tesselation_result = renderer.GetTessellator()->Tessellate( - path_, entity.GetTransformation().GetMaxBasisLength(), + path_, entity.GetTransform().GetMaxBasisLength(), [&vertex_buffer, &host_buffer]( const float* vertices, size_t vertices_count, const uint16_t* indices, size_t indices_count) { @@ -65,7 +65,7 @@ GeometryResult FillPathGeometry::GetPositionBuffer( .type = PrimitiveType::kTriangle, .vertex_buffer = vertex_buffer, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -85,7 +85,7 @@ GeometryResult FillPathGeometry::GetPositionUVBuffer( if (path_.GetFillType() == FillType::kNonZero && // path_.IsConvex()) { auto points = renderer.GetTessellator()->TessellateConvex( - path_, entity.GetTransformation().GetMaxBasisLength()); + path_, entity.GetTransform().GetMaxBasisLength()); VertexBufferBuilder vertex_builder; vertex_builder.Reserve(points.size()); @@ -101,14 +101,14 @@ GeometryResult FillPathGeometry::GetPositionUVBuffer( .vertex_buffer = vertex_builder.CreateVertexBuffer(pass.GetTransientsBuffer()), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } VertexBufferBuilder vertex_builder; auto tesselation_result = renderer.GetTessellator()->Tessellate( - path_, entity.GetTransformation().GetMaxBasisLength(), + path_, entity.GetTransform().GetMaxBasisLength(), [&vertex_builder, &uv_transform]( const float* vertices, size_t vertices_count, const uint16_t* indices, size_t indices_count) { @@ -135,7 +135,7 @@ GeometryResult FillPathGeometry::GetPositionUVBuffer( .vertex_buffer = vertex_builder.CreateVertexBuffer(pass.GetTransientsBuffer()), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/geometry.cc b/impeller/entity/geometry/geometry.cc index 250022dd6384e..06024c17c1a3a 100644 --- a/impeller/entity/geometry/geometry.cc +++ b/impeller/entity/geometry/geometry.cc @@ -64,7 +64,7 @@ GeometryResult ComputeUVGeometryForRect(Rect source_rect, .index_type = IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/line_geometry.cc b/impeller/entity/geometry/line_geometry.cc index c7984eb7aab7a..6cb8bff98d41f 100644 --- a/impeller/entity/geometry/line_geometry.cc +++ b/impeller/entity/geometry/line_geometry.cc @@ -59,8 +59,7 @@ GeometryResult LineGeometry::GetPositionBuffer(const ContentContext& renderer, auto& host_buffer = pass.GetTransientsBuffer(); Point corners[4]; - if (!ComputeCorners(corners, entity.GetTransformation(), - cap_ == Cap::kSquare)) { + if (!ComputeCorners(corners, entity.GetTransform(), cap_ == Cap::kSquare)) { return {}; } @@ -74,7 +73,7 @@ GeometryResult LineGeometry::GetPositionBuffer(const ContentContext& renderer, .index_type = IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -90,8 +89,7 @@ GeometryResult LineGeometry::GetPositionUVBuffer(Rect texture_coverage, auto uv_transform = texture_coverage.GetNormalizingTransform() * effect_transform; Point corners[4]; - if (!ComputeCorners(corners, entity.GetTransformation(), - cap_ == Cap::kSquare)) { + if (!ComputeCorners(corners, entity.GetTransform(), cap_ == Cap::kSquare)) { return {}; } @@ -111,7 +109,7 @@ GeometryResult LineGeometry::GetPositionUVBuffer(Rect texture_coverage, .index_type = IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/point_field_geometry.cc b/impeller/entity/geometry/point_field_geometry.cc index 9821bad91ad7b..ab608f3745e6a 100644 --- a/impeller/entity/geometry/point_field_geometry.cc +++ b/impeller/entity/geometry/point_field_geometry.cc @@ -33,7 +33,7 @@ GeometryResult PointFieldGeometry::GetPositionBuffer( .type = PrimitiveType::kTriangle, .vertex_buffer = vtx_builder->CreateVertexBuffer(host_buffer), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -61,7 +61,7 @@ GeometryResult PointFieldGeometry::GetPositionUVBuffer( .type = PrimitiveType::kTriangle, .vertex_buffer = uv_vtx_builder.CreateVertexBuffer(host_buffer), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -73,7 +73,7 @@ PointFieldGeometry::GetPositionBufferCPU(const ContentContext& renderer, if (radius_ < 0.0) { return std::nullopt; } - auto determinant = entity.GetTransformation().GetDeterminant(); + auto determinant = entity.GetTransform().GetDeterminant(); if (determinant == 0) { return std::nullopt; } @@ -82,7 +82,7 @@ PointFieldGeometry::GetPositionBufferCPU(const ContentContext& renderer, Scalar radius = std::max(radius_, min_size); auto vertices_per_geom = ComputeCircleDivisions( - entity.GetTransformation().GetMaxBasisLength() * radius, round_); + entity.GetTransform().GetMaxBasisLength() * radius, round_); auto points_per_circle = 3 + (vertices_per_geom - 3) * 3; auto total = points_per_circle * points_.size(); auto radian_start = round_ ? 0.0f : 0.785398f; @@ -132,7 +132,7 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU( if (radius_ < 0.0) { return {}; } - auto determinant = entity.GetTransformation().GetDeterminant(); + auto determinant = entity.GetTransform().GetDeterminant(); if (determinant == 0) { return {}; } @@ -141,7 +141,7 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU( Scalar radius = std::max(radius_, min_size); auto vertices_per_geom = ComputeCircleDivisions( - entity.GetTransformation().GetMaxBasisLength() * radius, round_); + entity.GetTransform().GetMaxBasisLength() * radius, round_); auto points_per_circle = 3 + (vertices_per_geom - 3) * 3; auto total = points_per_circle * points_.size(); @@ -233,7 +233,7 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU( .vertex_count = total, .index_type = IndexType::kNone}, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/rect_geometry.cc b/impeller/entity/geometry/rect_geometry.cc index 7ea0476699876..e9ba651154412 100644 --- a/impeller/entity/geometry/rect_geometry.cc +++ b/impeller/entity/geometry/rect_geometry.cc @@ -24,7 +24,7 @@ GeometryResult RectGeometry::GetPositionBuffer(const ContentContext& renderer, .index_type = IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/entity/geometry/stroke_path_geometry.cc b/impeller/entity/geometry/stroke_path_geometry.cc index 48eebb6a9286a..7ea3218cbecff 100644 --- a/impeller/entity/geometry/stroke_path_geometry.cc +++ b/impeller/entity/geometry/stroke_path_geometry.cc @@ -443,7 +443,7 @@ GeometryResult StrokePathGeometry::GetPositionBuffer( if (stroke_width_ < 0.0) { return {}; } - auto determinant = entity.GetTransformation().GetDeterminant(); + auto determinant = entity.GetTransform().GetDeterminant(); if (determinant == 0) { return {}; } @@ -455,13 +455,13 @@ GeometryResult StrokePathGeometry::GetPositionBuffer( auto vertex_builder = CreateSolidStrokeVertices( path_, stroke_width, miter_limit_ * stroke_width_ * 0.5, GetJoinProc(stroke_join_), GetCapProc(stroke_cap_), - entity.GetTransformation().GetMaxBasisLength()); + entity.GetTransform().GetMaxBasisLength()); return GeometryResult{ .type = PrimitiveType::kTriangleStrip, .vertex_buffer = vertex_builder.CreateVertexBuffer(host_buffer), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = true, }; } @@ -475,7 +475,7 @@ GeometryResult StrokePathGeometry::GetPositionUVBuffer( if (stroke_width_ < 0.0) { return {}; } - auto determinant = entity.GetTransformation().GetDeterminant(); + auto determinant = entity.GetTransform().GetDeterminant(); if (determinant == 0) { return {}; } @@ -487,7 +487,7 @@ GeometryResult StrokePathGeometry::GetPositionUVBuffer( auto stroke_builder = CreateSolidStrokeVertices( path_, stroke_width, miter_limit_ * stroke_width_ * 0.5, GetJoinProc(stroke_join_), GetCapProc(stroke_cap_), - entity.GetTransformation().GetMaxBasisLength()); + entity.GetTransform().GetMaxBasisLength()); auto vertex_builder = ComputeUVGeometryCPU( stroke_builder, {0, 0}, texture_coverage.size, effect_transform); @@ -495,7 +495,7 @@ GeometryResult StrokePathGeometry::GetPositionUVBuffer( .type = PrimitiveType::kTriangleStrip, .vertex_buffer = vertex_builder.CreateVertexBuffer(host_buffer), .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = true, }; } diff --git a/impeller/entity/geometry/vertices_geometry.cc b/impeller/entity/geometry/vertices_geometry.cc index 42af1e49c0a46..b0c29253e63d2 100644 --- a/impeller/entity/geometry/vertices_geometry.cc +++ b/impeller/entity/geometry/vertices_geometry.cc @@ -153,7 +153,7 @@ GeometryResult VerticesGeometry::GetPositionBuffer( index_count > 0 ? IndexType::k16bit : IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -212,7 +212,7 @@ GeometryResult VerticesGeometry::GetPositionColorBuffer( index_count > 0 ? IndexType::k16bit : IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } @@ -283,7 +283,7 @@ GeometryResult VerticesGeometry::GetPositionUVBuffer( index_count > 0 ? IndexType::k16bit : IndexType::kNone, }, .transform = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(), + entity.GetTransform(), .prevent_overdraw = false, }; } diff --git a/impeller/geometry/rect_unittests.cc b/impeller/geometry/rect_unittests.cc index 1d52802cf996c..3cdc4fb4a0f64 100644 --- a/impeller/geometry/rect_unittests.cc +++ b/impeller/geometry/rect_unittests.cc @@ -67,7 +67,7 @@ TEST(RectTest, RectGetNormalizingTransform) { } { - // Checks for expected transformation of points relative to the rect + // Checks for expected transform of points relative to the rect auto r = Rect::MakeLTRB(300, 500, 400, 700); auto m = r.GetNormalizingTransform(); @@ -155,7 +155,7 @@ TEST(RectTest, IRectGetNormalizingTransform) { } { - // Checks for expected transformation of points relative to the rect + // Checks for expected transform of points relative to the rect auto r = IRect::MakeLTRB(300, 500, 400, 700); auto m = r.GetNormalizingTransform();