Skip to content

Commit

Permalink
Backed out changeset 9438150c5258 (bug 1262265) for mass android test…
Browse files Browse the repository at this point in the history
… bustage CLOSED TREE

MozReview-Commit-ID: FsPsAyGT3Vi
  • Loading branch information
KWierso committed Apr 11, 2016
1 parent 4ad21a6 commit 26e2190
Show file tree
Hide file tree
Showing 9 changed files with 1,103 additions and 888 deletions.
2 changes: 1 addition & 1 deletion dom/canvas/WebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ CheckContextLost(GLContext* gl, bool* const out_isGuilty)
bool isEGL = gl->GetContextType() == gl::GLContextType::EGL;

GLenum resetStatus = LOCAL_GL_NO_ERROR;
if (gl->IsSupported(GLFeature::robustness)) {
if (gl->HasRobustness()) {
gl->MakeCurrent();
resetStatus = gl->fGetGraphicsResetStatus();
} else if (isEGL) {
Expand Down
1,934 changes: 1,068 additions & 866 deletions gfx/gl/GLContext.cpp

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions gfx/gl/GLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ class GLContext
}

protected:
bool mInitialized;
bool mIsOffscreen;
bool mContextLost;

Expand All @@ -358,8 +359,8 @@ class GLContext
GLRenderer mRenderer;

void SetProfileVersion(ContextProfile profile, uint32_t version) {
MOZ_ASSERT(!mSymbols.fBindFramebuffer,
"SetProfileVersion can only be called before initialization!");
MOZ_ASSERT(!mInitialized, "SetProfileVersion can only be called before"
" initialization!");
MOZ_ASSERT(profile != ContextProfile::Unknown &&
profile != ContextProfile::OpenGL,
"Invalid `profile` for SetProfileVersion");
Expand Down Expand Up @@ -553,16 +554,23 @@ class GLContext

// -----------------------------------------------------------------------------
// Robustness handling
private:
public:
bool HasRobustness() const {
return mHasRobustness;
}

/**
* The derived class is expected to provide information on whether or not it
* supports robustness.
*/
virtual bool SupportsRobustness() const = 0;

public:
private:
bool mHasRobustness;

// -----------------------------------------------------------------------------
// Error handling
public:
static const char* GLErrorToString(GLenum aError) {
switch (aError) {
case LOCAL_GL_INVALID_ENUM:
Expand Down Expand Up @@ -2213,6 +2221,8 @@ class GLContext
}

GLenum fGetGraphicsResetStatus() {
MOZ_ASSERT(mHasRobustness);

BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetGraphicsResetStatus);
GLenum ret = mSymbols.fGetGraphicsResetStatus();
Expand Down Expand Up @@ -3500,17 +3510,8 @@ class GLContext
bool IsOffscreenSizeAllowed(const gfx::IntSize& aSize) const;

protected:
bool InitWithPrefix(const char* prefix, bool trygl);
bool InitWithPrefix(const char *prefix, bool trygl);

private:
bool InitWithPrefixImpl(const char* prefix, bool trygl);
void LoadMoreSymbols(const char* prefix, bool trygl);
bool LoadExtSymbols(const char* prefix, bool trygl, const SymLoadStruct* list,
GLExtensions ext);
bool LoadFeatureSymbols(const char* prefix, bool trygl, const SymLoadStruct* list,
GLFeature feature);

protected:
void InitExtensions();

GLint mViewportRect[4];
Expand Down
2 changes: 1 addition & 1 deletion gfx/gl/GLContextCGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GLContextCGL : public GLContext

virtual bool IsDoubleBuffered() const override;

virtual bool SupportsRobustness() const override { return false; }
virtual bool SupportsRobustness() const override;

virtual bool SwapBuffers() override;
};
Expand Down
2 changes: 1 addition & 1 deletion gfx/gl/GLContextEAGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GLContextEAGL : public GLContext

virtual bool IsDoubleBuffered() const override;

virtual bool SupportsRobustness() const override { return false; }
virtual bool SupportsRobustness() const override;

virtual bool SwapBuffers() override;

Expand Down
6 changes: 6 additions & 0 deletions gfx/gl/GLContextProviderCGL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ bool UseDoubleBufferedWindows() const {
return sCGLLibrary.UseDoubleBufferedWindows();
}

bool
GLContextCGL::SupportsRobustness() const
{
return false;
}

bool
GLContextCGL::SwapBuffers()
{
Expand Down
6 changes: 6 additions & 0 deletions gfx/gl/GLContextProviderEAGL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
return true;
}

bool
GLContextEAGL::SupportsRobustness() const
{
return false;
}

bool
GLContextEAGL::SwapBuffers()
{
Expand Down
6 changes: 3 additions & 3 deletions gfx/gl/GLLibraryLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GLLibraryLoader::OpenLibrary(const char *library)
}

bool
GLLibraryLoader::LoadSymbols(const SymLoadStruct *firstStruct,
GLLibraryLoader::LoadSymbols(SymLoadStruct *firstStruct,
bool tryplatform,
const char *prefix,
bool warnOnFailure)
Expand Down Expand Up @@ -64,15 +64,15 @@ GLLibraryLoader::LookupSymbol(PRLibrary *lib,

bool
GLLibraryLoader::LoadSymbols(PRLibrary *lib,
const SymLoadStruct *firstStruct,
SymLoadStruct *firstStruct,
PlatformLookupFunction lookupFunction,
const char *prefix,
bool warnOnFailure)
{
char sbuf[MAX_SYMBOL_LENGTH * 2];
int failCount = 0;

const SymLoadStruct *ss = firstStruct;
SymLoadStruct *ss = firstStruct;
while (ss->symPointer) {
*ss->symPointer = 0;

Expand Down
4 changes: 2 additions & 2 deletions gfx/gl/GLLibraryLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GLLibraryLoader
const char *symNames[MAX_SYMBOL_NAMES];
} SymLoadStruct;

bool LoadSymbols(const SymLoadStruct *firstStruct,
bool LoadSymbols(SymLoadStruct *firstStruct,
bool tryplatform = false,
const char *prefix = nullptr,
bool warnOnFailure = true);
Expand All @@ -47,7 +47,7 @@ class GLLibraryLoader
const char *symname,
PlatformLookupFunction lookupFunction = nullptr);
static bool LoadSymbols(PRLibrary *lib,
const SymLoadStruct *firstStruct,
SymLoadStruct *firstStruct,
PlatformLookupFunction lookupFunction = nullptr,
const char *prefix = nullptr,
bool warnOnFailure = true);
Expand Down

0 comments on commit 26e2190

Please sign in to comment.