From 5afc2d547bc769214a714fbdbb0894b554d17077 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 5 May 2021 21:31:20 -0700 Subject: [PATCH] Patch namespace. --- .../flutter/impeller/impeller/entity/Color.cc | 12 ++--- .../flutter/impeller/impeller/entity/Color.h | 10 ++-- .../impeller/impeller/entity/Entity.cc | 51 +++++++++---------- .../flutter/impeller/impeller/entity/Entity.h | 42 ++++++++------- .../impeller/impeller/geometry/Matrix.cc | 6 +-- .../impeller/impeller/geometry/Matrix.h | 6 +-- .../impeller/impeller/geometry/Path.cc | 6 +-- .../flutter/impeller/impeller/geometry/Path.h | 7 ++- .../impeller/impeller/geometry/PathBuilder.cc | 6 +-- .../impeller/impeller/geometry/PathBuilder.h | 17 +++---- .../impeller/geometry/PathComponent.cc | 6 +-- .../impeller/geometry/PathComponent.h | 6 +-- .../impeller/impeller/geometry/Point.cc | 6 +-- .../impeller/impeller/geometry/Point.h | 6 +-- .../impeller/impeller/geometry/Quaternion.cc | 6 +-- .../impeller/impeller/geometry/Quaternion.h | 6 +-- .../impeller/impeller/geometry/Rect.cc | 6 +-- .../flutter/impeller/impeller/geometry/Rect.h | 6 +-- .../impeller/impeller/geometry/Shear.cc | 6 +-- .../impeller/impeller/geometry/Shear.h | 6 +-- .../impeller/impeller/geometry/Size.cc | 6 +-- .../flutter/impeller/impeller/geometry/Size.h | 6 +-- .../impeller/impeller/geometry/Vector.cc | 6 +-- .../impeller/impeller/geometry/Vector.h | 6 +-- .../flutter/impeller/impeller/image/Image.cc | 13 ++--- .../flutter/impeller/impeller/image/Image.h | 6 +-- .../impeller/impeller/image/ImageResult.cc | 10 ++-- .../impeller/impeller/image/ImageResult.h | 12 ++--- 28 files changed, 115 insertions(+), 173 deletions(-) diff --git a/engine/src/flutter/impeller/impeller/entity/Color.cc b/engine/src/flutter/impeller/impeller/entity/Color.cc index 175a327a306..ebc908ae0d7 100644 --- a/engine/src/flutter/impeller/impeller/entity/Color.cc +++ b/engine/src/flutter/impeller/impeller/entity/Color.cc @@ -7,8 +7,7 @@ #include #include -namespace rl { -namespace entity { +namespace impeller { ColorHSB ColorHSB::FromRGB(Color rgb) { double R = rgb.red; @@ -37,7 +36,7 @@ ColorHSB ColorHSB::FromRGB(Color rgb) { return ColorHSB(((i - f / (v - x)) / 6.0), (v - x) / v, v, rgb.alpha); } -Color ColorHSB::toRGBA() const { +Color ColorHSB::ToRGBA() const { double h = hue * 6.0; double s = saturation; double v = brightness; @@ -85,14 +84,14 @@ Color ColorHSB::toRGBA() const { return Color(0, 0, 0, alpha); } -std::string ColorHSB::toString() const { +std::string ColorHSB::ToString() const { std::stringstream stream; stream << "{" << hue << ", " << saturation << ", " << brightness << ", " << alpha << "}"; return stream.str(); } -Color::Color(const ColorHSB& hsbColor) : Color(hsbColor.toRGBA()) {} +Color::Color(const ColorHSB& hsbColor) : Color(hsbColor.ToRGBA()) {} std::string Color::ToString() const { std::stringstream stream; @@ -111,5 +110,4 @@ void Color::FromString(const std::string& str) { stream >> alpha; } -} // namespace entity -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/entity/Color.h b/engine/src/flutter/impeller/impeller/entity/Color.h index ab53f60f151..1d7372feb08 100644 --- a/engine/src/flutter/impeller/impeller/entity/Color.h +++ b/engine/src/flutter/impeller/impeller/entity/Color.h @@ -7,8 +7,7 @@ #include #include -namespace rl { -namespace entity { +namespace impeller { struct ColorHSB; @@ -662,10 +661,9 @@ struct ColorHSB { static ColorHSB FromRGB(Color rgb); - Color toRGBA() const; + Color ToRGBA() const; - std::string toString() const; + std::string ToString() const; }; -} // namespace entity -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/entity/Entity.cc b/engine/src/flutter/impeller/impeller/entity/Entity.cc index bebb9157873..968f178ac7f 100644 --- a/engine/src/flutter/impeller/impeller/entity/Entity.cc +++ b/engine/src/flutter/impeller/impeller/entity/Entity.cc @@ -4,65 +4,63 @@ #include "Entity.h" -namespace rl { -namespace entity { +namespace impeller { Entity::Entity() = default; Entity::~Entity() = default; -geom::Rect Entity::GetFrame() const { - geom::Point origin(position_.x - (bounds_.size.width * anchor_point_.x), - position_.y - (bounds_.size.height * anchor_point_.y)); +Rect Entity::GetFrame() const { + Point origin(position_.x - (bounds_.size.width * anchor_point_.x), + position_.y - (bounds_.size.height * anchor_point_.y)); - return geom::Rect(origin, bounds_.size); + return Rect(origin, bounds_.size); } -void Entity::SetFrame(const geom::Rect& frame) { - SetBounds(geom::Rect(bounds_.origin, frame.size)); - SetPosition( - geom::Point(frame.origin.x + (anchor_point_.x * frame.size.width), - frame.origin.y + (anchor_point_.y * frame.size.height))); +void Entity::SetFrame(const Rect& frame) { + SetBounds(Rect(bounds_.origin, frame.size)); + SetPosition(Point(frame.origin.x + (anchor_point_.x * frame.size.width), + frame.origin.y + (anchor_point_.y * frame.size.height))); } -const geom::Rect& Entity::GetBounds() const { +const Rect& Entity::GetBounds() const { return bounds_; } -void Entity::SetBounds(const geom::Rect& bounds) { +void Entity::SetBounds(const Rect& bounds) { bounds_ = bounds; } -const geom::Point& Entity::GetPosition() const { +const Point& Entity::GetPosition() const { return position_; } -void Entity::SetPosition(const geom::Point& position) { +void Entity::SetPosition(const Point& position) { position_ = position; } -const geom::Point& Entity::GetAnchorPoint() const { +const Point& Entity::GetAnchorPoint() const { return anchor_point_; } -void Entity::SetAnchorPoint(const geom::Point& anchorPoint) { +void Entity::SetAnchorPoint(const Point& anchorPoint) { anchor_point_ = anchorPoint; } -const geom::Matrix& Entity::GetTransformation() const { +const Matrix& Entity::GetTransformation() const { return transformation_; } -void Entity::SetTransformation(const geom::Matrix& transformation) { +void Entity::SetTransformation(const Matrix& transformation) { transformation_ = transformation; } -geom::Matrix Entity::GetModelMatrix() const { +Matrix Entity::GetModelMatrix() const { /* * The translation accounts for the offset in the origin of the bounds * of the entity and its position about its anchor point. */ - auto translation = geom::Matrix::MakeTranslation( + auto translation = Matrix::MakeTranslation( {-bounds_.origin.x + position_.x - (bounds_.size.width * anchor_point_.x), -bounds_.origin.y + position_.y - (bounds_.size.height * anchor_point_.y)}); @@ -78,8 +76,8 @@ geom::Matrix Entity::GetModelMatrix() const { } auto anchorAdjustment = - geom::Matrix::MakeTranslation({-anchor_point_.x * bounds_.size.width, - -anchor_point_.y * bounds_.size.height}); + Matrix::MakeTranslation({-anchor_point_.x * bounds_.size.width, + -anchor_point_.y * bounds_.size.height}); return translation * anchorAdjustment.Invert() * transformation_ * anchorAdjustment; @@ -117,13 +115,12 @@ void Entity::SetStrokeSize(double strokeSize) { stroke_size_ = strokeSize; } -const geom::Path& Entity::GetPath() const { +const Path& Entity::GetPath() const { return path_; } -void Entity::SetPath(geom::Path path) { +void Entity::SetPath(Path path) { path_ = std::move(path); } -} // namespace entity -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/entity/Entity.h b/engine/src/flutter/impeller/impeller/entity/Entity.h index 4df2150a24f..0eb64a429f7 100644 --- a/engine/src/flutter/impeller/impeller/entity/Entity.h +++ b/engine/src/flutter/impeller/impeller/entity/Entity.h @@ -10,8 +10,7 @@ #include "Path.h" #include "Rect.h" -namespace rl { -namespace entity { +namespace impeller { class Entity { public: @@ -26,14 +25,14 @@ class Entity { * * @return the frame of the entity */ - geom::Rect GetFrame() const; + Rect GetFrame() const; /** * Set the frame of the entity * * @param frame the new frame */ - void SetFrame(const geom::Rect& frame); + void SetFrame(const Rect& frame); /** * The bounds specifies the origin and size of the entity in its own @@ -41,14 +40,14 @@ class Entity { * * @return the bounds of the entity */ - const geom::Rect& GetBounds() const; + const Rect& GetBounds() const; /** * Set the bounds of the entity * * @param bounds the new bounds */ - void SetBounds(const geom::Rect& bounds); + void SetBounds(const Rect& bounds); /** * The position specifies the coordinates of the anchor position of the @@ -56,49 +55,49 @@ class Entity { * * @return the position of the entity */ - const geom::Point& GetPosition() const; + const Point& GetPosition() const; /** * Sets the position of the entity * * @param point the new position */ - void SetPosition(const geom::Point& point); + void SetPosition(const Point& point); /** * The position of the anchor point within this node in unit space * * @return the anchor point */ - const geom::Point& GetAnchorPoint() const; + const Point& GetAnchorPoint() const; /** * Sets the new anchor point of this node * * @param anchorPoint the new anchor point */ - void SetAnchorPoint(const geom::Point& anchorPoint); + void SetAnchorPoint(const Point& anchorPoint); /** * The transformation that is applied to the entity about its anchor point * * @return the transformation applied to the node */ - const geom::Matrix& GetTransformation() const; + const Matrix& GetTransformation() const; /** * Sets the transformation of the entity * * @param transformation the new transformation */ - void SetTransformation(const geom::Matrix& transformation); + void SetTransformation(const Matrix& transformation); /** * The model matrix of the entity * * @return the view matrix */ - geom::Matrix GetModelMatrix() const; + Matrix GetModelMatrix() const; /** * The background color of the entity @@ -137,18 +136,18 @@ class Entity { void SetStrokeSize(double strokeSize); - const geom::Path& GetPath() const; + const Path& GetPath() const; - void SetPath(geom::Path path); + void SetPath(Path path); private: - geom::Rect bounds_; - geom::Point position_; - geom::Point anchor_point_ = {0.5, 0.5}; - geom::Matrix transformation_; + Rect bounds_; + Point position_; + Point anchor_point_ = {0.5, 0.5}; + Matrix transformation_; Color background_color_; - geom::Path path_; + Path path_; double opacity_ = 1.0; Color stroke_color_ = Color::Black(); double stroke_size_ = 1.0; @@ -156,5 +155,4 @@ class Entity { FML_DISALLOW_COPY_AND_ASSIGN(Entity); }; -} // namespace entity -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Matrix.cc b/engine/src/flutter/impeller/impeller/geometry/Matrix.cc index 95294b77f67..648b9ce40af 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Matrix.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Matrix.cc @@ -6,8 +6,7 @@ #include #include -namespace rl { -namespace geom { +namespace impeller { Matrix::Matrix(const Decomposition& d) : Matrix() { /* @@ -480,5 +479,4 @@ std::string Matrix::Decomposition::ToString() const { return stream.str(); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Matrix.h b/engine/src/flutter/impeller/impeller/geometry/Matrix.h index 8fb236373b5..c2a7869ffe7 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Matrix.h +++ b/engine/src/flutter/impeller/impeller/geometry/Matrix.h @@ -13,8 +13,7 @@ #include "Size.h" #include "Vector.h" -namespace rl { -namespace geom { +namespace impeller { struct Matrix { union { @@ -295,5 +294,4 @@ inline Vector4 operator*(const Vector4& v, const Matrix& m) { v.x * m.m[3] + v.y * m.m[7] + v.z * m.m[11] + v.w * m.m[15]); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Path.cc b/engine/src/flutter/impeller/impeller/geometry/Path.cc index f5ac80ecd6a..750435311d8 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Path.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Path.cc @@ -4,8 +4,7 @@ #include "Path.h" -namespace rl { -namespace geom { +namespace impeller { Path::Path() = default; @@ -191,5 +190,4 @@ Rect Path::GetBoundingBox() const { return box; } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Path.h b/engine/src/flutter/impeller/impeller/geometry/Path.h index 66839563af1..1c25776bb17 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Path.h +++ b/engine/src/flutter/impeller/impeller/geometry/Path.h @@ -6,10 +6,10 @@ #include #include + #include "PathComponent.h" -namespace rl { -namespace geom { +namespace impeller { class Path { public: @@ -76,5 +76,4 @@ class Path { std::vector cubics_; }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/PathBuilder.cc b/engine/src/flutter/impeller/impeller/geometry/PathBuilder.cc index f2ad2a9890a..8c429478ca5 100644 --- a/engine/src/flutter/impeller/impeller/geometry/PathBuilder.cc +++ b/engine/src/flutter/impeller/impeller/geometry/PathBuilder.cc @@ -4,8 +4,7 @@ #include "PathBuilder.h" -namespace rl { -namespace geom { +namespace impeller { static const double kArcApproximationMagic = 0.551915024494; @@ -323,5 +322,4 @@ PathBuilder& PathBuilder::AddEllipse(const Point& center, const Size& radius) { return *this; } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/PathBuilder.h b/engine/src/flutter/impeller/impeller/geometry/PathBuilder.h index 504a6d52759..9ae4929ee32 100644 --- a/engine/src/flutter/impeller/impeller/geometry/PathBuilder.h +++ b/engine/src/flutter/impeller/impeller/geometry/PathBuilder.h @@ -8,8 +8,7 @@ #include "Rect.h" #include "flutter/fml/macros.h" -namespace rl { -namespace geom { +namespace impeller { class PathBuilder { public: @@ -53,13 +52,12 @@ class PathBuilder { PathBuilder& AddEllipse(const Point& center, const Size& size); struct RoundingRadii { - double topLeft; - double bottomLeft; - double topRight; - double bottomRight; + double topLeft = 0.0; + double bottomLeft = 0.0; + double topRight = 0.0; + double bottomRight = 0.0; - RoundingRadii() - : topLeft(0.0), bottomLeft(0.0), topRight(0.0), bottomRight(0.0) {} + RoundingRadii() {} RoundingRadii(double pTopLeft, double pBottomLeft, @@ -85,5 +83,4 @@ class PathBuilder { FML_DISALLOW_COPY_AND_ASSIGN(PathBuilder); }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/PathComponent.cc b/engine/src/flutter/impeller/impeller/geometry/PathComponent.cc index 990f8c73b98..270299ecec4 100644 --- a/engine/src/flutter/impeller/impeller/geometry/PathComponent.cc +++ b/engine/src/flutter/impeller/impeller/geometry/PathComponent.cc @@ -5,8 +5,7 @@ #include "PathComponent.h" #include -namespace rl { -namespace geom { +namespace impeller { static const size_t kRecursionLimit = 32; static const double kCurveCollinearityEpsilon = 1e-30; @@ -416,5 +415,4 @@ std::vector CubicPathComponent::Extrema() const { return points; } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/PathComponent.h b/engine/src/flutter/impeller/impeller/geometry/PathComponent.h index 139adf0ea56..87e9ffe0440 100644 --- a/engine/src/flutter/impeller/impeller/geometry/PathComponent.h +++ b/engine/src/flutter/impeller/impeller/geometry/PathComponent.h @@ -8,8 +8,7 @@ #include "Rect.h" -namespace rl { -namespace geom { +namespace impeller { struct SmoothingApproximation { const double scale; @@ -106,5 +105,4 @@ struct CubicPathComponent { } }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Point.cc b/engine/src/flutter/impeller/impeller/geometry/Point.cc index 72a0b9db457..e1f9e31ab48 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Point.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Point.cc @@ -5,8 +5,7 @@ #include "Point.h" #include -namespace rl { -namespace geom { +namespace impeller { std::string Point::ToString() const { std::stringstream stream; @@ -31,5 +30,4 @@ double Point::GetDistance(const Point& p) const { return sqrt(GetDistanceSquared(p)); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Point.h b/engine/src/flutter/impeller/impeller/geometry/Point.h index a099d373aa8..6ce9ca1da13 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Point.h +++ b/engine/src/flutter/impeller/impeller/geometry/Point.h @@ -8,8 +8,7 @@ #include #include "Size.h" -namespace rl { -namespace geom { +namespace impeller { struct Point { double x = 0.0; @@ -57,5 +56,4 @@ struct Point { void FromString(const std::string& str); }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Quaternion.cc b/engine/src/flutter/impeller/impeller/geometry/Quaternion.cc index 34303396051..5cfe6c62ca4 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Quaternion.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Quaternion.cc @@ -5,8 +5,7 @@ #include "Quaternion.h" #include -namespace rl { -namespace geom { +namespace impeller { Quaternion Quaternion::Slerp(const Quaternion& to, double time) const { double cosine = Dot(to); @@ -35,5 +34,4 @@ std::string Quaternion::ToString() const { return stream.str(); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Quaternion.h b/engine/src/flutter/impeller/impeller/geometry/Quaternion.h index 07507b8eb3a..528c93ee386 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Quaternion.h +++ b/engine/src/flutter/impeller/impeller/geometry/Quaternion.h @@ -6,8 +6,7 @@ #include "Vector.h" -namespace rl { -namespace geom { +namespace impeller { struct Quaternion { union { @@ -78,5 +77,4 @@ struct Quaternion { std::string ToString() const; }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Rect.cc b/engine/src/flutter/impeller/impeller/geometry/Rect.cc index cfcc4d9296e..83f17f9efba 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Rect.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Rect.cc @@ -5,8 +5,7 @@ #include "Rect.h" #include -namespace rl { -namespace geom { +namespace impeller { Rect Rect::WithPoint(const Point& p) const { Rect copy = *this; @@ -57,5 +56,4 @@ void Rect::FromString(const std::string& str) { stream >> size.height; } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Rect.h b/engine/src/flutter/impeller/impeller/geometry/Rect.h index 04223c47a04..f3d39976b20 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Rect.h +++ b/engine/src/flutter/impeller/impeller/geometry/Rect.h @@ -8,8 +8,7 @@ #include "Point.h" #include "Size.h" -namespace rl { -namespace geom { +namespace impeller { struct Rect { Point origin; @@ -71,5 +70,4 @@ struct Rect { void FromString(const std::string& str); }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Shear.cc b/engine/src/flutter/impeller/impeller/geometry/Shear.cc index ed77e6f8419..fb15e47935c 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Shear.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Shear.cc @@ -5,8 +5,7 @@ #include "Shear.h" #include -namespace rl { -namespace geom { +namespace impeller { std::string Shear::ToString() const { std::stringstream stream; @@ -14,5 +13,4 @@ std::string Shear::ToString() const { return stream.str(); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Shear.h b/engine/src/flutter/impeller/impeller/geometry/Shear.h index 8f785a29694..220342a8b65 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Shear.h +++ b/engine/src/flutter/impeller/impeller/geometry/Shear.h @@ -6,8 +6,7 @@ #include -namespace rl { -namespace geom { +namespace impeller { struct Shear { union { @@ -32,5 +31,4 @@ struct Shear { std::string ToString() const; }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Size.cc b/engine/src/flutter/impeller/impeller/geometry/Size.cc index 91ea783ed58..0d151a8f522 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Size.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Size.cc @@ -5,8 +5,7 @@ #include "Size.h" #include -namespace rl { -namespace geom { +namespace impeller { std::string Size::ToString() const { std::stringstream stream; @@ -21,5 +20,4 @@ void Size::FromString(const std::string& str) { stream >> height; } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Size.h b/engine/src/flutter/impeller/impeller/geometry/Size.h index 8951c7a028d..25faa9600e7 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Size.h +++ b/engine/src/flutter/impeller/impeller/geometry/Size.h @@ -6,8 +6,7 @@ #include -namespace rl { -namespace geom { +namespace impeller { struct Size { double width = 0.0; @@ -54,5 +53,4 @@ struct Size { void FromString(const std::string& str); }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Vector.cc b/engine/src/flutter/impeller/impeller/geometry/Vector.cc index 4e113b24746..4765bef6cc9 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Vector.cc +++ b/engine/src/flutter/impeller/impeller/geometry/Vector.cc @@ -5,8 +5,7 @@ #include "Vector.h" #include -namespace rl { -namespace geom { +namespace impeller { std::string Vector3::ToString() const { std::stringstream stream; @@ -20,5 +19,4 @@ std::string Vector4::ToString() const { return stream.str(); } -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/geometry/Vector.h b/engine/src/flutter/impeller/impeller/geometry/Vector.h index 4abbd7088eb..d5713498da8 100644 --- a/engine/src/flutter/impeller/impeller/geometry/Vector.h +++ b/engine/src/flutter/impeller/impeller/geometry/Vector.h @@ -9,8 +9,7 @@ #include "Point.h" #include "Size.h" -namespace rl { -namespace geom { +namespace impeller { struct Vector3 { union { @@ -141,5 +140,4 @@ struct Vector4 { std::string ToString() const; }; -} // namespace geom -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/image/Image.cc b/engine/src/flutter/impeller/impeller/image/Image.cc index c9fa5d80a3a..cd3aac1a186 100644 --- a/engine/src/flutter/impeller/impeller/image/Image.cc +++ b/engine/src/flutter/impeller/impeller/image/Image.cc @@ -5,8 +5,7 @@ #include "Image.h" #include -namespace rl { -namespace image { +namespace impeller { Image::Image(std::shared_ptr sourceAllocation) : source_(std::move(sourceAllocation)) {} @@ -72,10 +71,9 @@ ImageResult Image::Decode() const { } return ImageResult{ - geom::Size{static_cast(width), - static_cast(height)}, // size - components, // components - std::move(destinationAllocation) // allocation + Size{static_cast(width), static_cast(height)}, // size + components, // components + std::move(destinationAllocation) // allocation }; } @@ -83,5 +81,4 @@ bool Image::IsValid() const { return static_cast(source_); } -} // namespace image -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/image/Image.h b/engine/src/flutter/impeller/impeller/image/Image.h index b51ad8dae6a..aa533f3a627 100644 --- a/engine/src/flutter/impeller/impeller/image/Image.h +++ b/engine/src/flutter/impeller/impeller/image/Image.h @@ -9,8 +9,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" -namespace rl { -namespace image { +namespace impeller { class ImageSource; @@ -28,5 +27,4 @@ class Image { std::shared_ptr source_; }; -} // namespace image -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/image/ImageResult.cc b/engine/src/flutter/impeller/impeller/image/ImageResult.cc index f68e2107dd5..4b789e4f998 100644 --- a/engine/src/flutter/impeller/impeller/image/ImageResult.cc +++ b/engine/src/flutter/impeller/impeller/image/ImageResult.cc @@ -4,12 +4,11 @@ #include "ImageResult.h" -namespace rl { -namespace image { +namespace impeller { ImageResult::ImageResult() = default; -ImageResult::ImageResult(geom::Size size, +ImageResult::ImageResult(Size size, Components components, std::shared_ptr allocation) : success_(true), @@ -23,7 +22,7 @@ bool ImageResult::WasSuccessful() const { return success_; } -const geom::Size& ImageResult::GetSize() const { +const Size& ImageResult::GetSize() const { return size_; } @@ -35,5 +34,4 @@ const std::shared_ptr& ImageResult::Allocation() const { return allocation_; } -} // namespace image -} // namespace rl +} // namespace impeller diff --git a/engine/src/flutter/impeller/impeller/image/ImageResult.h b/engine/src/flutter/impeller/impeller/image/ImageResult.h index 624f67507e5..0e9985344aa 100644 --- a/engine/src/flutter/impeller/impeller/image/ImageResult.h +++ b/engine/src/flutter/impeller/impeller/image/ImageResult.h @@ -10,8 +10,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" -namespace rl { -namespace image { +namespace impeller { class ImageResult { public: @@ -25,13 +24,13 @@ class ImageResult { ImageResult(); - ImageResult(geom::Size size, + ImageResult(Size size, Components components, std::shared_ptr allocation); ~ImageResult(); - const geom::Size& GetSize() const; + const Size& GetSize() const; bool WasSuccessful() const; @@ -41,12 +40,11 @@ class ImageResult { private: bool success_ = false; - geom::Size size_; + Size size_; Components components_ = Components::Invalid; std::shared_ptr allocation_; FML_DISALLOW_COPY_AND_ASSIGN(ImageResult); }; -} // namespace image -} // namespace rl +} // namespace impeller