diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-20 14:02:19 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-20 14:02:19 +0200 |
commit | 5eedb2283488fafef98c20729bc6917c6de957e5 (patch) | |
tree | 99f5fa12e15a4134f5b53f13ab34dcca1cb5efbf /SharedGraphics | |
parent | 7faf8fabf20d703141bc873716e8bea7692d1975 (diff) | |
download | serenity-5eedb2283488fafef98c20729bc6917c6de957e5.zip |
Sprinkle use of AK::Vector in various places.
Some of these are less helpful than others. Avoiding a bunch of mallocs
in the event loop wakeup code is definitely nice.
Diffstat (limited to 'SharedGraphics')
-rw-r--r-- | SharedGraphics/DisjointRectSet.cpp | 2 | ||||
-rw-r--r-- | SharedGraphics/DisjointRectSet.h | 4 | ||||
-rw-r--r-- | SharedGraphics/Painter.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/SharedGraphics/DisjointRectSet.cpp b/SharedGraphics/DisjointRectSet.cpp index a811899d76..38221fea66 100644 --- a/SharedGraphics/DisjointRectSet.cpp +++ b/SharedGraphics/DisjointRectSet.cpp @@ -14,7 +14,7 @@ void DisjointRectSet::add(const Rect& new_rect) void DisjointRectSet::shatter() { - Vector<Rect> output; + Vector<Rect, 32> output; output.ensure_capacity(m_rects.size()); bool pass_had_intersections = false; do { diff --git a/SharedGraphics/DisjointRectSet.h b/SharedGraphics/DisjointRectSet.h index 5b3f26d20b..4256b933db 100644 --- a/SharedGraphics/DisjointRectSet.h +++ b/SharedGraphics/DisjointRectSet.h @@ -13,11 +13,11 @@ public: void clear() { m_rects.clear(); } void clear_with_capacity() { m_rects.clear_with_capacity(); } - const Vector<Rect>& rects() const { return m_rects; } + const Vector<Rect, 32>& rects() const { return m_rects; } private: void shatter(); - Vector<Rect> m_rects; + Vector<Rect, 32> m_rects; }; diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h index 275d84463f..fe9cb65307 100644 --- a/SharedGraphics/Painter.h +++ b/SharedGraphics/Painter.h @@ -75,7 +75,7 @@ protected: Rect m_clip_origin; Retained<GraphicsBitmap> m_target; - Vector<State> m_state_stack; + Vector<State, 4> m_state_stack; }; class PainterStateSaver { |