When we create the GL context and FBO on mac for the GM test also setup the viewport and clear the stencil.
In GrGpuGL::readPixels make sure current rendertarget has been made current in GL before calling glReadPixels git-svn-id: http://skia.googlecode.com/svn/trunk@761 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
b89a643b69
commit
18908aacf3
@ -1053,7 +1053,11 @@ bool GrGpuGL::readPixels(int left, int top, int width, int height,
|
||||
return false;
|
||||
}
|
||||
|
||||
GrAssert(NULL != fCurrDrawState.fRenderTarget);
|
||||
if (NULL == fCurrDrawState.fRenderTarget) {
|
||||
return false;
|
||||
}
|
||||
flushRenderTarget();
|
||||
|
||||
const GrIRect& vp = ((GrGLRenderTarget*)fCurrDrawState.fRenderTarget)->viewport();
|
||||
|
||||
// Brian says that viewport rects are already upside down (grrrrr)
|
||||
|
@ -58,6 +58,9 @@ bool SkEGLContext::init(int width, int height) {
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, dsID);
|
||||
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, dsID);
|
||||
glViewport(0, 0, width, height);
|
||||
glClearStencil(0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
return GL_FRAMEBUFFER_COMPLETE == status;
|
||||
|
Loading…
Reference in New Issue
Block a user