Make angle::Result an enum.
This moves away from a class type to a value type. This should improve
performance when using angle::Result as a return value. Previously the
generated code would return a pointer instead of a value.
Improves performance in the most targeted microbenchmark by 10%. In
more realistic scanarios it will have a smaller improvement. Also
simplifies the class implementation and usage.
Includes some unrelated code generation changes.
Bug: angleproject:2491
Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa
Reviewed-on: https://chromium-review.googlesource.com/c/1356139
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/gl/FramebufferGL.cpp b/src/libANGLE/renderer/gl/FramebufferGL.cpp
index dd3b413..147e63b 100644
--- a/src/libANGLE/renderer/gl/FramebufferGL.cpp
+++ b/src/libANGLE/renderer/gl/FramebufferGL.cpp
@@ -245,7 +245,7 @@
finalAttachmentsPtr);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::invalidateSub(const gl::Context *context,
@@ -275,7 +275,7 @@
area.height);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::clear(const gl::Context *context, GLbitfield mask)
@@ -298,7 +298,7 @@
GL_NONE, 0, nullptr, 0.0f, 0);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::clearBufferfv(const gl::Context *context,
@@ -325,7 +325,7 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::clearBufferuiv(const gl::Context *context,
@@ -352,7 +352,7 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::clearBufferiv(const gl::Context *context,
@@ -379,7 +379,7 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::clearBufferfi(const gl::Context *context,
@@ -407,7 +407,7 @@
nullptr, depth, stencil);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
GLenum FramebufferGL::getImplementationColorReadFormat(const gl::Context *context) const
@@ -442,7 +442,7 @@
if (!ClipRectangle(area, fbRect, &clippedArea))
{
// nothing to read
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
PixelPackState packState = context->getGLState().getPackState();
@@ -581,7 +581,7 @@
if (blitMask == 0)
{
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
const FramebufferGL *sourceFramebufferGL = GetImplAs<FramebufferGL>(sourceFramebuffer);
@@ -592,7 +592,7 @@
destArea.x, destArea.y, destArea.x1(), destArea.y1(), blitMask,
filter);
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::getSamplePosition(const gl::Context *context,
@@ -604,7 +604,7 @@
stateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
functions->getMultisamplefv(GL_SAMPLE_POSITION, static_cast<GLuint>(index), xy);
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
bool FramebufferGL::checkStatus(const gl::Context *context) const
@@ -627,7 +627,7 @@
// Don't need to sync state for the default FBO.
if (mIsDefault)
{
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
const FunctionsGL *functions = GetFunctionsGL(context);
@@ -721,7 +721,7 @@
getState());
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
GLuint FramebufferGL::getFramebufferID() const
@@ -898,7 +898,7 @@
pixels += rowBytes;
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
angle::Result FramebufferGL::readPixelsAllAtOnce(const gl::Context *context,
@@ -940,6 +940,6 @@
pixels);
}
- return angle::Result::Continue();
+ return angle::Result::Continue;
}
} // namespace rx