Changeset 102198 in webkit
- Timestamp:
- Dec 6, 2011, 5:23:39 PM (15 years ago)
- Location:
- branches/safari-534.53-branch/Source/WebKit2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/WebPage.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-534.53-branch/Source/WebKit2/ChangeLog
r102197 r102198 1 2011-12-06 Lucas Forschler <lforschler@apple.com> 2 3 Merge 97191 4 5 2011-10-11 Beth Dakin <bdakin@apple.com> 6 7 https://bugs.webkit.org/show_bug.cgi?id=69874 8 WebKit2 snapshot APIs should take the device scale factor into account 9 -and corresponding- 10 <rdar://problem/10269112> 11 12 Reviewed by Darin Adler. 13 14 Add the deviceScaleFactor as a scale on the snapshot's context to create a 15 snapshot of the appropriate resolution. This matches the manner in which we scale 16 the context in DrawingAreaImpl::display(). 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::snapshotInViewCoordinates): 19 (WebKit::WebPage::scaledSnapshotInDocumentCoordinates): 20 1 21 2011-12-06 Lucas Forschler <lforschler@apple.com> 2 22 -
branches/safari-534.53-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r102197 r102198 871 871 return 0; 872 872 873 RefPtr<WebImage> snapshot = WebImage::create(rect.size(), options); 873 IntSize bitmapSize = rect.size(); 874 float deviceScaleFactor = corePage()->deviceScaleFactor(); 875 bitmapSize.scale(deviceScaleFactor); 876 877 RefPtr<WebImage> snapshot = WebImage::create(bitmapSize, options); 874 878 if (!snapshot->bitmap()) 875 879 return 0; 876 880 877 881 OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext(); 882 graphicsContext->scale(FloatSize(deviceScaleFactor, deviceScaleFactor)); 878 883 graphicsContext->translate(-rect.x(), -rect.y()); 879 884 … … 894 899 return 0; 895 900 896 IntSize size(ceil(rect.width() * scaleFactor), ceil(rect.height() * scaleFactor)); 901 float combinedScaleFactor = scaleFactor * corePage()->deviceScaleFactor(); 902 IntSize size(ceil(rect.width() * combinedScaleFactor), ceil(rect.height() * combinedScaleFactor)); 897 903 RefPtr<WebImage> snapshot = WebImage::create(size, options); 898 904 if (!snapshot->bitmap()) … … 900 906 901 907 OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext(); 902 graphicsContext->scale(FloatSize( scaleFactor, scaleFactor));908 graphicsContext->scale(FloatSize(combinedScaleFactor, combinedScaleFactor)); 903 909 graphicsContext->translate(-rect.x(), -rect.y()); 904 910
Note:
See TracChangeset
for help on using the changeset viewer.