Commit a48249a4 authored by rjw's avatar rjw

Fixed 3143361. This was a regression introduced with some image

        rendering optimizations.  Don't bypass the tiling code path if
        the image needs to be rendered out-of-phase.

        Reviewed by hyatt.

        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer tileInRect:fromPoint:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7b10f2ff
2003-01-09 Richard Williamson <rjw@apple.com>
Fixed 3143361. This was a regression introduced with some image
rendering optimizations. Don't bypass the tiling code path if
the image needs to be rendered out-of-phase.
Reviewed by hyatt.
* WebCoreSupport.subproj/WebImageRenderer.m:
(-[WebImageRenderer tileInRect:fromPoint:]):
2003-01-09 Darin Adler <darin@apple.com>
Reviewed by Chris.
......
......@@ -360,9 +360,14 @@ - (void)tileInRect:(NSRect)rect fromPoint:(NSPoint)point
oneTileRect.origin.x = rect.origin.x + fmodf(fmodf(-point.x, size.width) - size.width, size.width);
oneTileRect.origin.y = rect.origin.y + fmodf(fmodf(-point.y, size.height) - size.height, size.height);
oneTileRect.size = size;
// Compute the appropriate phase relative to the top level view in the window.
// Conveniently, the oneTileRect we computed above has the appropriate origin.
NSPoint originInWindow = [[NSView focusView] convertPoint:oneTileRect.origin toView:nil];
CGSize phase = CGSizeMake(fmodf(originInWindow.x, size.width), fmodf(originInWindow.y, size.height));
// If the single image draw covers the whole area, then just draw once.
if (NSContainsRect(oneTileRect, rect)) {
if (NSContainsRect(oneTileRect, rect) && phase.width == 0 && phase.height == 0) {
NSRect fromRect;
fromRect.origin.x = rect.origin.x - oneTileRect.origin.x;
fromRect.origin.y = (oneTileRect.origin.y + oneTileRect.size.height) - (rect.origin.y + rect.size.height);
......@@ -388,12 +393,7 @@ - (void)tileInRect:(NSRect)rect fromPoint:(NSPoint)point
patternColor = [[NSColor colorWithPatternImage:self] retain];
patternColorLoadStatus = loadStatus;
}
// Compute the appropriate phase relative to the top level view in the window.
// Conveniently, the oneTileRect we computed above has the appropriate origin.
NSPoint originInWindow = [[NSView focusView] convertPoint:oneTileRect.origin toView:nil];
CGSize phase = CGSizeMake(fmodf(originInWindow.x, size.width), fmodf(originInWindow.y, size.height));
[NSGraphicsContext saveGraphicsState];
CGContextSetPatternPhase((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], phase);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment