mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 02:59:49 +01:00
Merge DrawContext into UIContext.
This commit is contained in:
1 parent
cbf1b2d29d
commit
f075c8fd56
13 files changed
+145
-184
No files matched your search
@@ -68,4 +68,32 @@ void UIContext::End()
|
||||
{
|
||||
UIEnd();
|
||||
Flush();
|
||||
}
|
||||
|
||||
// TODO: Support transformed bounds using stencil
|
||||
void UIContext::PushScissor(const Bounds &bounds) {
|
||||
Flush();
|
||||
scissorStack_.push_back(bounds);
|
||||
ActivateTopScissor();
|
||||
}
|
||||
|
||||
void UIContext::PopScissor() {
|
||||
Flush();
|
||||
scissorStack_.pop_back();
|
||||
ActivateTopScissor();
|
||||
}
|
||||
|
||||
void UIContext::ActivateTopScissor() {
|
||||
if (scissorStack_.size()) {
|
||||
const Bounds &bounds = scissorStack_.back();
|
||||
int x = g_dpi_scale * bounds.x;
|
||||
int y = g_dpi_scale * (dp_yres - bounds.y2());
|
||||
int w = g_dpi_scale * bounds.w;
|
||||
int h = g_dpi_scale * bounds.h;
|
||||
|
||||
glstate.scissorRect.set(x,y,w,h);
|
||||
glstate.scissorTest.enable();
|
||||
} else {
|
||||
glstate.scissorTest.disable();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user