Hash :
41b072b6
Author :
Date :
2018-02-09T10:01:32
Prepare for -Wimplicit-fallthrough in ANGLE.
Disable the warning for flex-generated output, which contains
lots of intentional fallthrough.
Fixes a bug where GL_SAMPLE_ALPHA_TO_ONE_EXT would fall through
to GL_COVERAGE_MODULATION_CHROMIUM and hence behave like that.
Fixes a bug in the D3D9 state management where invalidating
DIRTY_BIT_POLYGON_OFFSET would also invalidate the stencil bits.
One somewhat common incorrect pattern in ANGLE is nested switch
statements that look like so:
switch (a) {
case a1:
switch (b) {
case b1:
...
break;
}
case a2:
...
}
The assumption here seems to be that the breakk exits the outer
case (here a1), while it in fact only exits the inner switch,
so that we fall through to a2. In most places, I fixed this
by adding an explicit `break` after the inner switch.
This fixes a bug wher GL_PATH_JOIN_STYLE_CHROMIUM would fall through to
GL_PATH_MITER_LIMIT_CHROMIUM in validation (but since the join style
enum is always > 0, this happened to not have an effect in practice).
This also fixes 87 bugs in GetLoadFunctionsMap() where invalid
values would previously return an unrelated function map instead
of the empty load function map.
Bug: chromium:810767
Change-Id: Ib51388c73fbfc229160e2c10f8fb9364cc7c996c
Reviewed-on: https://chromium-review.googlesource.com/911529
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// aligned_memory: Defines ANGLE_FALLTHROUGH. Do not include in public headers.
//
#ifndef COMMON_ANGLE_FALLTHROUGH_H_
#define COMMON_ANGLE_FALLTHROUGH_H_
// When clang suggests inserting [[clang::fallthrough]], it first checks if
// it knows of a macro expanding to it, and if so suggests inserting the
// macro. This means that this macro must be used only in code internal
// to ANGLE, so that ANGLE's user code doesn't end up getting suggestions
// for ANGLE_FALLTHROUGH instead of the user-specific fallthrough macro.
// So do not include this header in any of ANGLE's public headers.
#if defined(__clang__)
#define ANGLE_FALLTHROUGH [[clang::fallthrough]]
#else
#define ANGLE_FALLTHROUGH
#endif
#endif // COMMON_ANGLE_FALLTHROUGH_H_