summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 22b446e6d0..e04f134f39 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -590,13 +590,14 @@ void Context::setDirtyState() {
void Context::clear(optional<mbgl::Color> color,
optional<float> depth,
- optional<int32_t> stencil) {
+ optional<int32_t> stencil,
+ optional<ColorMode::Mask> colorMask_) {
GLbitfield mask = 0;
if (color) {
mask |= GL_COLOR_BUFFER_BIT;
clearColor = *color;
- colorMask = { true, true, true, true };
+ colorMask = colorMask_ ? *colorMask_ : value::ColorMask::Default;
}
if (depth) {
@@ -612,6 +613,10 @@ void Context::clear(optional<mbgl::Color> color,
}
MBGL_CHECK_ERROR(glClear(mask));
+
+ if (colorMask_) {
+ colorMask = value::ColorMask::Default;
+ }
}
#if not MBGL_USE_GLES2