Revert "[core] Don't use GL_LINEAR if panning w/o rotation nor pitch"

This reverts commit a70bfd8910.
This commit is contained in:
Bruno de Oliveira Abinader
2016-11-01 01:18:20 +02:00
parent bb6e39a1cf
commit e2981c890e
5 changed files with 7 additions and 17 deletions

View File

@@ -409,6 +409,7 @@ void Map::cancelTransitions() {
void Map::setGestureInProgress(bool inProgress) {
impl->transform.setGestureInProgress(inProgress);
impl->onUpdate(Update::Repaint);
}
bool Map::isGestureInProgress() const {

View File

@@ -175,6 +175,10 @@ float TransformState::getPitch() const {
#pragma mark - State
bool TransformState::isChanging() const {
return rotating || scaling || panning || gestureInProgress;
}
bool TransformState::isRotating() const {
return rotating;
}

View File

@@ -60,6 +60,7 @@ public:
float getPitch() const;
// State
bool isChanging() const;
bool isRotating() const;
bool isScaling() const;
bool isPanning() const;

View File

@@ -70,7 +70,7 @@ void Painter::renderSymbol(PaintParameters& parameters,
SpriteAtlas& atlas = *layer.impl->spriteAtlas;
const bool iconScaled = values.paintSize != 1.0f || frame.pixelRatio != atlas.getPixelRatio() || bucket.iconsNeedLinear;
const bool iconTransformed = values.rotationAlignment == AlignmentType::Map || state.getPitch() != 0;
atlas.bind(bucket.sdfIcons || state.isScaling() || state.isRotating() || iconScaled || iconTransformed, context, 0);
atlas.bind(bucket.sdfIcons || state.isChanging() || iconScaled || iconTransformed, context, 0);
std::array<uint16_t, 2> texsize {{ atlas.getWidth(), atlas.getHeight() }};

View File

@@ -49,7 +49,6 @@ TEST(Annotations, SymbolAnnotation) {
auto screenBox = ScreenBox { {}, { double(size.width), double(size.height) } };
auto features = test.map.queryPointAnnotations(screenBox);
EXPECT_EQ(features.size(), 1u);
test.checkRendering("point_annotation");
test.map.setZoom(test.map.getMaxZoom());
test.checkRendering("point_annotation");
@@ -58,21 +57,6 @@ TEST(Annotations, SymbolAnnotation) {
EXPECT_EQ(features.size(), 1u);
}
TEST(Annotations, SymbolLinearInterpolation)
{
AnnotationTest test;
test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
test.map.addAnnotationIcon("default_marker", namedMarker("default_marker.png"));
test.map.addAnnotation(SymbolAnnotation { Point<double>(0.15, 0.15), "default_marker" });
test.checkRendering("point_annotation");
// Should not trigger GL_LINEAR when binding the symbol shader.
test.map.setGestureInProgress(true);
test.map.moveBy({});
test.checkRendering("point_annotation");
}
TEST(Annotations, LineAnnotation) {
AnnotationTest test;