Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 4ea281c

Browse files
committed
rename llmr => mbgl
1 parent c1a64dc commit 4ea281c

File tree

236 files changed

+1211
-1210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+1211
-1210
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/config/constants_local.cpp
1313
/build
1414
/bin/node_modules
15-
/include/llmr/shader/shaders.hpp
15+
/include/mbgl/shader/shaders.hpp
1616
/src/shader/shaders_gl.cpp
1717
/src/shader/shaders_gles2.cpp
1818
/bin/style.bin.js

Makefile

+20-20
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ config.gypi:
1212
./setup-libraries.sh
1313

1414
# Builds the regular library
15-
llmr: config.gypi llmr.gyp node
16-
deps/run_gyp llmr.gyp --depth=. -Goutput_dir=.. --generator-output=./build/llmr -f make
17-
$(MAKE) -C build/llmr BUILDTYPE=$(BUILDTYPE) V=$(V) llmr-x86
15+
mbgl: config.gypi mbgl.gyp node
16+
deps/run_gyp mbgl.gyp --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
17+
$(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-x86
1818

1919
node:
2020
@if [ ! `which node` ]; then echo 'error: depends on node.js. please make sure node is on your PATH'; exit 1; fi;
@@ -40,8 +40,8 @@ xtest: config.gypi clear_xcode_cache node
4040

4141

4242
# Builds the linux app with make. This is also used by Travis CI
43-
linux: config.gypi linux/llmr-app.gyp node
44-
deps/run_gyp linux/llmr-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make
43+
linux: config.gypi linux/mbgl-app.gyp node
44+
deps/run_gyp linux/mbgl-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make
4545
$(MAKE) -C build/linux BUILDTYPE=$(BUILDTYPE) V=$(V) linuxapp
4646

4747
# Executes the Linux binary
@@ -51,8 +51,8 @@ run-linux: linux
5151

5252

5353
# Builds the OS X app with make.
54-
osx: config.gypi macosx/llmr-app.gyp node
55-
deps/run_gyp macosx/llmr-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make
54+
osx: config.gypi macosx/mbgl-app.gyp node
55+
deps/run_gyp macosx/mbgl-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make
5656
$(MAKE) -C build/macosx BUILDTYPE=$(BUILDTYPE) V=$(V) osxapp
5757

5858
# Executes the OS X binary
@@ -65,27 +65,27 @@ clear_xcode_cache:
6565
@CUSTOM_DD=`defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation 2>/dev/null`; \
6666
if [[ $$CUSTOM_DD ]]; then \
6767
echo clearing files in $$CUSTOM_DD older than one day; \
68-
find $$CUSTOM_DD/llmr-app-* -mtime +1 | xargs rm -rf; \
68+
find $$CUSTOM_DD/mbgl-app-* -mtime +1 | xargs rm -rf; \
6969
fi; \
7070
if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]] && [[ ! $$CUSTOM_DD ]]; then \
71-
echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/llmr-app-* older than one day'; \
72-
find ~/Library/Developer/Xcode/DerivedData/llmr-app-* -mtime +1 | xargs rm -rf; \
71+
echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/mbgl-app-* older than one day'; \
72+
find ~/Library/Developer/Xcode/DerivedData/mbgl-app-* -mtime +1 | xargs rm -rf; \
7373
fi
7474

7575
# build Mac OS X project for Xcode
76-
xproj: config.gypi macosx/llmr-app.gyp clear_xcode_cache node
77-
deps/run_gyp macosx/llmr-app.gyp --depth=. --generator-output=./build -f xcode
78-
open ./build/macosx/llmr-app.xcodeproj
76+
xproj: config.gypi macosx/mbgl-app.gyp clear_xcode_cache node
77+
deps/run_gyp macosx/mbgl-app.gyp --depth=. --generator-output=./build -f xcode
78+
open ./build/macosx/mbgl-app.xcodeproj
7979

8080
# build iOS project for Xcode
81-
iproj: config.gypi ios/mapbox-gl-cocoa/app/llmr-app.gyp clear_xcode_cache node
82-
deps/run_gyp ios/mapbox-gl-cocoa/app/llmr-app.gyp --depth=. --generator-output=./build -f xcode
83-
open ./build/ios/mapbox-gl-cocoa/app/llmr-app.xcodeproj
81+
iproj: config.gypi ios/mapbox-gl-cocoa/app/mbgl-app.gyp clear_xcode_cache node
82+
deps/run_gyp ios/mapbox-gl-cocoa/app/mbgl-app.gyp --depth=. --generator-output=./build -f xcode
83+
open ./build/ios/mapbox-gl-cocoa/app/mbgl-app.xcodeproj
8484

