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

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

Issue 1225583004: Revert of Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebAXObject.cpp ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 IntRect pageRect = m_pageRects[pageNumber]; 350 IntRect pageRect = m_pageRects[pageNumber];
351 return m_printedPageWidth / pageRect.width(); 351 return m_printedPageWidth / pageRect.width();
352 } 352 }
353 353
354 float spoolSinglePage(WebCanvas* canvas, int pageNumber) 354 float spoolSinglePage(WebCanvas* canvas, int pageNumber)
355 { 355 {
356 dispatchEventsForPrintingOnAllFrames(); 356 dispatchEventsForPrintingOnAllFrames();
357 if (!frame()->document() || !frame()->document()->layoutView()) 357 if (!frame()->document() || !frame()->document()->layoutView())
358 return 0; 358 return 0;
359 359
360 frame()->view()->updateAllLifecyclePhases(); 360 frame()->view()->updateLayoutAndStyleForPainting();
361 if (!frame()->document() || !frame()->document()->layoutView()) 361 if (!frame()->document() || !frame()->document()->layoutView())
362 return 0; 362 return 0;
363 363
364 IntRect pageRect = m_pageRects[pageNumber]; 364 IntRect pageRect = m_pageRects[pageNumber];
365 SkPictureBuilder pictureBuilder(pageRect, &skia::getMetaData(*canvas)); 365 SkPictureBuilder pictureBuilder(pageRect, &skia::getMetaData(*canvas));
366 pictureBuilder.context().setPrinting(true); 366 pictureBuilder.context().setPrinting(true);
367 367
368 float scale = spoolPage(pictureBuilder.context(), pageNumber); 368 float scale = spoolPage(pictureBuilder.context(), pageNumber);
369 pictureBuilder.endRecording()->playback(canvas); 369 pictureBuilder.endRecording()->playback(canvas);
370 outputLinkedDestinations(canvas, pageRect); 370 outputLinkedDestinations(canvas, pageRect);
371 return scale; 371 return scale;
372 } 372 }
373 373
374 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz eInPixels) 374 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz eInPixels)
375 { 375 {
376 dispatchEventsForPrintingOnAllFrames(); 376 dispatchEventsForPrintingOnAllFrames();
377 if (!frame()->document() || !frame()->document()->layoutView()) 377 if (!frame()->document() || !frame()->document()->layoutView())
378 return; 378 return;
379 379
380 frame()->view()->updateAllLifecyclePhases(); 380 frame()->view()->updateLayoutAndStyleForPainting();
381 if (!frame()->document() || !frame()->document()->layoutView()) 381 if (!frame()->document() || !frame()->document()->layoutView())
382 return; 382 return;
383 383
384 float pageHeight; 384 float pageHeight;
385 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight); 385 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
386 386
387 const float pageWidth = pageSizeInPixels.width(); 387 const float pageWidth = pageSizeInPixels.width();
388 size_t numPages = pageRects().size(); 388 size_t numPages = pageRects().size();
389 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1; 389 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1;
390 IntRect allPagesRect(0, 0, pageWidth, totalHeight); 390 IntRect allPagesRect(0, 0, pageWidth, totalHeight);
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 } 2189 }
2190 2190
2191 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2191 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2192 { 2192 {
2193 if (!frame()) 2193 if (!frame())
2194 return WebSandboxFlags::None; 2194 return WebSandboxFlags::None;
2195 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2195 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2196 } 2196 }
2197 2197
2198 } // namespace blink 2198 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebAXObject.cpp ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698