diff --git a/engine/src/flutter/impeller/BUILD.gn b/engine/src/flutter/impeller/BUILD.gn index 167ba3b42b..1d77a23fc6 100644 --- a/engine/src/flutter/impeller/BUILD.gn +++ b/engine/src/flutter/impeller/BUILD.gn @@ -7,7 +7,7 @@ config("impeller_public_config") { } group("impeller") { - deps = [ + public_deps = [ "aiks", "base", "compiler", diff --git a/engine/src/flutter/impeller/aiks/BUILD.gn b/engine/src/flutter/impeller/aiks/BUILD.gn index c4b8829a14..2f735582de 100644 --- a/engine/src/flutter/impeller/aiks/BUILD.gn +++ b/engine/src/flutter/impeller/aiks/BUILD.gn @@ -12,6 +12,8 @@ impeller_component("aiks") { "image.h", "paint.cc", "paint.h", + "picture.cc", + "picture.h", ] public_deps = [ diff --git a/engine/src/flutter/impeller/aiks/canvas.cc b/engine/src/flutter/impeller/aiks/canvas.cc index 4de595e6de..f3b32fe523 100644 --- a/engine/src/flutter/impeller/aiks/canvas.cc +++ b/engine/src/flutter/impeller/aiks/canvas.cc @@ -52,6 +52,24 @@ size_t Canvas::GetSaveCount() const { return xformation_stack_.size(); } -void Canvas::DrawPath(Path path, Paint paint) {} +void Canvas::DrawPath(Path path, Paint paint) { + FML_LOG(ERROR) << "WIP"; +} + +void Canvas::SaveLayer(const Paint& paint, std::optional bounds) { + FML_LOG(ERROR) << "WIP"; +} + +void Canvas::ClipPath(Path path) { + FML_LOG(ERROR) << "WIP"; +} + +void Canvas::DrawShadow(Path path, Color color, Scalar elevation) { + FML_LOG(ERROR) << "WIP"; +} + +void Canvas::DrawPicture(std::shared_ptr picture) { + FML_LOG(ERROR) << "WIP"; +} } // namespace impeller diff --git a/engine/src/flutter/impeller/aiks/canvas.h b/engine/src/flutter/impeller/aiks/canvas.h index 86f2ed048b..bf5ff3b895 100644 --- a/engine/src/flutter/impeller/aiks/canvas.h +++ b/engine/src/flutter/impeller/aiks/canvas.h @@ -4,10 +4,13 @@ #pragma once +#include +#include #include #include "flutter/fml/macros.h" #include "impeller/aiks/paint.h" +#include "impeller/aiks/picture.h" #include "impeller/geometry/matrix.h" #include "impeller/geometry/path.h" #include "impeller/geometry/vector.h" @@ -22,6 +25,8 @@ class Canvas { void Save(); + void SaveLayer(const Paint& paint, std::optional bounds = std::nullopt); + bool Restore(); size_t GetSaveCount() const; @@ -38,6 +43,12 @@ class Canvas { void DrawPath(Path path, Paint paint); + void ClipPath(Path path); + + void DrawShadow(Path path, Color color, Scalar elevation); + + void DrawPicture(std::shared_ptr picture); + private: std::stack xformation_stack_; diff --git a/engine/src/flutter/impeller/aiks/paint.h b/engine/src/flutter/impeller/aiks/paint.h index ae72142cb9..01e736ca08 100644 --- a/engine/src/flutter/impeller/aiks/paint.h +++ b/engine/src/flutter/impeller/aiks/paint.h @@ -20,8 +20,6 @@ class Paint { private: Color color_; - - FML_DISALLOW_COPY_AND_ASSIGN(Paint); }; } // namespace impeller diff --git a/engine/src/flutter/impeller/aiks/picture.cc b/engine/src/flutter/impeller/aiks/picture.cc new file mode 100644 index 0000000000..14217674b4 --- /dev/null +++ b/engine/src/flutter/impeller/aiks/picture.cc @@ -0,0 +1,13 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "impeller/aiks/picture.h" + +namespace impeller { + +Picture::Picture() = default; + +Picture::~Picture() = default; + +} // namespace impeller diff --git a/engine/src/flutter/impeller/aiks/picture.h b/engine/src/flutter/impeller/aiks/picture.h new file mode 100644 index 0000000000..3ced1ed0c2 --- /dev/null +++ b/engine/src/flutter/impeller/aiks/picture.h @@ -0,0 +1,21 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/fml/macros.h" + +namespace impeller { + +class Picture { + public: + Picture(); + + ~Picture(); + + private: + FML_DISALLOW_COPY_AND_ASSIGN(Picture); +}; + +} // namespace impeller diff --git a/engine/src/flutter/impeller/geometry/rect.h b/engine/src/flutter/impeller/geometry/rect.h index 02a51a3642..deebcfccb8 100644 --- a/engine/src/flutter/impeller/geometry/rect.h +++ b/engine/src/flutter/impeller/geometry/rect.h @@ -33,6 +33,13 @@ struct TRect { constexpr TRect(Type x, Type y, Type width, Type height) : origin(x, y), size(width, height) {} + constexpr static TRect MakeLTRB(Type left, + Type top, + Type right, + Type bottom) { + return TRect(left, top, right - left, bottom - top); + } + template constexpr explicit TRect(const TRect& other) : origin(static_cast>(other.origin)),