Changeset 109171 in webkit
- Timestamp:
- Feb 28, 2012 5:12:57 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109168 r109171 1 2012-02-28 Adrienne Walker <enne@google.com> 2 3 [chromium] Inform v8 about extra memory used for PatternSkia clamp mode 4 https://bugs.webkit.org/show_bug.cgi?id=79846 5 6 Reviewed by James Robinson. 7 8 For large images, creating a non-repeating Pattern in Skia can 9 allocate a lot of memory. Inform v8 about this so that it can 10 potentially garbage collect any Pattern objects that aren't being used 11 and that are holding onto large image copies. 12 13 * platform/graphics/Pattern.cpp: 14 (WebCore::Pattern::Pattern): 15 * platform/graphics/Pattern.h: 16 (Pattern): 17 * platform/graphics/skia/PatternSkia.cpp: 18 (WebCore::Pattern::platformDestroy): 19 (WebCore::Pattern::platformPattern): 20 1 21 2012-02-28 Jonathan Backer <backer@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/Pattern.cpp
r95901 r109171 38 38 #if USE(SKIA) 39 39 , m_pattern(0) 40 , m_externalMemoryAllocated(0) 40 41 #endif 41 42 { -
trunk/Source/WebCore/platform/graphics/Pattern.h
r95922 r109171 96 96 AffineTransform m_patternSpaceTransformation; 97 97 PlatformPatternPtr m_pattern; 98 #if USE(SKIA) 99 size_t m_externalMemoryAllocated; 100 #endif 98 101 }; 99 102 -
trunk/Source/WebCore/platform/graphics/skia/PatternSkia.cpp
r95901 r109171 39 39 #include "SkShader.h" 40 40 41 #include <v8.h> 42 41 43 namespace WebCore { 42 44 … … 45 47 SkSafeUnref(m_pattern); 46 48 m_pattern = 0; 49 if (m_externalMemoryAllocated) { 50 v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated); 51 m_externalMemoryAllocated = 0; 52 } 47 53 } 48 54 … … 90 96 canvas.drawBitmap(image->bitmap(), 0, 0); 91 97 m_pattern = SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY); 98 99 m_externalMemoryAllocated = bm2.getSafeSize(); 100 v8::V8::AdjustAmountOfExternalAllocatedMemory(m_externalMemoryAllocated); 92 101 } 93 102 m_pattern->setLocalMatrix(m_patternSpaceTransformation);
Note: See TracChangeset
for help on using the changeset viewer.