diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 00:54:45 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 00:54:45 +0000 |
commit | 0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9 (patch) | |
tree | 1015ff7e32d5dff28d103a89c9f9224bd2c0254a /webkit/tools/test_shell/mac | |
parent | 74c8b421637393234e24b227929b89eba0883e76 (diff) | |
download | chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.zip chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.tar.gz chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.tar.bz2 |
Reverting 11396.
failing layout tests on linux
Review URL: http://codereview.chromium.org/43058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11409 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/mac')
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index 1fed2f9..fd95535 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -143,14 +143,10 @@ void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { } void WebWidgetHost::Paint() { - PaintToCanvas(); - PaintCanvasToView(); -} - -void WebWidgetHost::PaintToCanvas() { NSRect r = [view_ frame]; gfx::Rect client_rect(NSRectToCGRect(r)); NSGraphicsContext* view_context = [NSGraphicsContext currentContext]; + CGContextRef context = static_cast<CGContextRef>([view_context graphicsPort]); // Allocate a canvas if necessary if (!canvas_.get()) { @@ -195,45 +191,21 @@ void WebWidgetHost::PaintToCanvas() { // set the context back to our window [NSGraphicsContext setCurrentContext: view_context]; -} -void WebWidgetHost::PaintCanvasToView() { // Paint to the screen if ([view_ lockFocusIfCanDraw]) { - NSGraphicsContext* view_context = [NSGraphicsContext currentContext]; - NSRect r = [view_ frame]; - CGContextRef bitmap_context = - canvas_->getTopPlatformDevice().GetBitmapContext(); - CGContextRef context = - static_cast<CGContextRef>([view_context graphicsPort]); CGRect paint_rect = NSRectToCGRect(r); int bitmap_height = CGBitmapContextGetHeight(bitmap_context); int bitmap_width = CGBitmapContextGetWidth(bitmap_context); CGRect bitmap_rect = { { 0, 0 }, { bitmap_width, bitmap_height } }; canvas_->getTopPlatformDevice().DrawToContext( - context, 0, r.size.height - bitmap_height, &bitmap_rect); + context, 0, client_rect.height() - bitmap_height, &bitmap_rect); [view_ unlockFocus]; } } -void WebWidgetHost::DisplayForRepaint() { - PaintToCanvas(); - - // Paint a gray mask over everything for the repaint Layout tests. - CGContextRef bitmap_context = - canvas_->getTopPlatformDevice().GetBitmapContext(); - CGRect bitmap_rect = { { 0, 0 }, - { CGBitmapContextGetWidth(bitmap_context), - CGBitmapContextGetHeight(bitmap_context) } }; - CGContextSetBlendMode(bitmap_context, kCGBlendModeNormal); - CGContextSetRGBFillColor(bitmap_context, 0, 0, 0, 0.66); - CGContextFillRect(bitmap_context, bitmap_rect); - - PaintCanvasToView(); -} - void WebWidgetHost::Resize(const gfx::Rect& rect) { // Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer. DiscardBackingStore(); |