summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-10-06 18:24:01 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2014-10-06 18:24:01 -0400
commit5cc6b26229597ef78bd87d21367b75f2051b7314 (patch)
treea2bbd3f40609b3939e9a167c793178582fe97230 /common
parent41dac96408a08e3ad2fca7bbe1e7572db85acd13 (diff)
downloadqtlocation-mapboxgl-5cc6b26229597ef78bd87d21367b75f2051b7314.tar.gz
clean up shared_ptr usage
Diffstat (limited to 'common')
-rw-r--r--common/headless_view.cpp12
-rw-r--r--common/headless_view.hpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index 5e8770b7a7..b8a2fa360b 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -5,18 +5,18 @@
namespace mbgl {
-HeadlessView::HeadlessView() : display_ptr(std::make_shared<HeadlessDisplay>()) {
+HeadlessView::HeadlessView() : display_ptr_(std::make_shared<HeadlessDisplay>()) {
createContext();
}
-HeadlessView::HeadlessView(HeadlessDisplay &display)
- : display_ptr(std::make_shared<HeadlessDisplay>(display)) {
+HeadlessView::HeadlessView(std::shared_ptr<HeadlessDisplay> display_ptr)
+ : display_ptr_(display_ptr) {
createContext();
}
void HeadlessView::createContext() {
#if MBGL_USE_CGL
- CGLError error = CGLCreateContext(display_ptr->pixelFormat, NULL, &gl_context);
+ CGLError error = CGLCreateContext(display_ptr_->pixelFormat, NULL, &gl_context);
if (error) {
fprintf(stderr, "Error creating GL context object\n");
return;
@@ -30,8 +30,8 @@ void HeadlessView::createContext() {
#endif
#if MBGL_USE_GLX
- x_display = display_ptr->x_display;
- x_info = display_ptr->x_info;
+ x_display = display_ptr_->x_display;
+ x_info = display_ptr_->x_info;
gl_context = glXCreateContext(x_display, x_info, 0, GL_TRUE);
if (gl_context == nullptr) {
diff --git a/common/headless_view.hpp b/common/headless_view.hpp
index 5303f2c104..3ad5a669a5 100644
--- a/common/headless_view.hpp
+++ b/common/headless_view.hpp
@@ -20,7 +20,7 @@ class HeadlessDisplay;
class HeadlessView : public View {
public:
HeadlessView();
- HeadlessView(HeadlessDisplay &display);
+ HeadlessView(std::shared_ptr<HeadlessDisplay> display_ptr);
~HeadlessView();
void createContext();
@@ -38,7 +38,7 @@ private:
private:
- std::shared_ptr<HeadlessDisplay> display_ptr;
+ std::shared_ptr<HeadlessDisplay> display_ptr_;
#if MBGL_USE_CGL
CGLContextObj gl_context;