8585
# build Linux project for Xcode (Runs on Mac OS X too, but without platform-specific code)
86-
lproj: config.gypi linux/llmr-app.gyp clear_xcode_cache node
87-
deps/run_gyp linux/llmr-app.gyp --depth=. --generator-output=./build -f xcode
88-
open ./build/linux/llmr-app.xcodeproj
86+
lproj: config.gypi linux/mbgl-app.gyp clear_xcode_cache node
87+
deps/run_gyp linux/mbgl-app.gyp --depth=. --generator-output=./build -f xcode
88+
open ./build/linux/mbgl-app.xcodeproj
8989

9090

9191
##### Maintenace operations ####################################################
@@ -101,4 +101,4 @@ distclean: clean
101101
-rm -rf ./config.gypi
102102
-rm -rf ./mapnik-packaging/osx/out/
103103

104-
.PHONY: llmr test linux
104+
.PHONY: mbgl test linux

bin/build-shaders.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ module.exports = function(shader_type, prefix, suffix) {
8383
}
8484

8585
var header = '// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.\n\n';
86-
header += '#ifndef LLMR_SHADER_SHADERS\n';
87-
header += '#define LLMR_SHADER_SHADERS\n';
86+
header += '#ifndef MBGL_SHADER_SHADERS\n';
87+
header += '#define MBGL_SHADER_SHADERS\n';
8888
header += '\n';
89-
header += 'namespace llmr {\n';
89+
header += 'namespace mbgl {\n';
9090
header += '\n';
9191
header += 'struct shader_source {\n';
9292
header += ' const char *vertex;\n';
@@ -106,18 +106,19 @@ module.exports = function(shader_type, prefix, suffix) {
106106

107107

108108
var code = '// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.\n';
109-
code += '#include <llmr/platform/gl.hpp>\n';
109+
code += '#include <mbgl/platform/gl.hpp>\n';
110110
code += prefix + '\n';
111-
code += '#include <llmr/shader/shaders.hpp>\n';
111+
code += '#include <mbgl/shader/shaders.hpp>\n';
112112
code += '\n';
113-
code += 'using namespace llmr;\n';
113+
code += 'namespace mbgl {\n';
114114
code += '\n';
115-
code += 'const shader_source llmr::shaders[SHADER_COUNT] = {\n';
115+
code += 'const shader_source shaders[SHADER_COUNT] = {\n';
116116
code += lines.join(',\n');
117117
code += '\n};\n';
118+
code += '\n}\n';
118119
code += suffix + '\n';
119120

120-
var header_path = path.join(process.argv[2], 'include/llmr/shader/shaders.hpp');
121+
var header_path = path.join(process.argv[2], 'include/mbgl/shader/shaders.hpp');
121122
mkdirp.sync(path.dirname(header_path));
122123
fs.writeFileSync(header_path, header);
123124
console.warn('wrote file ' + header_path);

bin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "llmr-native",
2+
"name": "mbgl-native",
33
"version": "0.0.1",
44
"dependencies": {
55
"glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation"

common/curl_request.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
#include <llmr/platform/platform.hpp>
3-
#include <llmr/platform/request.hpp>
4-
#include <llmr/util/uv.hpp>
5-
#include <llmr/util/std.hpp>
2+
#include <mbgl/platform/platform.hpp>
3+
#include <mbgl/platform/request.hpp>
4+
#include <mbgl/util/uv.hpp>
5+
#include <mbgl/util/std.hpp>
66

77
#include <queue>
88
#include <boost/lockfree/queue.hpp>
@@ -47,7 +47,7 @@
4747
See http://nikhilm.github.com/uvbook/ for more information on libuv.
4848
*/
4949

50-
namespace llmr {
50+
namespace mbgl {
5151
namespace platform {
5252
namespace request {
5353

@@ -66,8 +66,8 @@ static uv_async_t async_cancel;
6666
// Stores pointers (!) to shared_ptrs. We use shared_ptrs so that request objects don't get
6767
// auto-destructed while they're in progress. The TileData object retains a weak_ptr to this
6868
// request, so we have to use a shared_ptr here to ensure that this object stays alive.
69-
static boost::lockfree::queue<std::shared_ptr<llmr::platform::Request> *> add_queue(8);
70-
static boost::lockfree::queue<std::shared_ptr<llmr::platform::Request> *> cancel_queue(8);
69+
static boost::lockfree::queue<std::shared_ptr<mbgl::platform::Request> *> add_queue(8);
70+
static boost::lockfree::queue<std::shared_ptr<mbgl::platform::Request> *> cancel_queue(8);
7171

7272
// Used as the CURL timer function to periodically check for socket updates.
7373
static uv_timer_t timeout;
@@ -85,10 +85,10 @@ static CURLSH *curl_share = nullptr;
8585
static std::queue<CURL *> curl_handle_cache;
8686

8787

88-
class CURLRequest : public llmr::platform::Request {
88+
class CURLRequest : public mbgl::platform::Request {
8989
public:
9090
CURLRequest(const std::string &url,
91-
std::function<void(llmr::platform::Response *)> callback,
91+
std::function<void(mbgl::platform::Response *)> callback,
9292
std::shared_ptr<uv::loop> loop)
9393
: Request(url, callback, loop) {}
9494

@@ -380,4 +380,4 @@ void platform::cancel_request_http(const std::shared_ptr<Request> &req) {
380380
uv_async_send(&async_cancel);
381381
}
382382
}
383-
} // end namespace llmr
383+
} // end namespace mbgl

common/foundation_request.mm

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include <memory>
1010
#include <string>
1111
#include <functional>
12-
#include <llmr/platform/request.hpp>
13-
#include <llmr/platform/platform.hpp>
14-
#include <llmr/util/std.hpp>
12+
#include <mbgl/platform/request.hpp>
13+
#include <mbgl/platform/platform.hpp>
14+
#include <mbgl/util/std.hpp>
1515
#include <uv.h>
1616

1717
uv_once_t request_initialize = UV_ONCE_INIT;
@@ -37,10 +37,10 @@ void request_initialize_cb() {
3737

3838
// We're using a child class to make sure ARC is working correctly, as well as to add activity
3939
// indicators on iOS.
40-
class FoundationRequest : public llmr::platform::Request {
40+
class FoundationRequest : public mbgl::platform::Request {
4141
public:
4242
FoundationRequest(const std::string &url,
43-
std::function<void(llmr::platform::Response *)> callback,
43+
std::function<void(mbgl::platform::Response *)> callback,
4444
std::shared_ptr<uv::loop> loop)
4545
: Request(url, callback, loop) {
4646
#if TARGET_OS_IPHONE
@@ -65,8 +65,8 @@ void request_initialize_cb() {
6565
NSURLSessionDataTask *task = nullptr;
6666
};
6767

68-
std::shared_ptr<llmr::platform::Request>
69-
llmr::platform::request_http(const std::string &url,
68+
std::shared_ptr<mbgl::platform::Request>
69+
mbgl::platform::request_http(const std::string &url,
7070
std::function<void(Response *)> callback,
7171
std::shared_ptr<uv::loop> loop) {
7272
uv_once(&request_initialize, request_initialize_cb);
@@ -109,7 +109,7 @@ void request_initialize_cb() {
109109
return req;
110110
}
111111

112-
void llmr::platform::cancel_request_http(const std::shared_ptr<Request> &req) {
112+
void mbgl::platform::cancel_request_http(const std::shared_ptr<Request> &req) {
113113
if (req) {
114114
[((FoundationRequest *)(req.get()))->task cancel];
115115
}

common/glfw_view.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {
88

99
GLFWView::~GLFWView() { glfwTerminate(); }
1010

11-
void GLFWView::initialize(llmr::Map *map) {
11+
void GLFWView::initialize(mbgl::Map *map) {
1212
View::initialize(map);
1313

1414
if (!glfwInit()) {
@@ -34,7 +34,7 @@ void GLFWView::initialize(llmr::Map *map) {
3434
glfwWindowHint(GLFW_STENCIL_BITS, 8);
3535
glfwWindowHint(GLFW_DEPTH_BITS, 16);
3636

37-
window = glfwCreateWindow(1024, 768, "llmr", monitor, NULL);
37+
window = glfwCreateWindow(1024, 768, "Mapbox GL", monitor, NULL);
3838
if (!window) {
3939
glfwTerminate();
4040
fprintf(stderr, "Failed to initialize window\n");
@@ -194,7 +194,7 @@ void GLFWView::swap() {
194194
glfwPostEmptyEvent();
195195
}
196196

197-
void GLFWView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) {
197+
void GLFWView::notify_map_change(mbgl::MapChange change, mbgl::timestamp delay) {
198198
// no-op
199199
}
200200

@@ -212,7 +212,7 @@ void GLFWView::fps() {
212212
}
213213
}
214214

215-
namespace llmr {
215+
namespace mbgl {
216216
namespace platform {
217217

218218
double elapsed() { return glfwGetTime(); }

common/glfw_view.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#ifndef LLMR_COMMON_GLFW_VIEW
2-
#define LLMR_COMMON_GLFW_VIEW
1+
#ifndef MBGL_COMMON_GLFW_VIEW
2+
#define MBGL_COMMON_GLFW_VIEW
33

4-
#include <llmr/llmr.hpp>
5-
#include <llmr/util/time.hpp>
4+
#include <mbgl/mbgl.hpp>
5+
#include <mbgl/util/time.hpp>
66

77
#ifdef NVIDIA
88
#define GLFW_INCLUDE_ES2
@@ -11,15 +11,15 @@
1111

1212
#include <uv.h>
1313

14-
class GLFWView : public llmr::View {
14+
class GLFWView : public mbgl::View {
1515
public:
1616
GLFWView(bool fullscreen = false);
1717
~GLFWView();
1818

19-
void initialize(llmr::Map *map);
19+
void initialize(mbgl::Map *map);
2020
void swap();
2121
void make_active();
22-
void notify_map_change(llmr::MapChange change, llmr::timestamp delay = 0);
22+
void notify_map_change(mbgl::MapChange change, mbgl::timestamp delay = 0);
2323

2424
static void key(GLFWwindow *window, int key, int scancode, int action, int mods);
2525
static void scroll(GLFWwindow *window, double xoffset, double yoffset);

common/headless_view.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "headless_view.hpp"
2-
#include <llmr/util/timer.hpp>
2+
#include <mbgl/util/timer.hpp>
33

4-
namespace llmr {
4+
namespace mbgl {
55

66
HeadlessView::HeadlessView() {
7-
#if LLMR_USE_CGL
7+
#if MBGL_USE_CGL
88
// TODO: test if OpenGL 4.1 with GL_ARB_ES2_compatibility is supported
99
// If it is, use kCGLOGLPVersion_3_2_Core and enable that extension.
1010
CGLPixelFormatAttribute attributes[] = {
@@ -30,7 +30,7 @@ HeadlessView::HeadlessView() {
3030
}
3131
#endif
3232

33-
#if LLMR_USE_GLX
33+
#if MBGL_USE_GLX
3434
x_display = XOpenDisplay(0);
3535

3636
if (x_display == nullptr) {
@@ -66,7 +66,7 @@ HeadlessView::HeadlessView() {
6666
void HeadlessView::resize(int width, int height) {
6767
clear_buffers();
6868

69-
#if LLMR_USE_CGL
69+
#if MBGL_USE_CGL
7070
make_active();
7171

7272
// Create depth/stencil buffer
@@ -101,7 +101,7 @@ void HeadlessView::resize(int width, int height) {
101101
}
102102
#endif
103103

104-
#if LLMR_USE_GLX
104+
#if MBGL_USE_GLX
105105
x_pixmap = XCreatePixmap(x_display, DefaultRootWindow(x_display), width, height, 32);
106106
glx_pixmap = glXCreateGLXPixmap(x_display, x_info, x_pixmap);
107107

@@ -111,7 +111,7 @@ void HeadlessView::resize(int width, int height) {
111111
}
112112

113113
void HeadlessView::clear_buffers() {
114-
#if LLMR_USE_CGL
114+
#if MBGL_USE_CGL
115115
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
116116

117117
if (fbo) {
@@ -130,7 +130,7 @@ void HeadlessView::clear_buffers() {
130130
}
131131
#endif
132132

133-
#if LLMR_USE_GLX
133+
#if MBGL_USE_GLX
134134
if (glx_pixmap) {
135135
glXDestroyGLXPixmap(x_display, glx_pixmap);
136136
glx_pixmap = 0;
@@ -146,24 +146,24 @@ void HeadlessView::clear_buffers() {
146146
HeadlessView::~HeadlessView() {
147147
clear_buffers();
148148

149-
#if LLMR_USE_CGL
149+
#if MBGL_USE_CGL
150150
CGLDestroyContext(gl_context);
151151
#endif
152152
}
153153

154-
void HeadlessView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) {
154+
void HeadlessView::notify_map_change(mbgl::MapChange change, mbgl::timestamp delay) {
155155
// no-op
156156
}
157157

158158
void HeadlessView::make_active() {
159-
#if LLMR_USE_CGL
159+
#if MBGL_USE_CGL
160160
CGLError error = CGLSetCurrentContext(gl_context);
161161
if (error) {
162162
fprintf(stderr, "Switching OpenGL context failed\n");
163163
}
164164
#endif
165165

166-
#if LLMR_USE_GLX
166+
#if MBGL_USE_GLX
167167
if (!glXMakeCurrent(x_display, glx_pixmap, gl_context)) {
168168
fprintf(stderr, "Switching OpenGL context failed\n");
169169
}
@@ -173,7 +173,7 @@ void HeadlessView::make_active() {
173173
void HeadlessView::swap() {}
174174

175175
unsigned int HeadlessView::root_fbo() {
176-
#if LLMR_USE_CGL
176+
#if MBGL_USE_CGL
177177
return fbo;
178178
#endif
179179

0 commit comments

Comments
 (0)