Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: Source/WebCore/platform/graphics/skia/PatternSkia.cpp

Issue 9599019: Merge 109171 - [chromium] Inform v8 about extra memory used for PatternSkia clamp mode (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/Pattern.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/skia/PatternSkia.cpp
===================================================================
--- Source/WebCore/platform/graphics/skia/PatternSkia.cpp (revision 109773)
+++ Source/WebCore/platform/graphics/skia/PatternSkia.cpp (working copy)
@@ -38,12 +38,18 @@
#include "SkColorShader.h"
#include "SkShader.h"
+#include <v8.h>
+
namespace WebCore {
void Pattern::platformDestroy()
{
SkSafeUnref(m_pattern);
m_pattern = 0;
+ if (m_externalMemoryAllocated) {
+ v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated);
+ m_externalMemoryAllocated = 0;
+ }
}
PlatformPatternPtr Pattern::platformPattern(const AffineTransform& patternTransform)
@@ -89,6 +95,9 @@
SkCanvas canvas(bm2);
canvas.drawBitmap(image->bitmap(), 0, 0);
m_pattern = SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY);
+
+ m_externalMemoryAllocated = bm2.getSafeSize();
+ v8::V8::AdjustAmountOfExternalAllocatedMemory(m_externalMemoryAllocated);
}
m_pattern->setLocalMatrix(m_patternSpaceTransformation);
return m_pattern;
« no previous file with comments | « Source/WebCore/platform/graphics/Pattern.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698