[core] Update gl-js for shader change

This commit is contained in:
John Firebaugh
2016-12-22 17:02:40 -08:00
parent 083cee8956
commit 65c28deefe
7 changed files with 13 additions and 14 deletions

View File

@@ -23,7 +23,7 @@
"express": "^4.11.1",
"lodash": "^4.16.4",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#49e8b407bdbbe6f7c92dbcb56d3d51f425fc2653",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#da53a81453068f4c2b440f9077d6bd5e7e14ff3d",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#2bdca923fc4190156b5a22af71be29442451db54",
"mkdirp": "^0.5.1",
"node-cmake": "^1.2.1",
"pixelmatch": "^4.0.2",

View File

@@ -11,8 +11,7 @@ namespace mbgl {
namespace uniforms {
MBGL_DEFINE_UNIFORM_SCALAR(gl::TextureUnit, u_image0);
MBGL_DEFINE_UNIFORM_SCALAR(gl::TextureUnit, u_image1);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_opacity0);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_opacity1);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_fade_t);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_buffer_scale);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_brightness_low);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_brightness_high);
@@ -35,8 +34,8 @@ class RasterProgram : public Program<
uniforms::u_matrix,
uniforms::u_image0,
uniforms::u_image1,
uniforms::u_opacity0,
uniforms::u_opacity1,
uniforms::u_opacity,
uniforms::u_fade_t,
uniforms::u_brightness_low,
uniforms::u_brightness_high,
uniforms::u_saturation_factor,

View File

@@ -64,8 +64,8 @@ void Painter::renderRaster(PaintParameters& parameters,
uniforms::u_matrix::Value{ tile.matrix },
uniforms::u_image0::Value{ 0 },
uniforms::u_image1::Value{ 1 },
uniforms::u_opacity0::Value{ properties.get<RasterOpacity>() },
uniforms::u_opacity1::Value{ 0 },
uniforms::u_opacity::Value{ properties.get<RasterOpacity>() },
uniforms::u_fade_t::Value{ 1 },
uniforms::u_brightness_low::Value{ properties.get<RasterBrightnessMin>() },
uniforms::u_brightness_high::Value{ properties.get<RasterBrightnessMax>() },
uniforms::u_saturation_factor::Value{ saturationFactor(properties.get<RasterSaturation>()) },

View File

@@ -8,12 +8,11 @@ namespace mbgl {
using namespace style;
RasterBucket::RasterBucket(PremultipliedImage&& image_) : image(std::move(image_)) {
RasterBucket::RasterBucket(UnassociatedImage&& image_) : image(std::move(image_)) {
}
void RasterBucket::upload(gl::Context& context) {
texture = context.createTexture(image);
image = {};
texture = context.createTexture(std::move(image));
uploaded = true;
}

View File

@@ -9,13 +9,13 @@ namespace mbgl {
class RasterBucket : public Bucket {
public:
RasterBucket(PremultipliedImage&&);
RasterBucket(UnassociatedImage&&);
void upload(gl::Context&) override;
void render(Painter&, PaintParameters&, const style::Layer&, const RenderTile&) override;
bool hasData() const override;
PremultipliedImage image;
UnassociatedImage image;
optional<gl::Texture> texture;
};

View File

@@ -2,6 +2,7 @@
#include <mbgl/tile/raster_tile.hpp>
#include <mbgl/renderer/raster_bucket.cpp>
#include <mbgl/actor/actor.hpp>
#include <mbgl/util/premultiply.hpp>
namespace mbgl {
@@ -16,7 +17,7 @@ void RasterTileWorker::parse(std::shared_ptr<const std::string> data) {
}
try {
auto bucket = std::make_unique<RasterBucket>(decodeImage(*data));
auto bucket = std::make_unique<RasterBucket>(util::unpremultiply(decodeImage(*data)));
parent.invoke(&RasterTile::onParsed, std::move(bucket));
} catch (...) {
parent.invoke(&RasterTile::onError, std::current_exception());