зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1427668 - Assert that no-alpha backbuffers have 0xff alpha. - r=daoshengmu
MozReview-Commit-ID: 5UJdoud0f2C
This commit is contained in:
Родитель
7edc1cd1d7
Коммит
8ab9a9aa21
|
@ -1576,6 +1576,15 @@ WebGLContext::PresentScreenBuffer()
|
|||
gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
|
||||
BlitBackbufferToCurDriverFB();
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!mOptions.alpha) {
|
||||
gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
|
||||
uint32_t pixel = 3;
|
||||
gl->fReadPixels(0, 0, 1, 1, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, &pixel);
|
||||
MOZ_ASSERT((pixel & 0xff000000) == 0xff000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!screen->PublishFrame(screen->Size())) {
|
||||
GenerateWarning("PublishFrame failed. Losing context.");
|
||||
ForceLoseContext();
|
||||
|
|
|
@ -366,7 +366,7 @@ public:
|
|||
GetSurfaceSnapshot(gfxAlphaType* out_alphaType) override;
|
||||
|
||||
virtual void SetIsOpaque(bool) override {};
|
||||
bool GetIsOpaque() override { return false; }
|
||||
bool GetIsOpaque() override { return !mOptions.alpha; }
|
||||
NS_IMETHOD SetContextOptions(JSContext* cx,
|
||||
JS::Handle<JS::Value> options,
|
||||
ErrorResult& aRvForDictionaryInit) override;
|
||||
|
|
|
@ -1543,7 +1543,6 @@ public:
|
|||
}
|
||||
|
||||
void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
|
||||
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
|
||||
BEFORE_GL_CALL;
|
||||
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
||||
OnSyncCall();
|
||||
|
|
|
@ -632,11 +632,6 @@ GLReadTexImageHelper::ReadTexImage(DataSourceSurface* aDest,
|
|||
CLEANUP_IF_GLERROR_OCCURRED("when binding texture");
|
||||
}
|
||||
|
||||
/* Draw quad */
|
||||
mGL->fClearColor(1.0f, 0.0f, 1.0f, 1.0f);
|
||||
mGL->fClear(LOCAL_GL_COLOR_BUFFER_BIT);
|
||||
CLEANUP_IF_GLERROR_OCCURRED("when clearing color buffer");
|
||||
|
||||
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
|
||||
CLEANUP_IF_GLERROR_OCCURRED("when drawing texture");
|
||||
|
||||
|
|
|
@ -155,8 +155,8 @@ CopyableCanvasRenderer::ReadbackSurface()
|
|||
}
|
||||
|
||||
IntSize readSize(frontbuffer->mSize);
|
||||
SurfaceFormat format = frontbuffer->mHasAlpha ? SurfaceFormat::B8G8R8X8
|
||||
: SurfaceFormat::B8G8R8A8;
|
||||
SurfaceFormat format = frontbuffer->mHasAlpha ? SurfaceFormat::B8G8R8A8
|
||||
: SurfaceFormat::B8G8R8X8;
|
||||
bool needsPremult = frontbuffer->mHasAlpha && !mIsAlphaPremultiplied;
|
||||
|
||||
RefPtr<DataSourceSurface> resultSurf = GetTempSurface(readSize, format);
|
||||
|
|
Загрузка…
Ссылка в новой задаче