[core] Split LayerPlacementData and BucketPlacementData

This commit is contained in:
Mikhail Pozdnyakov
2020-03-03 11:46:44 +02:00
parent f748972fe9
commit 24fa599903
2 changed files with 6 additions and 4 deletions

View File

@@ -589,7 +589,7 @@ void RenderSymbolLayer::prepare(const LayerPrepareParameters& params) {
placementData.push_back({*bucket, renderTile, featureIndex, nullopt});
} else {
for (const auto& sortKeyRange : bucket->sortKeyRanges) {
LayerPlacementData layerData{*bucket, renderTile, featureIndex, sortKeyRange};
BucketPlacementData layerData{*bucket, renderTile, featureIndex, sortKeyRange};
auto sortPosition = std::upper_bound(
placementData.cbegin(), placementData.cend(), layerData, [](const auto& lhs, const auto& rhs) {
assert(lhs.sortKeyRange && rhs.sortKeyRange);

View File

@@ -36,7 +36,7 @@ public:
size_t end;
};
class LayerPlacementData {
class BucketPlacementData {
public:
std::reference_wrapper<Bucket> bucket;
std::reference_wrapper<const RenderTile> tile;
@@ -44,6 +44,8 @@ public:
optional<SortKeyRange> sortKeyRange;
};
using LayerPlacementData = std::list<BucketPlacementData>;
class LayerPrepareParameters {
public:
RenderSource* source;
@@ -105,7 +107,7 @@ public:
virtual void prepare(const LayerPrepareParameters&);
const std::list<LayerPlacementData>& getPlacementData() const { return placementData; }
const LayerPlacementData& getPlacementData() const { return placementData; }
// Latest evaluated properties.
Immutable<style::LayerProperties> evaluatedProperties;
@@ -134,7 +136,7 @@ protected:
// evaluated StyleProperties object and is updated accordingly.
RenderPass passes = RenderPass::None;
std::list<LayerPlacementData> placementData;
LayerPlacementData placementData;
private:
// Some layers may not render correctly on some hardware when the vertex attribute limit of