summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL/DepthBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGL/DepthBuffer.cpp')
-rw-r--r--Userland/Libraries/LibGL/DepthBuffer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/DepthBuffer.cpp b/Userland/Libraries/LibGL/DepthBuffer.cpp
index 5f22211004..a45812133f 100644
--- a/Userland/Libraries/LibGL/DepthBuffer.cpp
+++ b/Userland/Libraries/LibGL/DepthBuffer.cpp
@@ -33,4 +33,12 @@ void DepthBuffer::clear(float depth)
}
}
+void DepthBuffer::clear(Gfx::IntRect bounds, float depth)
+{
+ bounds.intersect({ 0, 0, m_size.width(), m_size.height() });
+ for (int y = bounds.top(); y <= bounds.bottom(); ++y)
+ for (int x = bounds.left(); x <= bounds.right(); ++x)
+ m_data[y * m_size.width() + x] = depth;
+}
+
}