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

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

Issue 2693363002: Move animation update to follow paint phase for SPv2. (Closed)
Patch Set: Update comment. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 3772c766de4d08a1a18cc4fd521339c4bb7a1939..f767fa70e2799a981ecda85723dfecbdaa5653fc 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -27,12 +27,14 @@
#include "core/svg/graphics/SVGImage.h"
+#include "core/animation/DocumentAnimations.h"
#include "core/animation/DocumentTimeline.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/shadow/FlatTreeTraversal.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/layout/LayoutView.h"
#include "core/layout/svg/LayoutSVGRoot.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/paint/FloatClipRecorder.h"
@@ -523,9 +525,19 @@ void SVGImage::serviceAnimations(double monotonicAnimationStartTime) {
// actually generating painted output, not only for performance reasons,
// but to preserve correct coherence of the cache of the output with
// the needsRepaint bits of the PaintLayers in the image.
- toLocalFrame(m_page->mainFrame())
- ->view()
- ->updateAllLifecyclePhasesExceptPaint();
+ FrameView* frameView = toLocalFrame(m_page->mainFrame())->view();
+ frameView->updateAllLifecyclePhasesExceptPaint();
+
+ // For SPv2 we run updateAnimations after the paint phase, but per above
+ // comment we don't want to run lifecycle through to paint for SVG images.
+ // Since we know SVG images never have composited animations we can update
+ // animations directly without worrying about including
+ // PaintArtifactCompositor analysis of whether animations should be
+ // composited.
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ DocumentAnimations::updateAnimations(frameView->layoutView()->document(),
+ DocumentLifecycle::LayoutClean);
+ }
}
void SVGImage::advanceAnimationForTesting() {
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698