Stub all canvas related aiks containers.

This commit is contained in:
Chinmay Garde
2021-08-10 14:38:14 -07:00
committed by Dan Field
parent f98ed98437
commit d666dd11fe
8 changed files with 74 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ config("impeller_public_config") {
}
group("impeller") {
deps = [
public_deps = [
"aiks",
"base",
"compiler",

View File

@@ -12,6 +12,8 @@ impeller_component("aiks") {
"image.h",
"paint.cc",
"paint.h",
"picture.cc",
"picture.h",
]
public_deps = [

View File

@@ -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<Rect> 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> picture) {
FML_LOG(ERROR) << "WIP";
}
} // namespace impeller

View File

@@ -4,10 +4,13 @@
#pragma once
#include <memory>
#include <optional>
#include <stack>
#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<Rect> 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> picture);
private:
std::stack<Matrix> xformation_stack_;

View File

@@ -20,8 +20,6 @@ class Paint {
private:
Color color_;
FML_DISALLOW_COPY_AND_ASSIGN(Paint);
};
} // namespace impeller

View File

@@ -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

View File

@@ -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

View File

@@ -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 <class U>
constexpr explicit TRect(const TRect<U>& other)
: origin(static_cast<TPoint<Type>>(other.origin)),