summaryrefslogtreecommitdiff
path: root/SharedGraphics/GraphicsBitmap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-17 09:41:26 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-17 09:41:26 +0100
commitc81b217fa784e3976d0635fba384fb86d5cbb10f (patch)
tree0968b42332b759e38ea0f71c9baaaf288dbdb52d /SharedGraphics/GraphicsBitmap.cpp
parentdf2d46d5dcbf2e36253dc9052a73501f0e3555d1 (diff)
downloadserenity-c81b217fa784e3976d0635fba384fb86d5cbb10f.zip
SharedGraphics: Assign a human-friendly name for mmapped GraphicsBitmap.
Diffstat (limited to 'SharedGraphics/GraphicsBitmap.cpp')
-rw-r--r--SharedGraphics/GraphicsBitmap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/SharedGraphics/GraphicsBitmap.cpp b/SharedGraphics/GraphicsBitmap.cpp
index 74ad96672c..e689550897 100644
--- a/SharedGraphics/GraphicsBitmap.cpp
+++ b/SharedGraphics/GraphicsBitmap.cpp
@@ -14,8 +14,10 @@ GraphicsBitmap::GraphicsBitmap(const Size& size)
: m_size(size)
, m_pitch(size.width() * sizeof(RGBA32))
{
- m_data = (RGBA32*)mmap(nullptr, size.area() * sizeof(RGBA32), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
+ size_t size_in_bytes = size.area() * sizeof(RGBA32);
+ m_data = (RGBA32*)mmap(nullptr, size_in_bytes, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
ASSERT(m_data && m_data != (void*)-1);
+ set_mmap_name(m_data, size_in_bytes, String::format("GraphicsBitmap [%dx%d]", width(), height()).characters());
m_mmaped = true;
}