add virtual destructor to new virtual Culler class (flutter/engine#38494)

This commit is contained in:
Jim Graham
2022-12-24 12:17:21 -08:00
committed by GitHub
parent 750a252421
commit 92ac0d6d29

View File

@@ -59,13 +59,16 @@ uint32_t DisplayList::next_unique_id() {
class Culler {
public:
virtual ~Culler() = default;
virtual bool init(DispatchContext& context) = 0;
virtual void update(DispatchContext& context) = 0;
};
class NopCuller : public Culler {
class NopCuller final : public Culler {
public:
static NopCuller instance;
~NopCuller() = default;
bool init(DispatchContext& context) override {
// Setting next_render_index to 0 means that
// all rendering ops will be at or after that
@@ -78,11 +81,13 @@ class NopCuller : public Culler {
void update(DispatchContext& context) override {}
};
NopCuller NopCuller::instance = NopCuller();
class VectorCuller : public Culler {
class VectorCuller final : public Culler {
public:
VectorCuller(const DlRTree* rtree, const std::vector<int>& rect_indices)
: rtree_(rtree), cur_(rect_indices.begin()), end_(rect_indices.end()) {}
~VectorCuller() = default;
bool init(DispatchContext& context) override {
if (cur_ < end_) {
context.next_render_index = rtree_->id(*cur_++);