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

Unified Diff: Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp

Issue 10254020: Merge 114791 - [chromium] Clip TransparencyWin to prevent OOM from large Skia canvas (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 | « no previous file | Source/WebKit/chromium/tests/TransparencyWinTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp (revision 115490)
+++ Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp (working copy)
@@ -210,11 +210,19 @@
// uses the variable: to determine how to translate things to account
// for the offset of the layer.
m_transformedSourceRect = m_sourceRect;
- m_layerSize = IntSize(m_sourceRect.width(), m_sourceRect.height());
- } else {
+ } else if (m_transformMode == KeepTransform && m_layerMode != TextComposite) {
+ // FIXME: support clipping for other modes
+ IntRect clippedSourceRect = m_sourceRect;
+ SkRect clipBounds;
+ if (m_destContext->platformContext()->canvas()->getClipBounds(&clipBounds)) {
+ FloatRect clipRect(clipBounds.left(), clipBounds.top(), clipBounds.width(), clipBounds.height());
+ clippedSourceRect.intersect(enclosingIntRect(clipRect));
+ }
+ m_transformedSourceRect = m_orgTransform.mapRect(clippedSourceRect);
+ } else
m_transformedSourceRect = m_orgTransform.mapRect(m_sourceRect);
- m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height());
- }
+
+ m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height());
}
void TransparencyWin::setupLayer()
« no previous file with comments | « no previous file | Source/WebKit/chromium/tests/TransparencyWinTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698