-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keeping a reference to the layer provider around and using it after a call to update() isn't a good idea since the object handed to update() may be already gone when rendering so cache the layers for later use
- Loading branch information
1 parent
d3039e1
commit bd91a8d
Showing
7 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "canvas_layer_provider.hpp" | ||
|
||
namespace horizon { | ||
|
||
void CanvasLayerProvider::update(const LayerProvider &other) | ||
{ | ||
layers = other.get_layers(); | ||
} | ||
|
||
const std::map<int, Layer> &CanvasLayerProvider::get_layers() const | ||
{ | ||
return layers; | ||
} | ||
|
||
|
||
} // namespace horizon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
#include "common/layer_provider.hpp" | ||
|
||
namespace horizon { | ||
class CanvasLayerProvider : public LayerProvider { | ||
public: | ||
void update(const LayerProvider &other); | ||
const std::map<int, Layer> &get_layers() const override; | ||
|
||
private: | ||
std::map<int, Layer> layers; | ||
}; | ||
} // namespace horizon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters