Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
2 changed files with 21 additions and 6 deletions
Showing only changes of commit 8b1de6f275 - Show all commits

View File

@ -299,9 +299,12 @@ class GreasePencilDrawingRuntime {
};
class GreasePencilRuntime {
public:
private:
mutable SharedCache<Vector<greasepencil::Layer *>> layer_cache_;

Looks like this should be private maybe? It has a _ suffix.

Looks like this should be private maybe? It has a `_` suffix.
public:
void *batch_cache = nullptr;
private:
greasepencil::LayerGroup root_group_;
int active_layer_index_ = -1;

Put out of line.

Put out of line.
@ -314,6 +317,9 @@ class GreasePencilRuntime {
const greasepencil::LayerGroup &root_group() const;
greasepencil::LayerGroup &root_group_for_write();
Span<const greasepencil::Layer *> layers() const;

Put out of line.

Put out of line.
Span<greasepencil::Layer *> layers_for_write();
bool has_active_layer() const;
filedescriptor marked this conversation as resolved Outdated

Same remark as above about commented out code.

Same remark as above about commented out code.
const greasepencil::Layer &active_layer() const;
greasepencil::Layer &active_layer_for_write() const;
@ -327,9 +333,6 @@ class GreasePencilRuntime {
void tag_layer_tree_topology_changed();
public:
void *batch_cache = nullptr;
private:
greasepencil::Layer *get_active_layer_from_index(int index) const;
};

View File

@ -608,6 +608,16 @@ greasepencil::LayerGroup &GreasePencilRuntime::root_group_for_write()
return this->root_group_;
}
Span<const greasepencil::Layer *> GreasePencilRuntime::layers() const
{
return this->layer_cache_.data();
}
Span<greasepencil::Layer *> GreasePencilRuntime::layers_for_write()
{
return this->layer_cache_.data();
}
bool GreasePencilRuntime::has_active_layer() const
{
return this->active_layer_index_ >= 0;
@ -1194,14 +1204,16 @@ blender::bke::greasepencil::LayerGroup &GreasePencil::root_group_for_write()
blender::Span<const blender::bke::greasepencil::Layer *> GreasePencil::layers() const
{
BLI_assert(this->runtime != nullptr);
this->runtime->ensure_layer_cache();
return this->runtime->layer_cache_.data();
return this->runtime->layers();
}
blender::Span<blender::bke::greasepencil::Layer *> GreasePencil::layers_for_write()
{
BLI_assert(this->runtime != nullptr);
this->runtime->ensure_layer_cache();
return this->runtime->layer_cache_.data();
return this->runtime->layers_for_write();
}
void GreasePencil::tag_layer_tree_topology_changed()