Changeset 115266 in webkit
- Timestamp:
- Apr 25, 2012 5:46:26 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r115242 r115266 1 2012-04-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=84909 4 Background tabs are fuzzy until repaint when deviceScaleFactor > 1 5 -and corresponding- 6 <rdar://problem/11312064> 7 8 Reviewed by Darin Adler. 9 10 BackingStoreMac paints into a Bitmap instead of a CGLayer when there is no 11 containing window. That bitmap is used for the initial paint when a background tab 12 first comes to he foreground, so it needs to be HiDPI-aware. 13 14 paintBitmapContext() now takes a scale factor that it passes along to paintImage 15 rather than hardcoding a scale factor of 1 for paintImage. 16 * Platform/cg/CGUtilities.cpp: 17 (WebKit::paintBitmapContext): 18 * Platform/cg/CGUtilities.h: 19 (WebKit): 20 21 When these functions fall into the bitmap case, they need to adopt the device 22 scale factor, which means they need to scale in size by the scale factor, and also 23 scale their context. 24 * UIProcess/mac/BackingStoreMac.mm: 25 (WebKit::BackingStore::resetScrolledRect): 26 (WebKit::BackingStore::paint): 27 (WebKit::BackingStore::backingStoreContext): 28 1 29 2012-04-25 Enrica Casucci <enrica@apple.com> 2 30 -
trunk/Source/WebKit2/Platform/cg/CGUtilities.cpp
r95901 r115266 49 49 } 50 50 51 void paintBitmapContext(CGContextRef context, CGContextRef bitmapContext, CGPoint destination, CGRect source )51 void paintBitmapContext(CGContextRef context, CGContextRef bitmapContext, CGPoint destination, CGRect source, CGFloat scaleFactor) 52 52 { 53 53 RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(bitmapContext)); 54 paintImage(context, image.get(), 1, destination, source);54 paintImage(context, image.get(), scaleFactor, destination, source); 55 55 } 56 56 -
trunk/Source/WebKit2/Platform/cg/CGUtilities.h
r95901 r115266 30 30 31 31 void paintImage(CGContextRef, CGImageRef, CGFloat scaleFactor, CGPoint destination, CGRect source); 32 void paintBitmapContext(CGContextRef, CGContextRef bitmapContext, CGPoint destination, CGRect source );32 void paintBitmapContext(CGContextRef, CGContextRef bitmapContext, CGPoint destination, CGRect source, CGFloat scaleFactor); 33 33 34 34 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
r110412 r115266 98 98 } 99 99 100 IntSize scaledSize = m_scrolledRect.size(); 101 scaledSize.scale(m_deviceScaleFactor); 102 100 103 RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); 101 RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(0, m_scrolledRect.size().width(), m_scrolledRect.size().height(), 8, m_scrolledRect.size().width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); 104 RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(0, scaledSize.width(), scaledSize.height(), 8, scaledSize.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); 105 106 CGContextScaleCTM(context.get(), m_deviceScaleFactor, m_deviceScaleFactor); 102 107 103 108 CGContextTranslateCTM(context.get(), -m_scrolledRect.location().x(), -m_scrolledRect.location().y()); … … 107 112 108 113 IntRect sourceRect(IntPoint(), m_scrolledRect.size()); 109 paintBitmapContext(backingStoreContext(), context.get(), m_scrolledRect.location(), sourceRect );114 paintBitmapContext(backingStoreContext(), context.get(), m_scrolledRect.location(), sourceRect, m_deviceScaleFactor); 110 115 111 116 m_scrolledRect = IntRect(); … … 133 138 source.origin.x += offset.width(); 134 139 source.origin.y += offset.height(); 135 paintBitmapContext(context, m_bitmapContext.get(), part.location(), source );140 paintBitmapContext(context, m_bitmapContext.get(), part.location(), source, m_deviceScaleFactor); 136 141 }); 137 142 } … … 155 160 if (m_bitmapContext) { 156 161 // Paint the contents of the bitmap into the layer context. 157 paintBitmapContext(layerContext, m_bitmapContext.get(), CGPointZero, CGRectMake(0, 0, m_size.width(), m_size.height()) );162 paintBitmapContext(layerContext, m_bitmapContext.get(), CGPointZero, CGRectMake(0, 0, m_size.width(), m_size.height()), m_deviceScaleFactor); 158 163 m_bitmapContext = nullptr; 159 164 } … … 164 169 if (!m_bitmapContext) { 165 170 RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); 166 167 m_bitmapContext.adoptCF(CGBitmapContextCreate(0, m_size.width(), m_size.height(), 8, m_size.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); 171 172 IntSize scaledSize(m_size); 173 scaledSize.scale(m_deviceScaleFactor); 174 m_bitmapContext.adoptCF(CGBitmapContextCreate(0, scaledSize.width(), scaledSize.height(), 8, scaledSize.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); 168 175 169 176 CGContextSetBlendMode(m_bitmapContext.get(), kCGBlendModeCopy); 177 178 CGContextScaleCTM(m_bitmapContext.get(), m_deviceScaleFactor, m_deviceScaleFactor); 170 179 171 180 // We want the origin to be in the top left corner so flip the backing store context.
Note: See TracChangeset
for help on using the changeset viewer.