Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
[android] a fresh attempt at android support using libc++/clang - refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer authored and ljbade committed Oct 18, 2014
1 parent d54809b commit df743f8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install:
- ./scripts/travis_install.sh

before_script:
- rm -rf mapnik-packaging/out/packages
- true

script:
- ./scripts/travis_script.sh
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ xtest: config.gypi clear_xcode_cache node

##### Makefile builds ##########################################################

android: llmr.gyp node
export PLATFORM=Android && ./setup-libraries.sh
deps/run_gyp llmr.gyp --depth=. -Goutput_dir=.. --generator-output=./build/android -f make-android
$(MAKE) -C ./build/android BUILDTYPE=$(BUILDTYPE) V=$(V) llmr-x86

# Builds the linux app with make.
linux: config.gypi linux/mapboxgl-app.gyp node
Expand Down
3 changes: 3 additions & 0 deletions include/mbgl/platform/gl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#else
#error Unsupported Apple platform
#endif
#elif __ANDROID__
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
Expand Down
16 changes: 15 additions & 1 deletion setup-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,21 @@ cd ./osx/

export CXX11=true

if [ ${UNAME} = 'Darwin' ]; then
if [ ${PLATFORM} = 'Android' ]; then
source Android.sh
#if [ ! -f out/build-cpp11-libstdcpp-gcc-arm/bin/pkg_config ] ; then ./scripts/build_pkg_config.sh ; fi
if [ ! -f out/build-cpp11-libstdcpp-gcc-arm/lib/libpng.a ] ; then ./scripts/build_png.sh ; fi
if [ ! -f out/build-cpp11-libstdcpp-gcc-arm/lib/libuv.a ] ; then ./scripts/build_libuv.sh ; fi
if [ ! -d out/build-cpp11-libstdcpp-gcc-arm/include/boost ] ; then ./scripts/build_boost.sh `pwd`/../../src/ `pwd`/../../include/ `pwd`/../$
echo ' ...done'

cd ../../
./configure \
--pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-arm/lib/pkgconfig \
--boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-arm


elif [ ${UNAME} = 'Darwin' ]; then

if [[ -n ${TRAVIS:-} ]]; then
if aws s3 cp s3://mapbox-gl-testing/dependencies/build-cpp11-libcpp-osx_${MP_HASH}_${DIR_HASH}.tar.gz ./out/ ; then
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/painter_prerender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void Painter::preparePrerender(RasterBucket &bucket) {
glDisable(GL_STENCIL_TEST);

// Render the actual tile.
#if GL_EXT_discard_framebuffer
#if GL_EXT_discard_framebuffer && !__ANDROID__
const GLenum discards[] = {GL_COLOR_ATTACHMENT0};
glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/prerendered_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) {
for (int i = 0; i < passes; i++) {
// Render horizontal
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, secondary_texture, 0);
#if GL_EXT_discard_framebuffer
#if GL_EXT_discard_framebuffer && !__ANDROID__
const GLenum discards[] = { GL_COLOR_ATTACHMENT0 };
glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards);
#endif
Expand All @@ -132,7 +132,7 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) {

// Render vertical
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, original_texture, 0);
#if GL_EXT_discard_framebuffer
#if GL_EXT_discard_framebuffer && !__ANDROID__
glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards);
#endif
glClear(GL_COLOR_BUFFER_BIT);
Expand Down

0 comments on commit df743f8

Please sign in to comment.