From 839b19330ee7ca1b3cd42cf77dc4caa08eaf0a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 22 Apr 2015 18:07:27 +0200 Subject: remove hasData() from Bucket interface --- src/mbgl/renderer/bucket.hpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mbgl/renderer/bucket.hpp') diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index a7b0f61a3b..2ea73f9b97 100644 --- a/src/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp @@ -13,7 +13,6 @@ class TileID; class Bucket : private util::noncopyable { public: virtual void render(Painter&, const StyleLayer&, const TileID&, const mat4&) = 0; - virtual bool hasData() const = 0; virtual ~Bucket() {} }; -- cgit v1.2.1 From 28b9b3f9d64207a03b6125b3e299efda59952a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 22 Apr 2015 18:27:19 +0200 Subject: add prepare() function --- src/mbgl/renderer/bucket.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mbgl/renderer/bucket.hpp') diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index 2ea73f9b97..282a6aa367 100644 --- a/src/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp @@ -10,11 +10,32 @@ class Painter; class StyleLayer; class TileID; +enum class RenderPass : uint8_t { + Prepare = 1 << 0, + Opaque = 1 << 1, + Translucent = 1 << 2, +}; + class Bucket : private util::noncopyable { public: + // As long as this bucket has a Prepare render pass, this function is getting called. Typically, + // this only happens once when the bucket is being rendered for the first time. + virtual void prepare() = 0; + + // Every time this bucket is getting rendered, this function is called. This happens either + // once or twice (for Opaque and Transparent render passes). virtual void render(Painter&, const StyleLayer&, const TileID&, const mat4&) = 0; + virtual ~Bucket() {} + inline bool hasRenderPass(RenderPass pass) const { + return static_cast::type>(renderPass) & + static_cast::type>(pass); + } + +protected: + RenderPass renderPass = RenderPass::Prepare; + }; } -- cgit v1.2.1 From f89f7f1bc27e36467bab247f40bb823a3b7b178c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 23 Apr 2015 17:26:15 +0200 Subject: rename prepare => upload and determine passes per layer instead of per bucket --- src/mbgl/renderer/bucket.hpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/mbgl/renderer/bucket.hpp') diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index 282a6aa367..36210f9cb5 100644 --- a/src/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp @@ -1,6 +1,7 @@ #ifndef MBGL_RENDERER_BUCKET #define MBGL_RENDERER_BUCKET +#include #include #include @@ -10,17 +11,11 @@ class Painter; class StyleLayer; class TileID; -enum class RenderPass : uint8_t { - Prepare = 1 << 0, - Opaque = 1 << 1, - Translucent = 1 << 2, -}; - class Bucket : private util::noncopyable { public: // As long as this bucket has a Prepare render pass, this function is getting called. Typically, // this only happens once when the bucket is being rendered for the first time. - virtual void prepare() = 0; + virtual void upload() = 0; // Every time this bucket is getting rendered, this function is called. This happens either // once or twice (for Opaque and Transparent render passes). @@ -28,13 +23,12 @@ public: virtual ~Bucket() {} - inline bool hasRenderPass(RenderPass pass) const { - return static_cast::type>(renderPass) & - static_cast::type>(pass); + inline bool needsUpload() const { + return uploaded; } protected: - RenderPass renderPass = RenderPass::Prepare; + bool uploaded = false; }; -- cgit v1.2.1 From 99ad8a4036baf9adcc9e083e31fa6fea2516bd06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 28 Apr 2015 18:12:27 +0200 Subject: fix needsUpload() --- src/mbgl/renderer/bucket.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mbgl/renderer/bucket.hpp') diff --git a/src/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index 36210f9cb5..711fc42384 100644 --- a/src/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp @@ -24,7 +24,7 @@ public: virtual ~Bucket() {} inline bool needsUpload() const { - return uploaded; + return !uploaded; } protected: -- cgit v1.2.1