Initial Grease Pencil 3.0 stage #106848
|
@ -299,9 +299,12 @@ class GreasePencilDrawingRuntime {
|
||||||
};
|
};
|
||||||
|
|
||||||
class GreasePencilRuntime {
|
class GreasePencilRuntime {
|
||||||
public:
|
private:
|
||||||
mutable SharedCache<Vector<greasepencil::Layer *>> layer_cache_;
|
mutable SharedCache<Vector<greasepencil::Layer *>> layer_cache_;
|
||||||
|
|||||||
|
|
||||||
|
public:
|
||||||
|
void *batch_cache = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
greasepencil::LayerGroup root_group_;
|
greasepencil::LayerGroup root_group_;
|
||||||
int active_layer_index_ = -1;
|
int active_layer_index_ = -1;
|
||||||
Falk David
commented
Put out of line. Put out of line.
|
|||||||
|
@ -314,6 +317,9 @@ class GreasePencilRuntime {
|
||||||
const greasepencil::LayerGroup &root_group() const;
|
const greasepencil::LayerGroup &root_group() const;
|
||||||
greasepencil::LayerGroup &root_group_for_write();
|
greasepencil::LayerGroup &root_group_for_write();
|
||||||
|
|
||||||
|
Span<const greasepencil::Layer *> layers() const;
|
||||||
Falk David
commented
Put out of line. Put out of line.
|
|||||||
|
Span<greasepencil::Layer *> layers_for_write();
|
||||||
|
|
||||||
bool has_active_layer() const;
|
bool has_active_layer() const;
|
||||||
filedescriptor marked this conversation as resolved
Outdated
Bastien Montagne
commented
Same remark as above about commented out code. Same remark as above about commented out code.
|
|||||||
const greasepencil::Layer &active_layer() const;
|
const greasepencil::Layer &active_layer() const;
|
||||||
greasepencil::Layer &active_layer_for_write() const;
|
greasepencil::Layer &active_layer_for_write() const;
|
||||||
|
@ -327,9 +333,6 @@ class GreasePencilRuntime {
|
||||||
|
|
||||||
void tag_layer_tree_topology_changed();
|
void tag_layer_tree_topology_changed();
|
||||||
|
|
||||||
public:
|
|
||||||
void *batch_cache = nullptr;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
greasepencil::Layer *get_active_layer_from_index(int index) const;
|
greasepencil::Layer *get_active_layer_from_index(int index) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -608,6 +608,16 @@ greasepencil::LayerGroup &GreasePencilRuntime::root_group_for_write()
|
||||||
return this->root_group_;
|
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
|
bool GreasePencilRuntime::has_active_layer() const
|
||||||
{
|
{
|
||||||
return this->active_layer_index_ >= 0;
|
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
|
blender::Span<const blender::bke::greasepencil::Layer *> GreasePencil::layers() const
|
||||||
{
|
{
|
||||||
|
BLI_assert(this->runtime != nullptr);
|
||||||
this->runtime->ensure_layer_cache();
|
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()
|
blender::Span<blender::bke::greasepencil::Layer *> GreasePencil::layers_for_write()
|
||||||
{
|
{
|
||||||
|
BLI_assert(this->runtime != nullptr);
|
||||||
this->runtime->ensure_layer_cache();
|
this->runtime->ensure_layer_cache();
|
||||||
return this->runtime->layer_cache_.data();
|
return this->runtime->layers_for_write();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GreasePencil::tag_layer_tree_topology_changed()
|
void GreasePencil::tag_layer_tree_topology_changed()
|
||||||
|
|
Loading…
Reference in New Issue
Looks like this should be private maybe? It has a
_
suffix.