+2016-10-21 David Kilzer <ddkilzer@apple.com>
+
+ Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
+ <https://webkit.org/b/163757>
+
+ Reviewed by Brent Fulgham.
+
+ No new tests since there is no change in nominal behavior.
+
+ * platform/graphics/cg/PDFDocumentImage.cpp:
+ (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
+ IntSize::unclampedArea() where manual calculations were used
+ previously. Also gets rid of more safeCast<size_t>() use.
+
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web IDL] Support unions in our overload resolution algorithm
// Cache the PDF image only if the size of the new image won't exceed the cache threshold.
if (m_pdfImageCachingPolicy == PDFImageCachingBelowMemoryLimit) {
IntSize scaledSize = ImageBuffer::compatibleBufferSize(cachedImageSize, context);
- if (s_allDecodedDataSize + safeCast<size_t>(scaledSize.width()) * scaledSize.height() * 4 - m_cachedBytes > s_maxDecodedDataSize) {
+ if (s_allDecodedDataSize + scaledSize.unclampedArea() * 4 - m_cachedBytes > s_maxDecodedDataSize) {
destroyDecodedData();
return;
}
m_cachedSourceRect = srcRect;
IntSize internalSize = m_cachedImageBuffer->internalSize();
- decodedSizeChanged(safeCast<size_t>(internalSize.width()) * internalSize.height() * 4);
+ decodedSizeChanged(internalSize.unclampedArea() * 4);
}
void PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator op, BlendMode, ImageOrientationDescription)