diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-10 17:18:18 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-14 12:29:01 -0600 |
commit | 94f011895c8e1bde36ee2ec235dbbcf2c994ac4c (patch) | |
tree | 9a9724792f87eb3c74aa2ac3d3114ca45d91471b /src/mbgl/renderer | |
parent | c6d5eaf47941162ee6166842d5434a0e3a6c33a0 (diff) | |
download | qtlocation-mapboxgl-94f011895c8e1bde36ee2ec235dbbcf2c994ac4c.tar.gz |
[core] Make Image safer
Provide Image::copy, which handles copying rectangles from a source to a destination, with thorough bounds checking.
Also fixes an indexing error in SpriteAtlas, where the top row of pixels in a wrapped image was copied from the wrong source row.
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r-- | src/mbgl/renderer/frame_history.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/frame_history.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/renderer/frame_history.cpp b/src/mbgl/renderer/frame_history.cpp index 1ee53d87b2..a933a9004a 100644 --- a/src/mbgl/renderer/frame_history.cpp +++ b/src/mbgl/renderer/frame_history.cpp @@ -8,7 +8,7 @@ namespace mbgl { FrameHistory::FrameHistory() { changeOpacities.fill(0); - std::fill(opacities.data.get(), opacities.data.get() + opacities.bytes(), 0); + opacities.fill(0); } void FrameHistory::record(const TimePoint& now, float zoom, const Duration& duration) { diff --git a/src/mbgl/renderer/frame_history.hpp b/src/mbgl/renderer/frame_history.hpp index fffbd113ed..f2b11f5f41 100644 --- a/src/mbgl/renderer/frame_history.hpp +++ b/src/mbgl/renderer/frame_history.hpp @@ -26,7 +26,7 @@ public: private: std::array<TimePoint, 256> changeTimes; std::array<uint8_t, 256> changeOpacities; - const AlphaImage opacities{ { 256, 1 } }; + AlphaImage opacities{ { 256, 1 } }; int16_t previousZoomIndex = 0; TimePoint previousTime; |