| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 SkPictureBuilder builder(intRect); | 76 SkPictureBuilder builder(intRect); |
| 77 GraphicsContext* context = &builder.context(); | 77 GraphicsContext* context = &builder.context(); |
| 78 | 78 |
| 79 // FIXME: device scale factor settings are layering violations and should no
t | 79 // FIXME: device scale factor settings are layering violations and should no
t |
| 80 // be used within Blink paint code. | 80 // be used within Blink paint code. |
| 81 float scaleFactor = page.deviceScaleFactor(); | 81 float scaleFactor = page.deviceScaleFactor(); |
| 82 context->setDeviceScaleFactor(scaleFactor); | 82 context->setDeviceScaleFactor(scaleFactor); |
| 83 | 83 |
| 84 AffineTransform scale; | 84 AffineTransform scale; |
| 85 scale.scale(scaleFactor); | 85 scale.scale(scaleFactor); |
| 86 TransformRecorder scaleRecorder(*context, root, scale); | |
| 87 | 86 |
| 88 IntRect dirtyRect(rect); | 87 { |
| 89 FrameView* view = root.view(); | 88 TransformRecorder scaleRecorder(*context, root, scale); |
| 90 if (view) { | |
| 91 ClipRecorder clipRecorder(*context, root, DisplayItem::PageWidgetDelegat
eClip, LayoutRect(dirtyRect)); | |
| 92 | 89 |
| 93 view->paint(context, dirtyRect); | 90 IntRect dirtyRect(rect); |
| 94 if (overlays) | 91 FrameView* view = root.view(); |
| 95 overlays->paintWebFrame(*context); | 92 if (view) { |
| 96 } else { | 93 ClipRecorder clipRecorder(*context, root, DisplayItem::PageWidgetDel
egateClip, LayoutRect(dirtyRect)); |
| 97 DrawingRecorder drawingRecorder(*context, root, DisplayItem::PageWidgetD
elegateBackgroundFallback, dirtyRect); | 94 |
| 98 if (!drawingRecorder.canUseCachedDrawing()) | 95 view->paint(context, dirtyRect); |
| 99 context->fillRect(dirtyRect, Color::white); | 96 if (overlays) |
| 97 overlays->paintWebFrame(*context); |
| 98 } else { |
| 99 DrawingRecorder drawingRecorder(*context, root, DisplayItem::PageWid
getDelegateBackgroundFallback, dirtyRect); |
| 100 if (!drawingRecorder.canUseCachedDrawing()) |
| 101 context->fillRect(dirtyRect, Color::white); |
| 102 } |
| 100 } | 103 } |
| 101 builder.endRecording()->playback(canvas); | 104 builder.endRecording()->playback(canvas); |
| 102 } | 105 } |
| 103 | 106 |
| 104 bool PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const
WebInputEvent& event, LocalFrame* root) | 107 bool PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const
WebInputEvent& event, LocalFrame* root) |
| 105 { | 108 { |
| 106 switch (event.type) { | 109 switch (event.type) { |
| 107 | 110 |
| 108 // FIXME: WebKit seems to always return false on mouse events processing | 111 // FIXME: WebKit seems to always return false on mouse events processing |
| 109 // methods. For now we'll assume it has processed them (as we are only | 112 // methods. For now we'll assume it has processed them (as we are only |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 { | 207 { |
| 205 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); | 208 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); |
| 206 } | 209 } |
| 207 | 210 |
| 208 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) | 211 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) |
| 209 { | 212 { |
| 210 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); | 213 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
| 211 } | 214 } |
| 212 | 215 |
| 213 } // namespace blink | 216 } // namespace blink |
| OLD | NEW |