Share bucket indices (#1358)
Co-authored-by: Stefan Karschti <stefan.karschti@gmail.com>
This commit is contained in:
committed by
Bart Louwers
parent
996b388601
commit
7f862cd8ff
@@ -26,11 +26,13 @@ class CullFaceMode;
|
||||
enum class DepthMaskType : bool;
|
||||
class DrawableTweaker;
|
||||
class DrawMode;
|
||||
class IndexVectorBase;
|
||||
class ShaderProgramBase;
|
||||
class VertexAttributeArray;
|
||||
|
||||
using DrawPriority = int64_t;
|
||||
using DrawableTweakerPtr = std::shared_ptr<DrawableTweaker>;
|
||||
using IndexVectorBasePtr = std::shared_ptr<IndexVectorBase>;
|
||||
using ShaderProgramBasePtr = std::shared_ptr<ShaderProgramBase>;
|
||||
using Texture2DPtr = std::shared_ptr<Texture2D>;
|
||||
|
||||
@@ -155,8 +157,9 @@ public:
|
||||
/// Incompatible with adding primitives
|
||||
virtual void setVertices(std::vector<uint8_t>&&, std::size_t, AttributeDataType) = 0;
|
||||
|
||||
/// Create a segment wrapper
|
||||
virtual void setIndexData(std::vector<std::uint16_t> indexes, std::vector<UniqueDrawSegment> segments) = 0;
|
||||
/// Provide raw indexes and segments
|
||||
void setIndexData(std::vector<std::uint16_t> indexes, std::vector<UniqueDrawSegment>);
|
||||
virtual void setIndexData(gfx::IndexVectorBasePtr, std::vector<UniqueDrawSegment>) = 0;
|
||||
|
||||
/// Get the tweakers attached to this drawable
|
||||
const std::vector<DrawableTweakerPtr>& getTweakers() const { return tweakers; }
|
||||
|
||||
@@ -14,10 +14,12 @@ class SegmentBase;
|
||||
namespace gfx {
|
||||
|
||||
class DrawableTweaker;
|
||||
class IndexVectorBase;
|
||||
class ShaderProgramBase;
|
||||
class VertexAttributeArray;
|
||||
|
||||
using DrawableTweakerPtr = std::shared_ptr<DrawableTweaker>;
|
||||
using IndexVectorBasePtr = std::shared_ptr<IndexVectorBase>;
|
||||
using ShaderProgramBasePtr = std::shared_ptr<ShaderProgramBase>;
|
||||
using Texture2DPtr = std::shared_ptr<Texture2D>;
|
||||
|
||||
@@ -137,8 +139,8 @@ public:
|
||||
/// Incompatible with adding primitives
|
||||
void setRawVertices(std::vector<uint8_t>&&, std::size_t, AttributeDataType);
|
||||
|
||||
void setSegments(gfx::DrawMode, std::vector<uint16_t> indexes, const std::vector<SegmentBase>&);
|
||||
void setSegments(gfx::DrawMode, std::vector<uint16_t> indexes, const SegmentBase*, std::size_t segmentCount);
|
||||
void setSegments(gfx::DrawMode, gfx::IndexVectorBasePtr, const SegmentBase*, std::size_t segmentCount);
|
||||
|
||||
/// Add lines based on existing vertices
|
||||
void addLines(const std::vector<uint16_t>& indexes,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gfx/draw_mode.hpp>
|
||||
#include <mbgl/gfx/drawable.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace gfx {
|
||||
|
||||
@@ -19,7 +19,7 @@ class IndexBuffer;
|
||||
class UploadPass;
|
||||
class VertexBufferResource;
|
||||
|
||||
using UniqueVertexBufferResource = std::unique_ptr<gfx::VertexBufferResource>;
|
||||
using UniqueVertexBufferResource = std::unique_ptr<VertexBufferResource>;
|
||||
|
||||
} // namespace gfx
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
void draw(PaintParameters&) const override;
|
||||
|
||||
struct DrawSegmentGL;
|
||||
void setIndexData(std::vector<std::uint16_t> indexes, std::vector<UniqueDrawSegment> segments) override;
|
||||
void setIndexData(gfx::IndexVectorBasePtr, std::vector<UniqueDrawSegment> segments) override;
|
||||
|
||||
void setVertices(std::vector<uint8_t>&&, std::size_t, gfx::AttributeDataType) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user