|
Lines 35-40
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec1
|
| 35 |
#include "WebPreferencesKeys.h" |
35 |
#include "WebPreferencesKeys.h" |
| 36 |
#include <WebCore/GraphicsContext.h> |
36 |
#include <WebCore/GraphicsContext.h> |
| 37 |
#include <WebCore/Page.h> |
37 |
#include <WebCore/Page.h> |
|
|
38 |
#include <WebCore/PlatformContextCairo.h> |
| 38 |
#include <WebCore/Settings.h> |
39 |
#include <WebCore/Settings.h> |
| 39 |
|
40 |
|
| 40 |
using namespace WebCore; |
41 |
using namespace WebCore; |
|
Lines 43-61
namespace WebKit {
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec2
|
| 43 |
|
44 |
|
| 44 |
DrawingAreaImpl::~DrawingAreaImpl() |
45 |
DrawingAreaImpl::~DrawingAreaImpl() |
| 45 |
{ |
46 |
{ |
|
|
47 |
g_printerr("%s: destructed!\n", __func__); |
| 46 |
} |
48 |
} |
| 47 |
|
49 |
|
| 48 |
DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParameters& parameters) |
50 |
DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParameters& parameters) |
| 49 |
: AcceleratedDrawingArea(webPage, parameters) |
51 |
: AcceleratedDrawingArea(webPage, parameters) |
| 50 |
, m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired) |
52 |
, m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired) |
| 51 |
{ |
53 |
{ |
|
|
54 |
g_printerr("%s: instantiated!\n", __func__); |
| 52 |
} |
55 |
} |
| 53 |
|
56 |
|
| 54 |
void DrawingAreaImpl::setNeedsDisplay() |
57 |
void DrawingAreaImpl::setNeedsDisplay() |
| 55 |
{ |
58 |
{ |
|
|
59 |
g_printerr("%s\n", __func__); |
| 56 |
if (m_layerTreeHost) { |
60 |
if (m_layerTreeHost) { |
| 57 |
ASSERT(m_dirtyRegion.isEmpty()); |
61 |
ASSERT(m_dirtyRegion.isEmpty()); |
| 58 |
AcceleratedDrawingArea::setNeedsDisplay(); |
62 |
AcceleratedDrawingArea::setNeedsDisplay(); |
|
|
63 |
g_printerr(" m_layerTreeHost -> AcceleratedDrawingArea::setNeedsDisplay()\n"); |
| 59 |
return; |
64 |
return; |
| 60 |
} |
65 |
} |
| 61 |
|
66 |
|
|
Lines 64-102
void DrawingAreaImpl::setNeedsDisplay()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec3
|
| 64 |
|
69 |
|
| 65 |
void DrawingAreaImpl::setNeedsDisplayInRect(const IntRect& rect) |
70 |
void DrawingAreaImpl::setNeedsDisplayInRect(const IntRect& rect) |
| 66 |
{ |
71 |
{ |
|
|
72 |
g_printerr("%s\n", __func__); |
| 67 |
if (m_layerTreeHost) { |
73 |
if (m_layerTreeHost) { |
| 68 |
ASSERT(m_dirtyRegion.isEmpty()); |
74 |
ASSERT(m_dirtyRegion.isEmpty()); |
| 69 |
AcceleratedDrawingArea::setNeedsDisplayInRect(rect); |
75 |
AcceleratedDrawingArea::setNeedsDisplayInRect(rect); |
|
|
76 |
g_printerr(" m_layerTreeHost -> AcceleratedDrawingArea::setNeedsDisplayInRect()\n"); |
| 70 |
return; |
77 |
return; |
| 71 |
} |
78 |
} |
| 72 |
|
79 |
|
| 73 |
if (!m_isPaintingEnabled) |
80 |
if (!m_isPaintingEnabled) { |
|
|
81 |
g_printerr(" !m_isPaintingEnabled -> early return\n"); |
| 74 |
return; |
82 |
return; |
|
|
83 |
} |
| 75 |
|
84 |
|
| 76 |
IntRect dirtyRect = rect; |
85 |
IntRect dirtyRect = rect; |
| 77 |
dirtyRect.intersect(m_webPage.bounds()); |
86 |
dirtyRect.intersect(m_webPage.bounds()); |
| 78 |
if (dirtyRect.isEmpty()) |
87 |
if (dirtyRect.isEmpty()) { |
|
|
88 |
g_printerr(" dirty.isEmpty() -> early return\n"); |
| 79 |
return; |
89 |
return; |
|
|
90 |
} |
| 80 |
|
91 |
|
|
|
92 |
g_printerr(" continuing -> scheduleDisplay()\n"); |
| 81 |
m_dirtyRegion.unite(dirtyRect); |
93 |
m_dirtyRegion.unite(dirtyRect); |
| 82 |
scheduleDisplay(); |
94 |
scheduleDisplay(); |
| 83 |
} |
95 |
} |
| 84 |
|
96 |
|
| 85 |
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDelta) |
97 |
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDelta) |
| 86 |
{ |
98 |
{ |
|
|
99 |
g_printerr("%s\n", __func__); |
| 87 |
if (m_layerTreeHost) { |
100 |
if (m_layerTreeHost) { |
| 88 |
ASSERT(m_scrollRect.isEmpty()); |
101 |
ASSERT(m_scrollRect.isEmpty()); |
| 89 |
ASSERT(m_scrollOffset.isEmpty()); |
102 |
ASSERT(m_scrollOffset.isEmpty()); |
| 90 |
ASSERT(m_dirtyRegion.isEmpty()); |
103 |
ASSERT(m_dirtyRegion.isEmpty()); |
| 91 |
AcceleratedDrawingArea::scroll(scrollRect, scrollDelta); |
104 |
AcceleratedDrawingArea::scroll(scrollRect, scrollDelta); |
|
|
105 |
g_printerr(" m_layerTreeHost -> AcceleratedDrawingArea::scroll()\n"); |
| 92 |
return; |
106 |
return; |
| 93 |
} |
107 |
} |
| 94 |
|
108 |
|
| 95 |
if (!m_isPaintingEnabled) |
109 |
if (!m_isPaintingEnabled) { |
|
|
110 |
g_printerr(" !m_isPaintingEnabled -> early return\n"); |
| 96 |
return; |
111 |
return; |
|
|
112 |
} |
| 97 |
|
113 |
|
| 98 |
if (scrollRect.isEmpty()) |
114 |
if (scrollRect.isEmpty()) { |
|
|
115 |
g_printerr(" scrollRect.isEmpty() -> early return\n"); |
| 99 |
return; |
116 |
return; |
|
|
117 |
} |
| 100 |
|
118 |
|
| 101 |
if (m_previousLayerTreeHost) |
119 |
if (m_previousLayerTreeHost) |
| 102 |
m_previousLayerTreeHost->scrollNonCompositedContents(scrollRect); |
120 |
m_previousLayerTreeHost->scrollNonCompositedContents(scrollRect); |
|
Lines 108-113
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDel
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec4
|
| 108 |
if (currentScrollArea >= scrollArea) { |
126 |
if (currentScrollArea >= scrollArea) { |
| 109 |
// The rect being scrolled is at least as large as the rect we'd like to scroll. |
127 |
// The rect being scrolled is at least as large as the rect we'd like to scroll. |
| 110 |
// Go ahead and just invalidate the scroll rect. |
128 |
// Go ahead and just invalidate the scroll rect. |
|
|
129 |
g_printerr(" big scroll area -> invalidate viewport\n"); |
| 111 |
setNeedsDisplayInRect(scrollRect); |
130 |
setNeedsDisplayInRect(scrollRect); |
| 112 |
return; |
131 |
return; |
| 113 |
} |
132 |
} |
|
Lines 144-149
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDel
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec5
|
| 144 |
|
163 |
|
| 145 |
void DrawingAreaImpl::forceRepaint() |
164 |
void DrawingAreaImpl::forceRepaint() |
| 146 |
{ |
165 |
{ |
|
|
166 |
g_printerr("%s\n", __func__); |
| 147 |
if (m_inUpdateBackingStoreState) { |
167 |
if (m_inUpdateBackingStoreState) { |
| 148 |
m_forceRepaintAfterBackingStoreStateUpdate = true; |
168 |
m_forceRepaintAfterBackingStoreStateUpdate = true; |
| 149 |
return; |
169 |
return; |
|
Lines 164-181
void DrawingAreaImpl::forceRepaint()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec6
|
| 164 |
|
184 |
|
| 165 |
void DrawingAreaImpl::mainFrameContentSizeChanged(const WebCore::IntSize& newSize) |
185 |
void DrawingAreaImpl::mainFrameContentSizeChanged(const WebCore::IntSize& newSize) |
| 166 |
{ |
186 |
{ |
|
|
187 |
g_printerr("%s\n", __func__); |
| 167 |
#if USE(COORDINATED_GRAPHICS_THREADED) |
188 |
#if USE(COORDINATED_GRAPHICS_THREADED) |
| 168 |
if (m_layerTreeHost) |
189 |
if (m_layerTreeHost) { |
|
|
190 |
g_printerr(" m_layerTreeHost -> delegating\n"); |
| 169 |
m_layerTreeHost->contentsSizeChanged(newSize); |
191 |
m_layerTreeHost->contentsSizeChanged(newSize); |
| 170 |
else if (m_previousLayerTreeHost) |
192 |
} else if (m_previousLayerTreeHost) { |
|
|
193 |
g_printerr(" m_previousLayerTreeHost -> delegating\n"); |
| 171 |
m_previousLayerTreeHost->contentsSizeChanged(newSize); |
194 |
m_previousLayerTreeHost->contentsSizeChanged(newSize); |
|
|
195 |
} |
| 172 |
#else |
196 |
#else |
|
|
197 |
g_printerr(" dummy no-op implementation\n"); |
| 173 |
UNUSED_PARAM(newSize); |
198 |
UNUSED_PARAM(newSize); |
| 174 |
#endif |
199 |
#endif |
| 175 |
} |
200 |
} |
| 176 |
|
201 |
|
| 177 |
void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store) |
202 |
void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store) |
| 178 |
{ |
203 |
{ |
|
|
204 |
g_printerr("%s\n", __func__); |
| 179 |
Settings& settings = m_webPage.corePage()->settings(); |
205 |
Settings& settings = m_webPage.corePage()->settings(); |
| 180 |
settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey())); |
206 |
settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey())); |
| 181 |
|
207 |
|
|
Lines 186-198
void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec7
|
| 186 |
settings.setFixedPositionCreatesStackingContext(settings.acceleratedCompositingEnabled()); |
212 |
settings.setFixedPositionCreatesStackingContext(settings.acceleratedCompositingEnabled()); |
| 187 |
#endif |
213 |
#endif |
| 188 |
|
214 |
|
|
|
215 |
g_printerr(" AC enabled: %s\n", settings.acceleratedCompositingEnabled() ? "yes" : "no"); |
| 216 |
g_printerr(" AC forced: %s\n", settings.forceCompositingMode() ? "yes" : "no"); |
| 217 |
g_printerr(" layerTreeHost: %p\n", !!m_layerTreeHost ? "yes" : "no"); |
| 218 |
|
| 189 |
m_alwaysUseCompositing = settings.acceleratedCompositingEnabled() && settings.forceCompositingMode(); |
219 |
m_alwaysUseCompositing = settings.acceleratedCompositingEnabled() && settings.forceCompositingMode(); |
| 190 |
if (m_alwaysUseCompositing && !m_layerTreeHost) |
220 |
if (m_alwaysUseCompositing && !m_layerTreeHost) { |
|
|
221 |
g_printerr(" will call enterAcceleratedCompositingMode(nullptr)\n"); |
| 191 |
enterAcceleratedCompositingMode(nullptr); |
222 |
enterAcceleratedCompositingMode(nullptr); |
|
|
223 |
} |
| 192 |
} |
224 |
} |
| 193 |
|
225 |
|
| 194 |
void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer) |
226 |
void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer) |
| 195 |
{ |
227 |
{ |
|
|
228 |
g_printerr("%s\n", __func__); |
| 196 |
if (m_layerTreeHost) { |
229 |
if (m_layerTreeHost) { |
| 197 |
AcceleratedDrawingArea::setRootCompositingLayer(graphicsLayer); |
230 |
AcceleratedDrawingArea::setRootCompositingLayer(graphicsLayer); |
| 198 |
|
231 |
|
|
Lines 218-223
void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec8
|
| 218 |
|
251 |
|
| 219 |
void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset) |
252 |
void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset) |
| 220 |
{ |
253 |
{ |
|
|
254 |
g_printerr("%s\n", __func__); |
| 255 |
g_printerr(" m_forceRepaintAfterBackingStoreStateUpdate: %s\n", |
| 256 |
m_forceRepaintAfterBackingStoreStateUpdate ? "yes" : "no"); |
| 221 |
if (stateID != m_backingStoreStateID && !m_layerTreeHost) |
257 |
if (stateID != m_backingStoreStateID && !m_layerTreeHost) |
| 222 |
m_dirtyRegion = IntRect(IntPoint(), size); |
258 |
m_dirtyRegion = IntRect(IntPoint(), size); |
| 223 |
|
259 |
|
|
Lines 229-234
void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImme
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec9
|
| 229 |
|
265 |
|
| 230 |
void DrawingAreaImpl::didUpdateBackingStoreState() |
266 |
void DrawingAreaImpl::didUpdateBackingStoreState() |
| 231 |
{ |
267 |
{ |
|
|
268 |
g_printerr("%s\n", __func__); |
| 232 |
// The UI process has updated to a new backing store state. Any Update messages we sent before |
269 |
// The UI process has updated to a new backing store state. Any Update messages we sent before |
| 233 |
// this point will be ignored. We wait to set this to false until after updating the page's |
270 |
// this point will be ignored. We wait to set this to false until after updating the page's |
| 234 |
// size so that any displays triggered by the relayout will be ignored. If we're supposed to |
271 |
// size so that any displays triggered by the relayout will be ignored. If we're supposed to |
|
Lines 239-244
void DrawingAreaImpl::didUpdateBackingStoreState()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec10
|
| 239 |
|
276 |
|
| 240 |
void DrawingAreaImpl::sendDidUpdateBackingStoreState() |
277 |
void DrawingAreaImpl::sendDidUpdateBackingStoreState() |
| 241 |
{ |
278 |
{ |
|
|
279 |
g_printerr("%s\n", __func__); |
| 242 |
ASSERT(!m_isWaitingForDidUpdate); |
280 |
ASSERT(!m_isWaitingForDidUpdate); |
| 243 |
ASSERT(m_shouldSendDidUpdateBackingStoreState); |
281 |
ASSERT(m_shouldSendDidUpdateBackingStoreState); |
| 244 |
|
282 |
|
|
Lines 260-265
void DrawingAreaImpl::sendDidUpdateBackingStoreState()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec11
|
| 260 |
|
298 |
|
| 261 |
void DrawingAreaImpl::didUpdate() |
299 |
void DrawingAreaImpl::didUpdate() |
| 262 |
{ |
300 |
{ |
|
|
301 |
g_printerr("%s\n", __func__); |
| 263 |
// We might get didUpdate messages from the UI process even after we've |
302 |
// We might get didUpdate messages from the UI process even after we've |
| 264 |
// entered accelerated compositing mode. Ignore them. |
303 |
// entered accelerated compositing mode. Ignore them. |
| 265 |
if (m_layerTreeHost) |
304 |
if (m_layerTreeHost) |
|
Lines 273-284
void DrawingAreaImpl::didUpdate()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec12
|
| 273 |
|
312 |
|
| 274 |
void DrawingAreaImpl::suspendPainting() |
313 |
void DrawingAreaImpl::suspendPainting() |
| 275 |
{ |
314 |
{ |
|
|
315 |
g_printerr("%s\n", __func__); |
| 276 |
AcceleratedDrawingArea::suspendPainting(); |
316 |
AcceleratedDrawingArea::suspendPainting(); |
| 277 |
m_displayTimer.stop(); |
317 |
m_displayTimer.stop(); |
| 278 |
} |
318 |
} |
| 279 |
|
319 |
|
| 280 |
void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer) |
320 |
void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer) |
| 281 |
{ |
321 |
{ |
|
|
322 |
g_printerr("%s(%p)\n", __func__, graphicsLayer); |
| 282 |
AcceleratedDrawingArea::enterAcceleratedCompositingMode(graphicsLayer); |
323 |
AcceleratedDrawingArea::enterAcceleratedCompositingMode(graphicsLayer); |
| 283 |
|
324 |
|
| 284 |
// Non-composited content will now be handled exclusively by the layer tree host. |
325 |
// Non-composited content will now be handled exclusively by the layer tree host. |
|
Lines 291-296
void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLay
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec13
|
| 291 |
|
332 |
|
| 292 |
void DrawingAreaImpl::exitAcceleratedCompositingMode() |
333 |
void DrawingAreaImpl::exitAcceleratedCompositingMode() |
| 293 |
{ |
334 |
{ |
|
|
335 |
g_printerr("%s\n", __func__); |
| 294 |
if (m_alwaysUseCompositing) |
336 |
if (m_alwaysUseCompositing) |
| 295 |
return; |
337 |
return; |
| 296 |
|
338 |
|
|
Lines 326-331
void DrawingAreaImpl::exitAcceleratedCompositingMode()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec14
|
| 326 |
|
368 |
|
| 327 |
void DrawingAreaImpl::scheduleDisplay() |
369 |
void DrawingAreaImpl::scheduleDisplay() |
| 328 |
{ |
370 |
{ |
|
|
371 |
g_printerr("%s\n", __func__); |
| 329 |
ASSERT(!m_layerTreeHost); |
372 |
ASSERT(!m_layerTreeHost); |
| 330 |
|
373 |
|
| 331 |
if (m_isWaitingForDidUpdate) |
374 |
if (m_isWaitingForDidUpdate) |
|
Lines 345-364
void DrawingAreaImpl::scheduleDisplay()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec15
|
| 345 |
|
388 |
|
| 346 |
void DrawingAreaImpl::displayTimerFired() |
389 |
void DrawingAreaImpl::displayTimerFired() |
| 347 |
{ |
390 |
{ |
|
|
391 |
g_printerr("%s\n", __func__); |
| 348 |
display(); |
392 |
display(); |
| 349 |
} |
393 |
} |
| 350 |
|
394 |
|
| 351 |
void DrawingAreaImpl::display() |
395 |
void DrawingAreaImpl::display() |
| 352 |
{ |
396 |
{ |
|
|
397 |
g_printerr("%s\n", __func__); |
| 353 |
ASSERT(!m_layerTreeHost); |
398 |
ASSERT(!m_layerTreeHost); |
| 354 |
ASSERT(!m_isWaitingForDidUpdate); |
399 |
ASSERT(!m_isWaitingForDidUpdate); |
| 355 |
ASSERT(!m_inUpdateBackingStoreState); |
400 |
ASSERT(!m_inUpdateBackingStoreState); |
| 356 |
|
401 |
|
| 357 |
if (m_isPaintingSuspended) |
402 |
if (m_isPaintingSuspended) { |
|
|
403 |
g_printerr("%s: painting suspended -> early return\n", __func__); |
| 358 |
return; |
404 |
return; |
|
|
405 |
} |
| 359 |
|
406 |
|
| 360 |
if (m_dirtyRegion.isEmpty()) |
407 |
if (m_dirtyRegion.isEmpty()) { |
|
|
408 |
g_printerr("%s: empty dirty region -> early return\n", __func__); |
| 361 |
return; |
409 |
return; |
|
|
410 |
} |
| 362 |
|
411 |
|
| 363 |
if (m_shouldSendDidUpdateBackingStoreState) { |
412 |
if (m_shouldSendDidUpdateBackingStoreState) { |
| 364 |
sendDidUpdateBackingStoreState(); |
413 |
sendDidUpdateBackingStoreState(); |
|
Lines 371-376
void DrawingAreaImpl::display()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec16
|
| 371 |
if (m_layerTreeHost) { |
420 |
if (m_layerTreeHost) { |
| 372 |
// The call to update caused layout which turned on accelerated compositing. |
421 |
// The call to update caused layout which turned on accelerated compositing. |
| 373 |
// Don't send an Update message in this case. |
422 |
// Don't send an Update message in this case. |
|
|
423 |
g_printerr("%s: layerTree -> early return\n", __func__); |
| 374 |
return; |
424 |
return; |
| 375 |
} |
425 |
} |
| 376 |
|
426 |
|
|
Lines 380-385
void DrawingAreaImpl::display()
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec17
|
| 380 |
|
430 |
|
| 381 |
static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>& rects) |
431 |
static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>& rects) |
| 382 |
{ |
432 |
{ |
|
|
433 |
g_printerr("%s\n", __func__); |
| 383 |
const size_t rectThreshold = 10; |
434 |
const size_t rectThreshold = 10; |
| 384 |
const double wastedSpaceThreshold = 0.75; |
435 |
const double wastedSpaceThreshold = 0.75; |
| 385 |
|
436 |
|
|
Lines 401-406
static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>&
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec18
|
| 401 |
|
452 |
|
| 402 |
void DrawingAreaImpl::display(UpdateInfo& updateInfo) |
453 |
void DrawingAreaImpl::display(UpdateInfo& updateInfo) |
| 403 |
{ |
454 |
{ |
|
|
455 |
g_printerr("%s\n", __func__); |
| 404 |
ASSERT(!m_isPaintingSuspended); |
456 |
ASSERT(!m_isPaintingSuspended); |
| 405 |
ASSERT(!m_layerTreeHost); |
457 |
ASSERT(!m_layerTreeHost); |
| 406 |
ASSERT(!m_webPage.size().isEmpty()); |
458 |
ASSERT(!m_webPage.size().isEmpty()); |
|
Lines 409-416
void DrawingAreaImpl::display(UpdateInfo& updateInfo)
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec19
|
| 409 |
|
461 |
|
| 410 |
// The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is |
462 |
// The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is |
| 411 |
// in charge of displaying, we have nothing more to do. |
463 |
// in charge of displaying, we have nothing more to do. |
| 412 |
if (m_layerTreeHost) |
464 |
if (m_layerTreeHost) { |
|
|
465 |
g_printerr("%s: no m_layerTreeHost -> early return\n", __func__); |
| 413 |
return; |
466 |
return; |
|
|
467 |
} |
| 414 |
|
468 |
|
| 415 |
updateInfo.viewSize = m_webPage.size(); |
469 |
updateInfo.viewSize = m_webPage.size(); |
| 416 |
updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor(); |
470 |
updateInfo.deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor(); |
|
Lines 423-433
void DrawingAreaImpl::display(UpdateInfo& updateInfo)
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec20
|
| 423 |
float deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor(); |
477 |
float deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor(); |
| 424 |
bitmapSize.scale(deviceScaleFactor); |
478 |
bitmapSize.scale(deviceScaleFactor); |
| 425 |
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bitmapSize, ShareableBitmap::SupportsAlpha); |
479 |
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bitmapSize, ShareableBitmap::SupportsAlpha); |
| 426 |
if (!bitmap) |
480 |
if (!bitmap) { |
|
|
481 |
g_printerr("%s: no bitmap -> early return\n", __func__); |
| 427 |
return; |
482 |
return; |
|
|
483 |
} |
| 428 |
|
484 |
|
| 429 |
if (!bitmap->createHandle(updateInfo.bitmapHandle)) |
485 |
if (!bitmap->createHandle(updateInfo.bitmapHandle)) { |
|
|
486 |
g_printerr("%s: bitmap->createHandle failure -> eary return\n", __func__); |
| 430 |
return; |
487 |
return; |
|
|
488 |
} |
| 431 |
|
489 |
|
| 432 |
Vector<IntRect> rects; |
490 |
Vector<IntRect> rects; |
| 433 |
if (m_webPage.drawsBackground()) { |
491 |
if (m_webPage.drawsBackground()) { |
|
Lines 459-464
void DrawingAreaImpl::display(UpdateInfo& updateInfo)
a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp_sec21
|
| 459 |
updateInfo.updateRects.append(rect); |
517 |
updateInfo.updateRects.append(rect); |
| 460 |
} |
518 |
} |
| 461 |
|
519 |
|
|
|
520 |
static unsigned i = 0; |
| 521 |
GUniquePtr<char> filename(g_strdup_printf("/tmp/surfaceA-%u.png", ++i)); |
| 522 |
cairo_surface_write_to_png(cairo_get_target(graphicsContext->platformContext()->cr()), filename.get()); |
| 523 |
|
| 462 |
// Layout can trigger more calls to setNeedsDisplay and we don't want to process them |
524 |
// Layout can trigger more calls to setNeedsDisplay and we don't want to process them |
| 463 |
// until the UI process has painted the update, so we stop the timer here. |
525 |
// until the UI process has painted the update, so we stop the timer here. |
| 464 |
m_displayTimer.stop(); |
526 |
m_displayTimer.stop(); |