зеркало из https://github.com/mozilla/gecko-dev.git
Bug 956401 - 2/9 - Add ScopedScissorRect helper - r=jgilbert
This commit is contained in:
Родитель
2fc9601b41
Коммит
72a2bbe248
|
@ -259,5 +259,30 @@ void ScopedViewportRect::UnwrapImpl()
|
|||
mSavedViewportRect[3]);
|
||||
}
|
||||
|
||||
/* ScopedScissorRect **********************************************************/
|
||||
|
||||
ScopedScissorRect::ScopedScissorRect(GLContext* aGL,
|
||||
GLint x, GLint y,
|
||||
GLsizei width, GLsizei height)
|
||||
: ScopedGLWrapper<ScopedScissorRect>(aGL)
|
||||
{
|
||||
mGL->fGetIntegerv(LOCAL_GL_SCISSOR_BOX, mSavedScissorRect);
|
||||
mGL->fScissor(x, y, width, height);
|
||||
}
|
||||
|
||||
ScopedScissorRect::ScopedScissorRect(GLContext* aGL)
|
||||
: ScopedGLWrapper<ScopedScissorRect>(aGL)
|
||||
{
|
||||
mGL->fGetIntegerv(LOCAL_GL_SCISSOR_BOX, mSavedScissorRect);
|
||||
}
|
||||
|
||||
void ScopedScissorRect::UnwrapImpl()
|
||||
{
|
||||
mGL->fScissor(mSavedScissorRect[0],
|
||||
mSavedScissorRect[1],
|
||||
mSavedScissorRect[2],
|
||||
mSavedScissorRect[3]);
|
||||
}
|
||||
|
||||
} /* namespace gl */
|
||||
} /* namespace mozilla */
|
||||
|
|
|
@ -224,6 +224,22 @@ protected:
|
|||
void UnwrapImpl();
|
||||
};
|
||||
|
||||
struct ScopedScissorRect
|
||||
: public ScopedGLWrapper<ScopedScissorRect>
|
||||
{
|
||||
friend struct ScopedGLWrapper<ScopedScissorRect>;
|
||||
|
||||
protected:
|
||||
GLint mSavedScissorRect[4];
|
||||
|
||||
public:
|
||||
ScopedScissorRect(GLContext* aGL, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
explicit ScopedScissorRect(GLContext* aGL);
|
||||
|
||||
protected:
|
||||
void UnwrapImpl();
|
||||
};
|
||||
|
||||
} /* namespace gl */
|
||||
} /* namespace mozilla */
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче