Changeset 185396 in webkit
- Timestamp:
- Jun 9, 2015, 5:46:51 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/GraphicsContext.cpp (modified) (1 diff)
-
platform/graphics/GraphicsContext.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185395 r185396 1 2015-06-09 Andreas Kling <akling@apple.com> 2 3 GraphicsContext state stack wasting lots of memory when empty. 4 <https://webkit.org/b/145817> 5 6 Reviewed by Geoffrey Garen. 7 8 Give the GraphicsContextState stack an inline capacity of 1, and make sure 9 to free any heap-allocated backing store when the stack goes empty. 10 11 The 1 is because HTMLCanvasElement keeps one "save" on the underlying 12 GraphicsContext at all times, and this prevents those canvases from always 13 sitting on an empty stack with 16 capacity. 14 15 This saves ~520 kB on cnet.com video pages. 16 17 * platform/graphics/GraphicsContext.cpp: 18 (WebCore::GraphicsContext::restore): 19 * platform/graphics/GraphicsContext.h: 20 1 21 2015-06-09 Said Abou-Hallawa <sabouhallawa@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r182516 r185396 135 135 m_stack.removeLast(); 136 136 137 // Make sure we deallocate the state stack buffer when it goes empty. 138 // Canvas elements will immediately save() again, but that goes into inline capacity. 139 if (m_stack.isEmpty()) 140 m_stack.clear(); 141 137 142 restorePlatformState(); 138 143 } -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r183314 r185396 560 560 561 561 GraphicsContextState m_state; 562 Vector<GraphicsContextState > m_stack;562 Vector<GraphicsContextState, 1> m_stack; 563 563 bool m_updatingControlTints; 564 564 unsigned m_transparencyCount;
Note:
See TracChangeset
for help on using the changeset viewer.