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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 { | 60 { |
61 page.animator().updateLayoutAndStyleForPainting(&root); | 61 page.animator().updateLayoutAndStyleForPainting(&root); |
62 } | 62 } |
63 | 63 |
64 void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, LocalFrame& root) | 64 void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, LocalFrame& root) |
65 { | 65 { |
66 if (rect.isEmpty()) | 66 if (rect.isEmpty()) |
67 return; | 67 return; |
68 GraphicsContext gc(canvas); | 68 GraphicsContext gc(canvas); |
69 gc.setCertainlyOpaque(background == Opaque); | 69 gc.setCertainlyOpaque(background == Opaque); |
70 gc.applyDeviceScaleFactor(page.deviceScaleFactor()); | 70 float scaleFactor = page.deviceScaleFactor(); |
71 gc.setDeviceScaleFactor(page.deviceScaleFactor()); | 71 gc.scale(scaleFactor, scaleFactor); |
f(malita)
2014/11/14 03:24:56
This looks weird: the device scale factor is suppo
Stephen Chennney
2014/11/14 15:26:22
It's does what it was designed to do, but that may
| |
72 gc.setDeviceScaleFactor(scaleFactor); | |
72 IntRect dirtyRect(rect); | 73 IntRect dirtyRect(rect); |
73 gc.save(); // Needed to save the canvas, not the GraphicsContext. | 74 gc.save(); // Needed to save the canvas, not the GraphicsContext. |
74 FrameView* view = root.view(); | 75 FrameView* view = root.view(); |
75 if (view) { | 76 if (view) { |
76 gc.clip(dirtyRect); | 77 gc.clip(dirtyRect); |
77 view->paint(&gc, dirtyRect); | 78 view->paint(&gc, dirtyRect); |
78 if (overlays) | 79 if (overlays) |
79 overlays->paintWebFrame(gc); | 80 overlays->paintWebFrame(gc); |
80 } else { | 81 } else { |
81 gc.fillRect(dirtyRect, Color::white); | 82 gc.fillRect(dirtyRect, Color::white); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 { | 191 { |
191 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); | 192 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); |
192 } | 193 } |
193 | 194 |
194 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) | 195 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) |
195 { | 196 { |
196 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); | 197 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); |
197 } | 198 } |
198 | 199 |
199 } // namespace blink | 200 } // namespace blink |
OLD | NEW |