Revert "[core] Expose ColorMask in gl::Context::clear()"

This reverts commit e350ef37fe.
This commit is contained in:
Bruno de Oliveira Abinader
2017-11-02 14:16:54 +02:00
parent f13a8b0afa
commit 13ec2cc562
3 changed files with 6 additions and 14 deletions

View File

@@ -590,33 +590,28 @@ void Context::setDirtyState() {
void Context::clear(optional<mbgl::Color> color,
optional<float> depth,
optional<int32_t> stencil,
optional<ColorMode::Mask> colorMask_) {
optional<int32_t> stencil) {
GLbitfield mask = 0;
if (color) {
mask |= GL_COLOR_BUFFER_BIT;
clearColor = *color;
colorMask = colorMask_ ? *colorMask_ : value::ColorMask::Default;
colorMask = value::ColorMask::Default;
}
if (depth) {
mask |= GL_DEPTH_BUFFER_BIT;
clearDepth = *depth;
depthMask = true;
depthMask = value::DepthMask::Default;
}
if (stencil) {
mask |= GL_STENCIL_BUFFER_BIT;
clearStencil = *stencil;
stencilMask = 0xFF;
stencilMask = value::StencilMask::Default;
}
MBGL_CHECK_ERROR(glClear(mask));
if (colorMask_) {
colorMask = value::ColorMask::Default;
}
}
#if not MBGL_USE_GLES2

View File

@@ -146,8 +146,7 @@ public:
void clear(optional<mbgl::Color> color,
optional<float> depth,
optional<int32_t> stencil,
optional<ColorMode::Mask> colorMask = value::ColorMask::Default);
optional<int32_t> stencil);
void setDrawMode(const Points&);
void setDrawMode(const Lines&);

View File

@@ -443,9 +443,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
if (parameters.debugOptions & MapDebugOptions::Overdraw) {
parameters.context.clear(Color::black(), ClearDepth::Default, ClearStencil::Default);
} else if (parameters.contextMode == GLContextMode::Shared) {
// Preserve the shared context background colors, clearing only alpha.
optional<gl::ColorMode::Mask> mask = { { false, false, false, true } };
parameters.context.clear(backgroundColor, ClearDepth::Default, ClearStencil::Default, mask);
parameters.context.clear({}, ClearDepth::Default, ClearStencil::Default);
} else {
parameters.context.clear(backgroundColor, ClearDepth::Default, ClearStencil::Default);
}