From 35c68466d7f5929da61873a8e5359b6db88b0363 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Mon, 1 Jul 2019 21:44:15 +0300 Subject: [core] Introduce TileRenderData Remove rendering functionality from Tile implementations. --- src/mbgl/tile/tile.hpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/mbgl/tile/tile.hpp') diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp index 17a16b4666..4ba8bc1160 100644 --- a/src/mbgl/tile/tile.hpp +++ b/src/mbgl/tile/tile.hpp @@ -24,6 +24,7 @@ class LayerRenderData; class TransformState; class TileObserver; class RenderLayer; +class TileRenderData; class RenderedQueryOptions; class SourceQueryOptions; class CollisionIndex; @@ -45,6 +46,8 @@ public: Tile(Kind, OverscaledTileID); virtual ~Tile(); + virtual std::unique_ptr createRenderData() = 0; + void setObserver(TileObserver* observer); virtual void setNecessity(TileNecessity) {} @@ -52,12 +55,6 @@ public: // Mark this tile as no longer needed and cancel any pending work. virtual void cancel(); - virtual void upload(gfx::UploadPass&) = 0; - virtual Bucket* getBucket(const style::Layer::Impl&) const = 0; - virtual const LayerRenderData* getLayerRenderData(const style::Layer::Impl&) const { - assert(false); - return nullptr; - } // Notifies this tile of the updated layer properties. // // Tile implementation should update the contained layer @@ -65,9 +62,7 @@ public: // // Returns `true` if the corresponding render layer data is present in this tile (and i.e. it // was succesfully updated); returns `false` otherwise. - virtual bool layerPropertiesUpdated(const Immutable& layerProperties) { - return bool(getBucket(*layerProperties->baseImpl)); - } + virtual bool layerPropertiesUpdated(const Immutable& layerProperties) = 0; virtual void setShowCollisionBoxes(const bool) {} virtual void setLayers(const std::vector>&) {} virtual void setMask(TileMask&&) {} -- cgit v1.2.1