Stub all canvas related aiks containers.
This commit is contained in:
@@ -7,7 +7,7 @@ config("impeller_public_config") {
|
||||
}
|
||||
|
||||
group("impeller") {
|
||||
deps = [
|
||||
public_deps = [
|
||||
"aiks",
|
||||
"base",
|
||||
"compiler",
|
||||
|
||||
@@ -12,6 +12,8 @@ impeller_component("aiks") {
|
||||
"image.h",
|
||||
"paint.cc",
|
||||
"paint.h",
|
||||
"picture.cc",
|
||||
"picture.h",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_;
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ class Paint {
|
||||
|
||||
private:
|
||||
Color color_;
|
||||
|
||||
FML_DISALLOW_COPY_AND_ASSIGN(Paint);
|
||||
};
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
13
engine/src/flutter/impeller/aiks/picture.cc
Normal file
13
engine/src/flutter/impeller/aiks/picture.cc
Normal 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
|
||||
21
engine/src/flutter/impeller/aiks/picture.h
Normal file
21
engine/src/flutter/impeller/aiks/picture.h
Normal 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
|
||||
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user