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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 { | 73 { |
74 GraphicsContext& paintContext = pictureBuilder.context(); | 74 GraphicsContext& paintContext = pictureBuilder.context(); |
75 | 75 |
76 // FIXME: device scale factor settings are layering violations and shoul
d not | 76 // FIXME: device scale factor settings are layering violations and shoul
d not |
77 // be used within Blink paint code. | 77 // be used within Blink paint code. |
78 float scaleFactor = page.deviceScaleFactor(); | 78 float scaleFactor = page.deviceScaleFactor(); |
79 paintContext.setDeviceScaleFactor(scaleFactor); | 79 paintContext.setDeviceScaleFactor(scaleFactor); |
80 | 80 |
81 AffineTransform scale; | 81 AffineTransform scale; |
82 scale.scale(scaleFactor); | 82 scale.scale(scaleFactor); |
83 TransformRecorder scaleRecorder(paintContext, root, scale); | 83 TransformRecorder scaleRecorder(paintContext, pictureBuilder, scale); |
84 | 84 |
85 IntRect dirtyRect(rect); | 85 IntRect dirtyRect(rect); |
86 FrameView* view = root.view(); | 86 FrameView* view = root.view(); |
87 if (view) { | 87 if (view) { |
88 ClipRecorder clipRecorder(paintContext, root, DisplayItem::PageWidge
tDelegateClip, LayoutRect(dirtyRect)); | 88 ClipRecorder clipRecorder(paintContext, pictureBuilder, DisplayItem:
:PageWidgetDelegateClip, LayoutRect(dirtyRect)); |
89 | |
90 view->paint(paintContext, globalPaintFlags, CullRect(dirtyRect)); | 89 view->paint(paintContext, globalPaintFlags, CullRect(dirtyRect)); |
91 } else if (!DrawingRecorder::useCachedDrawingIfPossible(paintContext, ro
ot, DisplayItem::PageWidgetDelegateBackgroundFallback)) { | 90 } else { |
92 DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::Pag
eWidgetDelegateBackgroundFallback, dirtyRect); | 91 DrawingRecorder drawingRecorder(paintContext, pictureBuilder, Displa
yItem::PageWidgetDelegateBackgroundFallback, dirtyRect); |
93 paintContext.fillRect(dirtyRect, Color::white); | 92 paintContext.fillRect(dirtyRect, Color::white); |
94 } | 93 } |
95 } | 94 } |
96 pictureBuilder.endRecording()->playback(canvas); | 95 pictureBuilder.endRecording()->playback(canvas); |
97 } | 96 } |
98 | 97 |
99 void PageWidgetDelegate::paint(Page& page, WebCanvas* canvas, | 98 void PageWidgetDelegate::paint(Page& page, WebCanvas* canvas, |
100 const WebRect& rect, LocalFrame& root) | 99 const WebRect& rect, LocalFrame& root) |
101 { | 100 { |
102 paintInternal(page, canvas, rect, root, GlobalPaintNormalPhase); | 101 paintInternal(page, canvas, rect, root, GlobalPaintNormalPhase); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 WEBINPUT_EVENT_CASE(TouchEnd) | 254 WEBINPUT_EVENT_CASE(TouchEnd) |
256 WEBINPUT_EVENT_CASE(TouchCancel) | 255 WEBINPUT_EVENT_CASE(TouchCancel) |
257 WEBINPUT_EVENT_CASE(TouchScrollStarted) | 256 WEBINPUT_EVENT_CASE(TouchScrollStarted) |
258 default: | 257 default: |
259 NOTREACHED(); | 258 NOTREACHED(); |
260 return ""; | 259 return ""; |
261 } | 260 } |
262 } | 261 } |
263 | 262 |
264 } // namespace blink | 263 } // namespace blink |
OLD | NEW |