Bug 1088345 - Handle AA better. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2014-10-25 18:32:46 -07:00
parent d8f1d4e920
commit bf69677207
2 changed files with 10 additions and 18 deletions

View File

@ -3467,22 +3467,7 @@ protected:
if (!IsOffscreenSizeAllowed(size))
return false;
SurfaceCaps tryCaps = caps;
if (tryCaps.antialias) {
// AA path
if (CreateScreenBufferImpl(size, tryCaps))
return true;
NS_WARNING("CreateScreenBuffer failed to initialize an AA context! Falling back to no AA...");
tryCaps.antialias = false;
}
MOZ_ASSERT(!tryCaps.antialias);
if (CreateScreenBufferImpl(size, tryCaps))
return true;
NS_WARNING("CreateScreenBuffer failed to initialize non-AA context!");
return false;
return CreateScreenBufferImpl(size, caps);
}
bool CreateScreenBufferImpl(const gfx::IntSize& size,
@ -3629,6 +3614,9 @@ protected:
public:
GLsizei MaxSamples() const {
return mMaxSamples;
}
void fViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
if (mViewportRect[0] == x &&

View File

@ -572,8 +572,12 @@ DrawBuffer::Create(GLContext* const gl,
return true;
}
if (caps.antialias && formats.samples == 0)
return false; // Can't create it
if (caps.antialias) {
if (formats.samples == 0)
return false; // Can't create it.
MOZ_ASSERT(formats.samples <= gl->MaxSamples());
}
GLuint colorMSRB = 0;
GLuint depthRB = 0;