diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 20:47:26 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 20:47:26 +0000 |
commit | fa47f1d6f6b26628080b5277f40dbcfafa571db1 (patch) | |
tree | 025a33078e287bc4b77dc7243ec24e2aa870bb88 /skia | |
parent | 300cc58db6bc8d78e279dc07c46f15d9702148c6 (diff) | |
download | chromium_src-fa47f1d6f6b26628080b5277f40dbcfafa571db1.zip chromium_src-fa47f1d6f6b26628080b5277f40dbcfafa571db1.tar.gz chromium_src-fa47f1d6f6b26628080b5277f40dbcfafa571db1.tar.bz2 |
Add progress disks to os x download items. Some more spacing tweaks. Still not done.
BUG=18902
TEST=download something, note that a green disk appears, and disappears after some flashing after the download is done.
Review URL: http://codereview.chromium.org/174048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/canvas_paint_mac.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/skia/ext/canvas_paint_mac.h b/skia/ext/canvas_paint_mac.h index 9f4ae84..c72c79e 100644 --- a/skia/ext/canvas_paint_mac.h +++ b/skia/ext/canvas_paint_mac.h @@ -42,13 +42,22 @@ class CanvasPaintT : public T { CGImageRef image = CGBitmapContextCreateImage(context_); CGRect destRect = NSRectToCGRect(rectangle_); - CGContextRef context = + CGContextRef destinationContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - CGContextSaveGState(context); + CGContextSaveGState(destinationContext); CGContextSetBlendMode( - context, composite_alpha_ ? kCGBlendModeNormal : kCGBlendModeCopy); - CGContextDrawImage(context, destRect, image); - CGContextRestoreGState(context); + destinationContext, + composite_alpha_ ? kCGBlendModeNormal : kCGBlendModeCopy); + + if ([[NSGraphicsContext currentContext] isFlipped]) { + // Mirror context on the target's rect middle scanline. + CGContextTranslateCTM(destinationContext, 0.0, NSMidY(rectangle_)); + CGContextScaleCTM(destinationContext, 1.0, -1.0); + CGContextTranslateCTM(destinationContext, 0.0, -NSMidY(rectangle_)); + } + + CGContextDrawImage(destinationContext, destRect, image); + CGContextRestoreGState(destinationContext); CFRelease(image); } |