Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1890603002: Partly revert https://codereview.chromium.org/1860273003/ where paint follows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 IntRect pageRect = m_pageRects[pageNumber]; 296 IntRect pageRect = m_pageRects[pageNumber];
297 return m_printedPageWidth / pageRect.width(); 297 return m_printedPageWidth / pageRect.width();
298 } 298 }
299 299
300 float spoolSinglePage(WebCanvas* canvas, int pageNumber) 300 float spoolSinglePage(WebCanvas* canvas, int pageNumber)
301 { 301 {
302 dispatchEventsForPrintingOnAllFrames(); 302 dispatchEventsForPrintingOnAllFrames();
303 if (!frame()->document() || !frame()->document()->layoutView()) 303 if (!frame()->document() || !frame()->document()->layoutView())
304 return 0; 304 return 0;
305 305
306 frame()->view()->updateLifecycleToCompositingCleanPlusScrolling(); 306 // TODO(crbug.com/603230): Synchronized painting is unnecessary in this lifecycle update.
307 frame()->view()->updateAllLifecyclePhases();
307 if (!frame()->document() || !frame()->document()->layoutView()) 308 if (!frame()->document() || !frame()->document()->layoutView())
308 return 0; 309 return 0;
309 310
310 IntRect pageRect = m_pageRects[pageNumber]; 311 IntRect pageRect = m_pageRects[pageNumber];
311 SkPictureBuilder pictureBuilder(pageRect, &skia::GetMetaData(*canvas)); 312 SkPictureBuilder pictureBuilder(pageRect, &skia::GetMetaData(*canvas));
312 pictureBuilder.context().setPrinting(true); 313 pictureBuilder.context().setPrinting(true);
313 314
314 float scale = spoolPage(pictureBuilder.context(), pageNumber); 315 float scale = spoolPage(pictureBuilder.context(), pageNumber);
315 pictureBuilder.endRecording()->playback(canvas); 316 pictureBuilder.endRecording()->playback(canvas);
316 return scale; 317 return scale;
317 } 318 }
318 319
319 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz eInPixels) 320 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz eInPixels)
320 { 321 {
321 dispatchEventsForPrintingOnAllFrames(); 322 dispatchEventsForPrintingOnAllFrames();
322 if (!frame()->document() || !frame()->document()->layoutView()) 323 if (!frame()->document() || !frame()->document()->layoutView())
323 return; 324 return;
324 325
325 // TODO(chrishtr): this should be updateLifecycleToCompositingCleanPlusS crolling, but 326 // TODO(crbug.com/603230): Synchronized painting is unnecessary in this lifecycle update.
326 // for some reason it makes printing/absolute-position-headers-and-foote rs.html fail.
327 frame()->view()->updateAllLifecyclePhases(); 327 frame()->view()->updateAllLifecyclePhases();
328 if (!frame()->document() || !frame()->document()->layoutView()) 328 if (!frame()->document() || !frame()->document()->layoutView())
329 return; 329 return;
330 330
331 float pageHeight; 331 float pageHeight;
332 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight); 332 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
333 333
334 const float pageWidth = pageSizeInPixels.width(); 334 const float pageWidth = pageSizeInPixels.width();
335 size_t numPages = pageRects().size(); 335 size_t numPages = pageRects().size();
336 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1; 336 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1;
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 return WebSandboxFlags::None; 2130 return WebSandboxFlags::None;
2131 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2131 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2132 } 2132 }
2133 2133
2134 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2134 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2135 { 2135 {
2136 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2136 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2137 } 2137 }
2138 2138
2139 } // namespace blink 2139 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698