Remove gl::LinkResult.
Instead of returning a small struct from LinkProgram calls we use
angle::Result. Linking can have 3 cases:
- the link was successful -> angle::Result::Continue
- the link failed -> angle::Result::Incomplete
- there was an internal error -> angle::Result::Stop
Note that any unexpected Incomplete is still an error. Each function
that accepts Incomplete must check explicitly.
This is the last user of ErrorOrResult.
Bug: angleproject:2491
Change-Id: Idba23be27efe4b561720a4bdd8fe486b40779497
Reviewed-on: https://chromium-review.googlesource.com/c/1255645
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
diff --git a/src/libANGLE/renderer/ProgramImpl.h b/src/libANGLE/renderer/ProgramImpl.h
index 16c6523..29dad70 100644
--- a/src/libANGLE/renderer/ProgramImpl.h
+++ b/src/libANGLE/renderer/ProgramImpl.h
@@ -42,7 +42,7 @@
//
// Waits until the linking is actually done. Returns true if the linking
// succeeded, false otherwise.
- virtual bool wait() = 0;
+ virtual angle::Result wait(const gl::Context *context) = 0;
// Peeks whether the linking is still ongoing.
virtual bool isLinking() = 0;
};
@@ -51,12 +51,12 @@
class LinkEventDone final : public LinkEvent
{
public:
- LinkEventDone(const gl::LinkResult &result) : mResult(result) {}
- bool wait() override { return (!mResult.isError() && mResult.getResult()); }
+ LinkEventDone(angle::Result result) : mResult(result) {}
+ angle::Result wait(const gl::Context *context) override { return mResult; }
bool isLinking() override { return false; }
private:
- gl::LinkResult mResult;
+ angle::Result mResult;
};
class ProgramImpl : angle::NonCopyable
@@ -66,9 +66,9 @@
virtual ~ProgramImpl() {}
virtual gl::Error destroy(const gl::Context *context) { return gl::NoError(); }
- virtual gl::LinkResult load(const gl::Context *context,
- gl::InfoLog &infoLog,
- gl::BinaryInputStream *stream) = 0;
+ virtual angle::Result load(const gl::Context *context,
+ gl::InfoLog &infoLog,
+ gl::BinaryInputStream *stream) = 0;
virtual void save(const gl::Context *context, gl::BinaryOutputStream *stream) = 0;
virtual void setBinaryRetrievableHint(bool retrievable) = 0;
virtual void setSeparable(bool separable) = 0;