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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2509113004: Don't paint SVG image documents unless actually painting. (Closed)
Patch Set: none Created 4 years, 1 month 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 | « no previous file | 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) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG 485 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG
486 // images can't have any so we assert there's no script. 486 // images can't have any so we assert there's no script.
487 ScriptForbiddenScope forbidScript; 487 ScriptForbiddenScope forbidScript;
488 488
489 // The calls below may trigger GCs, so set up the required persistent 489 // The calls below may trigger GCs, so set up the required persistent
490 // reference on the ImageResource which owns this SVGImage. By transitivity, 490 // reference on the ImageResource which owns this SVGImage. By transitivity,
491 // that will keep the associated SVGImageChromeClient object alive. 491 // that will keep the associated SVGImageChromeClient object alive.
492 Persistent<ImageObserver> protect(getImageObserver()); 492 Persistent<ImageObserver> protect(getImageObserver());
493 m_page->animator().serviceScriptedAnimations(monotonicAnimationStartTime); 493 m_page->animator().serviceScriptedAnimations(monotonicAnimationStartTime);
494 m_page->animator().updateAllLifecyclePhases( 494 // Do *not* update the paint phase. It's critical to paint only when
495 *toLocalFrame(m_page->mainFrame())); 495 // actually generating painted output, not only for performance reasons,
496 // but to preserve correct coherence of the cache of the output with
497 // the needsRepaint bits of the PaintLayers in the image.
498 toLocalFrame(m_page->mainFrame())
499 ->view()
500 ->updateAllLifecyclePhasesExceptPaint();
496 } 501 }
497 502
498 void SVGImage::advanceAnimationForTesting() { 503 void SVGImage::advanceAnimationForTesting() {
499 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { 504 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) {
500 rootElement->timeContainer()->advanceFrameForTesting(); 505 rootElement->timeContainer()->advanceFrameForTesting();
501 506
502 // The following triggers animation updates which can issue a new draw 507 // The following triggers animation updates which can issue a new draw
503 // but will not permanently change the animation timeline. 508 // but will not permanently change the animation timeline.
504 // TODO(pdr): Actually advance the document timeline so CSS animations 509 // TODO(pdr): Actually advance the document timeline so CSS animations
505 // can be properly tested. 510 // can be properly tested.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 } 622 }
618 623
619 return m_page ? SizeAvailable : SizeUnavailable; 624 return m_page ? SizeAvailable : SizeUnavailable;
620 } 625 }
621 626
622 String SVGImage::filenameExtension() const { 627 String SVGImage::filenameExtension() const {
623 return "svg"; 628 return "svg";
624 } 629 }
625 630
626 } // namespace blink 631 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698