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

Unified Diff: third_party/WebKit/WebCore/dom/CanvasSurface.cpp

Issue 2944020: 2010-07-09 W. James MacLean <wjmaclean@chromium.org>... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 5 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 | « third_party/WebKit/WebCore/dom/CanvasSurface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/WebCore/dom/CanvasSurface.cpp
===================================================================
--- third_party/WebKit/WebCore/dom/CanvasSurface.cpp (revision 52374)
+++ third_party/WebKit/WebCore/dom/CanvasSurface.cpp (working copy)
@@ -45,6 +45,11 @@
// in exchange for a smaller maximum canvas size.
const float CanvasSurface::MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
+#if PLATFORM(SKIA)
+// In Skia, we will also limit width/height to 32767.
+const float CanvasSurface::MaxSkiaDim = 32767.0F; // Maximum width/height in CSS pixels.
+#endif
+
CanvasSurface::CanvasSurface(float pageScaleFactor)
: m_size(DefaultWidth, DefaultHeight)
, m_pageScaleFactor(pageScaleFactor)
@@ -100,6 +105,11 @@
if (!(wf >= 1 && hf >= 1 && wf * hf <= MaxCanvasArea))
return IntSize();
+#if PLATFORM(SKIA)
+ if (wf > MaxSkiaDim || hf > MaxSkiaDim)
+ return IntSize();
+#endif
+
return IntSize(static_cast<unsigned>(wf), static_cast<unsigned>(hf));
}
« no previous file with comments | « third_party/WebKit/WebCore/dom/CanvasSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698