Make conversion from GL types to native bools consistant.
Some places would compare with "== GL_TRUE" and others with "!= GL_FALSE".
This behaviour is not in the OpenGL spec but "!= GL_FALSE" is the most
standard and follows the same rules as C and C++.
Remove un-necessary validation that params are either GL_TRUE or
GL_FALSE.
Update some internal storage from GLboolean to bool.
BUG=angleproject:2258
Change-Id: I12adbe2d24318a206521ca6ad1099ee7e2bf677e
Reviewed-on: https://chromium-review.googlesource.com/779799
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index 0ebaba9..48e7168 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -137,7 +137,7 @@
const FramebufferAttachment &attachment,
bool colorAttachment,
Optional<int> *samples,
- Optional<GLboolean> *fixedSampleLocations)
+ Optional<bool> *fixedSampleLocations)
{
ASSERT(attachment.isAttached());
@@ -150,8 +150,8 @@
// ES3.1 (section 9.4) requires that the value of TEXTURE_FIXED_SAMPLE_LOCATIONS should be
// the same for all attached textures.
- GLboolean fixedSampleloc = texture->getFixedSampleLocations(attachmentImageIndex.type,
- attachmentImageIndex.mipIndex);
+ bool fixedSampleloc = texture->getFixedSampleLocations(attachmentImageIndex.type,
+ attachmentImageIndex.mipIndex);
if (fixedSampleLocations->valid() && fixedSampleloc != fixedSampleLocations->value())
{
return false;
@@ -950,7 +950,7 @@
bool hasAttachments = false;
Optional<unsigned int> colorbufferSize;
Optional<int> samples;
- Optional<GLboolean> fixedSampleLocations;
+ Optional<bool> fixedSampleLocations;
bool hasRenderbuffer = false;
const FramebufferAttachment *firstAttachment = getFirstNonNullAttachment();
@@ -1852,7 +1852,7 @@
return mState.getDefaultSamples();
}
-GLboolean Framebuffer::getDefaultFixedSampleLocations() const
+bool Framebuffer::getDefaultFixedSampleLocations() const
{
return mState.getDefaultFixedSampleLocations();
}
@@ -1875,7 +1875,7 @@
mDirtyBits.set(DIRTY_BIT_DEFAULT_SAMPLES);
}
-void Framebuffer::setDefaultFixedSampleLocations(GLboolean defaultFixedSampleLocations)
+void Framebuffer::setDefaultFixedSampleLocations(bool defaultFixedSampleLocations)
{
mState.mDefaultFixedSampleLocations = defaultFixedSampleLocations;
mDirtyBits.set(DIRTY_BIT_DEFAULT_FIXED_SAMPLE_LOCATIONS);