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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 page->animator().updateLayoutAndStyleForPainting(rootFrame); | 83 page->animator().updateLayoutAndStyleForPainting(rootFrame); |
84 } | 84 } |
85 | 85 |
86 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas*
canvas, const WebRect& rect, CanvasBackground background) | 86 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas*
canvas, const WebRect& rect, CanvasBackground background) |
87 { | 87 { |
88 if (rect.isEmpty()) | 88 if (rect.isEmpty()) |
89 return; | 89 return; |
90 GraphicsContext gc(canvas); | 90 GraphicsContext gc(canvas); |
91 gc.setCertainlyOpaque(background == Opaque); | 91 gc.setCertainlyOpaque(background == Opaque); |
92 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); | 92 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); |
93 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); | 93 gc.setDeviceScaleFactor(page->deviceScaleFactor()); |
94 IntRect dirtyRect(rect); | 94 IntRect dirtyRect(rect); |
95 gc.save(); // Needed to save the canvas, not the GraphicsContext. | 95 gc.save(); // Needed to save the canvas, not the GraphicsContext. |
96 FrameView* view = mainFrameView(page); | 96 FrameView* view = mainFrameView(page); |
97 // FIXME: Can we remove the mainFrame()->document() check? | 97 // FIXME: Can we remove the mainFrame()->document() check? |
98 if (view && page->deprecatedLocalMainFrame()->document()) { | 98 if (view && page->deprecatedLocalMainFrame()->document()) { |
99 gc.clip(dirtyRect); | 99 gc.clip(dirtyRect); |
100 view->paint(&gc, dirtyRect); | 100 view->paint(&gc, dirtyRect); |
101 if (overlays) | 101 if (overlays) |
102 overlays->paintWebFrame(gc); | 102 overlays->paintWebFrame(gc); |
103 } else { | 103 } else { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 { | 212 { |
213 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); | 213 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); |
214 } | 214 } |
215 | 215 |
216 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) | 216 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) |
217 { | 217 { |
218 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); | 218 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
219 } | 219 } |
220 | 220 |
221 } | 221 } |
OLD | NEW |