Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release-ios-v3.6.0-android-v5.1.0' into merge_mapbox_v5_1
Browse files Browse the repository at this point in the history
* release-ios-v3.6.0-android-v5.1.0:
  [ios] Remove old Fabric build infrastructure
  [ios, macos] Revised descriptions for abstract classes (mapbox#9095)
  [core] Don't upload the FrameHistory texture in frames where it's not changing
  [core] Dynamic program compilation for data-driven properties
  [core] cleanup ProgramParameters
  [core] add constant DDS values as uniforms
  [core] add uniforms to DataDrivenPaintPropertys
  [core] add shader defines for enabling/disabling attributes/uniforms for DDS
  [core] only bind uniforms that exist in the program
  [core] store vertex attribute binding to prevent duplicate binds
  [core] Reduce number of varyings to 8 or less
  Cherry pick release (mapbox#9263)
  • Loading branch information
Tran Thuong Tien committed Jun 15, 2017
2 parents 509883a + 6cba15f commit 1787307
Show file tree
Hide file tree
Showing 61 changed files with 1,104 additions and 318 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mason_use(boost VERSION 1.62.0 HEADER_ONLY)
mason_use(geojsonvt VERSION 6.2.0 HEADER_ONLY)
mason_use(supercluster VERSION 0.2.0-1 HEADER_ONLY)
mason_use(kdbush VERSION 0.1.1-1 HEADER_ONLY)
mason_use(earcut VERSION 0.12.1 HEADER_ONLY)
mason_use(earcut VERSION 0.12.3 HEADER_ONLY)
mason_use(protozero VERSION 1.4.2 HEADER_ONLY)
mason_use(pixelmatch VERSION 0.10.0 HEADER_ONLY)
mason_use(geojson VERSION 0.4.0 HEADER_ONLY)
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@ iframework: $(IOS_PROJ_PATH)
FORMAT=dynamic BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=$(SYMBOLS) \
./platform/ios/scripts/package.sh

.PHONY: ifabric
ifabric: $(IOS_PROJ_PATH)
FORMAT=static BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=NO SELF_CONTAINED=YES \
./platform/ios/scripts/package.sh

.PHONY: ideploy
ideploy:
caffeinate -i ./platform/ios/scripts/deploy-packages.sh
Expand Down
1 change: 1 addition & 0 deletions cmake/core-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ set(MBGL_CORE_FILES
src/mbgl/programs/line_program.cpp
src/mbgl/programs/line_program.hpp
src/mbgl/programs/program.hpp
src/mbgl/programs/program_parameters.cpp
src/mbgl/programs/program_parameters.hpp
src/mbgl/programs/programs.hpp
src/mbgl/programs/raster_program.cpp
Expand Down
2 changes: 1 addition & 1 deletion include/mbgl/map/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Map : private util::noncopyable {
GLContextMode contextMode = GLContextMode::Unique,
ConstrainMode constrainMode = ConstrainMode::HeightOnly,
ViewportMode viewportMode = ViewportMode::Default,
const std::string& programCacheDir = "");
const optional<std::string>& programCacheDir = {});
~Map();

// Register a callback that will get called (on the render thread) when all resources have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.mapbox.mapboxsdk.style.light.Light;
import com.mapbox.mapboxsdk.style.sources.CannotAddSourceException;
import com.mapbox.mapboxsdk.style.sources.Source;
import com.mapbox.mapboxsdk.utils.BitmapUtils;
import com.mapbox.services.commons.geojson.Feature;

import java.nio.ByteBuffer;
Expand All @@ -39,7 +40,6 @@

import timber.log.Timber;


// Class that wraps the native methods for convenience
final class NativeMapView {

Expand Down Expand Up @@ -931,12 +931,20 @@ protected void onMapChanged(int rawChange) {
}

protected void onFpsChanged(double fps) {
if (isDestroyedOn("OnFpsChanged")) {
return;
}
mapView.onFpsChanged(fps);
}

protected void onSnapshotReady(Bitmap bitmap) {
if (snapshotReadyCallback != null && bitmap != null) {
snapshotReadyCallback.onSnapshotReady(bitmap);
protected void onSnapshotReady(Bitmap mapContent) {
if (isDestroyedOn("OnSnapshotReady")) {
return;
}

Bitmap viewContent = BitmapUtils.createBitmapFromView(mapView);
if (snapshotReadyCallback != null && mapContent != null && viewContent != null) {
snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.mapbox.mapboxsdk.utils;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.support.annotation.NonNull;
import android.view.View;

public class BitmapUtils {

public static Bitmap createBitmapFromView(@NonNull View view) {
view.setDrawingCacheEnabled(true);
view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW);
view.buildDrawingCache();

if (view.getDrawingCache() == null) {
return null;
}

Bitmap snapshot = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
view.destroyDrawingCache();
return snapshot;
}

public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) {
Bitmap result = Bitmap.createBitmap(background.getWidth(), background.getHeight(), background.getConfig());
Canvas canvas = new Canvas(result);
canvas.drawBitmap(background, 0f, 0f, null);
canvas.drawBitmap(foreground, 10, 10, null);
return result;
}

}
7 changes: 4 additions & 3 deletions platform/darwin/src/MGLForegroundStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
`MGLForegroundStyleLayer` is an abstract superclass for style layers whose
content is defined by an `MGLSource` object.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLRasterStyleLayer`
and the concrete subclasses of `MGLVectorStyleLayer`.
Create instances of `MGLRasterStyleLayer` and the concrete subclasses of
`MGLVectorStyleLayer` in order to use `MGLForegroundStyleLayer`'s methods.
Do not create instances of `MGLForegroundStyleLayer` directly, and do not
create your own subclasses of this class.
*/
MGL_EXPORT
@interface MGLForegroundStyleLayer : MGLStyleLayer
Expand Down
5 changes: 3 additions & 2 deletions platform/darwin/src/MGLMultiPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ NS_ASSUME_NONNULL_BEGIN
The `MGLMultiPoint` class is an abstract superclass used to define shapes
composed of multiple vertices.
You do not create instances of this class directly. Instead, you create
instances of the `MGLPolyline` or `MGLPolygon` classes. However, you can use
Create instances of `MGLPolyline` or `MGLPolygon` in order to use
properties of `MGLMultiPoint`. Do not create instances of `MGLMultiPoint`
directly and do not create your own subclasses of this class. You can use
the method and properties of this class to access information about the
vertices of the line or polygon.
Expand Down
10 changes: 5 additions & 5 deletions platform/darwin/src/MGLShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ NS_ASSUME_NONNULL_BEGIN
constitute the content of a map – not only the overlays atop the map, but also
the content that forms the base map.
You do not create instances of this class directly or create subclasses of this
class. Instead, you create instances of `MGLPointAnnotation`,
`MGLPointCollection`, `MGLPolyline`, `MGLMultiPolyline`, `MGLPolygon`,
`MGLMultiPolygon`, or `MGLShapeCollection`. The shape classes correspond to the
<a href="https://tools.ietf.org/html/rfc7946#section-3.1">Geometry</a> object
Create instances of `MGLPointAnnotation`, `MGLPointCollection`, `MGLPolyline`,
`MGLMultiPolyline`, `MGLPolygon`, `MGLMultiPolygon`, or `MGLShapeCollection` in
order to use `MGLShape`'s methods. Do not create instances of `MGLShape` directly,
and do not create your own subclasses of this class. The shape classes correspond
to the <a href="https://tools.ietf.org/html/rfc7946#section-3.1">Geometry</a> object
types in the GeoJSON standard, but some have nonstandard names for backwards
compatibility.
Expand Down
7 changes: 4 additions & 3 deletions platform/darwin/src/MGLSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
add and remove sources dynamically using methods such as
`-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLShapeSource` and the
concrete subclasses of `MGLTileSource`, `MGLVectorSource` and `MGLRasterSource`.
Create instances of `MGLShapeSource` and the concrete subclasses of
`MGLTileSource`, `MGLVectorSource` and `MGLRasterSource` in order to use
`MGLMultiPoint`'s properties and methods. Do not create instances of `MGLSource`
directly, and do not create your own subclasses of this class.
*/
MGL_EXPORT
@interface MGLSource : NSObject
Expand Down
8 changes: 4 additions & 4 deletions platform/darwin/src/MGLStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ NS_ASSUME_NONNULL_BEGIN
`MGLStyleLayer` object, which you can use to refine the map’s appearance. You
can also add and remove style layers dynamically.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of
`MGLBackgroundStyleLayer` and the concrete subclasses of
`MGLForegroundStyleLayer`.
Create instances of `MGLBackgroundStyleLayer` and the concrete subclasses of
`MGLForegroundStyleLayer` in order to use `MGLStyleLayer`'s properties and methods.
You do not create instances of `MGLStyleLayer` directly, and do not
create your own subclasses of this class.
Do not add `MGLStyleLayer` objects to the `style` property of a `MGLMapView` before
`-mapView:didFinishLoadingStyle:` is called.
Expand Down
9 changes: 4 additions & 5 deletions platform/darwin/src/MGLStyleValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,10 @@ MGL_EXPORT
defined by an `MGLCameraStyleFunction`, `MGLSourceStyleFunction`, or
`MGLCompositeStyleFunction` object.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, use one of the class factory methods in
`MGLStyleValue` to create instances of the following concrete subclasses:
`MGLCameraStyleFunction`, `MGLSourceStyleFunction`, and
`MGLCompositeStyleFunction`.
Create instances of `MGLCameraStyleFunction`, `MGLSourceStyleFunction`, and
`MGLCompositeStyleFunction` in order to use `MGLStyleFunction`'s methods. Do
not create instances of `MGLStyleFunction` directly, and do not create your
own subclasses of this class.
The `MGLStyleFunction` class takes a generic parameter `T` that indicates the
Foundation class being wrapped by this class.
Expand Down
6 changes: 3 additions & 3 deletions platform/darwin/src/MGLTileSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) {
Mapbox-hosted tile set, view it in
<a href="https://www.mapbox.com/studio/tilesets/">Mapbox Studio’s Tilesets editor</a>.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLRasterSource` and
`MGLVectorSource`.
Create instances of `MGLRasterSource` and `MGLVectorSource` in order to use
`MGLTileSource`'s properties and methods. Do not create instances of `MGLTileSource`
directly, and do not create your own subclasses of this class.
*/
MGL_EXPORT
@interface MGLTileSource : MGLSource
Expand Down
8 changes: 4 additions & 4 deletions platform/darwin/src/MGLVectorStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ NS_ASSUME_NONNULL_BEGIN
`MGLVectorStyleLayer` is an abstract superclass for style layers whose content
is defined by an `MGLShapeSource` or `MGLVectorSource` object.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of the following concrete
subclasses: `MGLCircleStyleLayer`, `MGLFillStyleLayer`, `MGLLineStyleLayer`,
and `MGLSymbolStyleLayer`.
Create instances of `MGLCircleStyleLayer`, `MGLFillStyleLayer`, `MGLLineStyleLayer`,
and `MGLSymbolStyleLayer` in order to use `MGLVectorStyleLayer`'s properties and
methods. Do not create instances of `MGLVectorStyleLayer` directly, and do not
create your own subclasses of this class.
*/
MGL_EXPORT
@interface MGLVectorStyleLayer : MGLForegroundStyleLayer
Expand Down
1 change: 0 additions & 1 deletion platform/ios/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Build and package the SDK by using one of the following commands:
* `make iframework` builds a dynamic framework in the Debug configuration for devices and the iOS Simulator. The CocoaPods pod downloads the output of this target.
* `make ipackage-sim` builds a dynamic framework in the Debug configuration for the iOS simulator. This is the fastest target.
* `make ipackage-strip` builds both dynamic and static frameworks in the Debug configuration, stripped of debug symbols, for devices and the iOS Simulator.
* `make ifabric` builds a special static framework for compatibility with the Fabric Mac application.

You can customize the build output by passing the following arguments into the `make` invocation:

Expand Down
1 change: 0 additions & 1 deletion platform/ios/scripts/deploy-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,5 @@ buildPackageStyle "ipackage" "symbols"
buildPackageStyle "ipackage-strip"
buildPackageStyle "iframework" "symbols-dynamic"
buildPackageStyle "iframework SYMBOLS=NO" "dynamic"
buildPackageStyle "ifabric" "fabric"

step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds"
37 changes: 0 additions & 37 deletions platform/ios/scripts/release-fabric.sh

This file was deleted.

2 changes: 1 addition & 1 deletion platform/ios/src/MGLUserLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The MGLUserLocation class defines a specific type of annotation that identifies
the user’s current location. You do not create instances of this class
directly. Instead, you retrieve an existing MGLUserLocation object from the
directly. Instead, you retrieve an existing `MGLUserLocation` object from the
`userLocation` property of the map view displayed in your application.
*/
@interface MGLUserLocation : NSObject <MGLAnnotation, NSSecureCoding>
Expand Down
Loading

0 comments on commit 1787307

Please sign in to comment.