OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 } | 1636 } |
1637 | 1637 |
1638 void WebFrameImpl::layout() | 1638 void WebFrameImpl::layout() |
1639 { | 1639 { |
1640 // layout this frame | 1640 // layout this frame |
1641 FrameView* view = m_frame->view(); | 1641 FrameView* view = m_frame->view(); |
1642 if (view) | 1642 if (view) |
1643 view->layoutIfNeededRecursive(); | 1643 view->layoutIfNeededRecursive(); |
1644 } | 1644 } |
1645 | 1645 |
| 1646 void WebFrameImpl::paintWithContext(GraphicsContext& gc, const WebRect& rect) |
| 1647 { |
| 1648 IntRect dirtyRect(rect); |
| 1649 gc.save(); |
| 1650 if (m_frame->document() && frameView()) { |
| 1651 gc.clip(dirtyRect); |
| 1652 frameView()->paint(&gc, dirtyRect); |
| 1653 m_frame->page()->inspectorController()->drawNodeHighlight(gc); |
| 1654 } else |
| 1655 gc.fillRect(dirtyRect, Color::white, DeviceColorSpace); |
| 1656 gc.restore(); |
| 1657 } |
| 1658 |
1646 void WebFrameImpl::paint(WebCanvas* canvas, const WebRect& rect) | 1659 void WebFrameImpl::paint(WebCanvas* canvas, const WebRect& rect) |
1647 { | 1660 { |
1648 if (rect.isEmpty()) | 1661 if (rect.isEmpty()) |
1649 return; | 1662 return; |
1650 IntRect dirtyRect(rect); | |
1651 #if WEBKIT_USING_CG | 1663 #if WEBKIT_USING_CG |
1652 GraphicsContext gc(canvas); | 1664 GraphicsContext gc(canvas); |
1653 LocalCurrentGraphicsContext localContext(&gc); | 1665 LocalCurrentGraphicsContext localContext(&gc); |
1654 #elif WEBKIT_USING_SKIA | 1666 #elif WEBKIT_USING_SKIA |
1655 PlatformContextSkia context(canvas); | 1667 PlatformContextSkia context(canvas); |
1656 | 1668 |
1657 // PlatformGraphicsContext is actually a pointer to PlatformContextSkia | 1669 // PlatformGraphicsContext is actually a pointer to PlatformContextSkia |
1658 GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); | 1670 GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); |
1659 #else | 1671 #else |
1660 notImplemented(); | 1672 notImplemented(); |
1661 #endif | 1673 #endif |
1662 gc.save(); | 1674 paintWithContext(gc, rect); |
1663 if (m_frame->document() && frameView()) { | |
1664 gc.clip(dirtyRect); | |
1665 frameView()->paint(&gc, dirtyRect); | |
1666 m_frame->page()->inspectorController()->drawNodeHighlight(gc); | |
1667 } else | |
1668 gc.fillRect(dirtyRect, Color::white, DeviceColorSpace); | |
1669 gc.restore(); | |
1670 } | 1675 } |
1671 | 1676 |
1672 void WebFrameImpl::createFrameView() | 1677 void WebFrameImpl::createFrameView() |
1673 { | 1678 { |
1674 ASSERT(m_frame); // If m_frame doesn't exist, we probably didn't init proper
ly. | 1679 ASSERT(m_frame); // If m_frame doesn't exist, we probably didn't init proper
ly. |
1675 | 1680 |
1676 Page* page = m_frame->page(); | 1681 Page* page = m_frame->page(); |
1677 ASSERT(page); | 1682 ASSERT(page); |
1678 ASSERT(page->mainFrame()); | 1683 ASSERT(page->mainFrame()); |
1679 | 1684 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 2009 |
2005 if (!m_frame->redirectScheduler()->locationChangePending()) { | 2010 if (!m_frame->redirectScheduler()->locationChangePending()) { |
2006 m_frame->loader()->stopAllLoaders(); | 2011 m_frame->loader()->stopAllLoaders(); |
2007 m_frame->loader()->begin(m_frame->loader()->url(), true, securityOrigin)
; | 2012 m_frame->loader()->begin(m_frame->loader()->url(), true, securityOrigin)
; |
2008 m_frame->loader()->write(scriptResult); | 2013 m_frame->loader()->write(scriptResult); |
2009 m_frame->loader()->end(); | 2014 m_frame->loader()->end(); |
2010 } | 2015 } |
2011 } | 2016 } |
2012 | 2017 |
2013 } // namespace WebKit | 2018 } // namespace WebKit |
OLD | NEW |