OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 { | 61 { |
62 RefPtr<FrameView> view = mainFrameView(page); | 62 RefPtr<FrameView> view = mainFrameView(page); |
63 if (!view) | 63 if (!view) |
64 return; | 64 return; |
65 page->autoscrollController().animate(monotonicFrameBeginTime); | 65 page->autoscrollController().animate(monotonicFrameBeginTime); |
66 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); | 66 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); |
67 } | 67 } |
68 | 68 |
69 void PageWidgetDelegate::layout(Page* page) | 69 void PageWidgetDelegate::layout(Page* page) |
70 { | 70 { |
71 RefPtr<FrameView> view = mainFrameView(page); | 71 if (!page || !page->mainFrame()) |
72 if (!view) | |
73 return; | 72 return; |
74 // In order for our child HWNDs (NativeWindowWidgets) to update properly, | 73 page->animator().updateLayoutAndStyleForPainting(); |
75 // they need to be told that we are updating the screen. The problem is that | |
76 // the native widgets need to recalculate their clip region and not overlap | |
77 // any of our non-native widgets. To force the resizing, call | |
78 // setFrameRect(). This will be a quick operation for most frames, but the | |
79 // NativeWindowWidgets will update a proper clipping region. | |
80 view->setFrameRect(view->frameRect()); | |
81 | |
82 // setFrameRect may have the side-effect of causing existing page layout to | |
83 // be invalidated, so layout needs to be called last. | |
84 view->updateLayoutAndStyleForPainting(); | |
85 } | 74 } |
86 | 75 |
87 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas*
canvas, const WebRect& rect, CanvasBackground background) | 76 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas*
canvas, const WebRect& rect, CanvasBackground background) |
88 { | 77 { |
89 if (rect.isEmpty()) | 78 if (rect.isEmpty()) |
90 return; | 79 return; |
91 GraphicsContext gc(canvas); | 80 GraphicsContext gc(canvas); |
92 gc.setCertainlyOpaque(background == Opaque); | 81 gc.setCertainlyOpaque(background == Opaque); |
93 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); | 82 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); |
94 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); | 83 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 { | 202 { |
214 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); | 203 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); |
215 } | 204 } |
216 | 205 |
217 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) | 206 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) |
218 { | 207 { |
219 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); | 208 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
220 } | 209 } |
221 | 210 |
222 } | 211 } |
OLD | NEW |