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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutEmbeddedObject.cpp

Issue 2393043002: [SPInvalidation] Enable LayoutEmbeddedObject paint invalidation in new path (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 14 matching lines...) Expand all
25 25
26 #include "core/CSSValueKeywords.h" 26 #include "core/CSSValueKeywords.h"
27 #include "core/HTMLNames.h" 27 #include "core/HTMLNames.h"
28 #include "core/frame/FrameView.h" 28 #include "core/frame/FrameView.h"
29 #include "core/frame/LocalFrame.h" 29 #include "core/frame/LocalFrame.h"
30 #include "core/html/HTMLIFrameElement.h" 30 #include "core/html/HTMLIFrameElement.h"
31 #include "core/html/HTMLPlugInElement.h" 31 #include "core/html/HTMLPlugInElement.h"
32 #include "core/layout/LayoutAnalyzer.h" 32 #include "core/layout/LayoutAnalyzer.h"
33 #include "core/layout/LayoutView.h" 33 #include "core/layout/LayoutView.h"
34 #include "core/page/Page.h" 34 #include "core/page/Page.h"
35 #include "core/paint/EmbeddedObjectPaintInvalidator.h"
35 #include "core/paint/EmbeddedObjectPainter.h" 36 #include "core/paint/EmbeddedObjectPainter.h"
36 #include "core/plugins/PluginView.h" 37 #include "core/plugins/PluginView.h"
37 #include "platform/text/PlatformLocale.h" 38 #include "platform/text/PlatformLocale.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 using namespace HTMLNames; 42 using namespace HTMLNames;
42 43
43 LayoutEmbeddedObject::LayoutEmbeddedObject(Element* element) 44 LayoutEmbeddedObject::LayoutEmbeddedObject(Element* element)
44 : LayoutPart(element) { 45 : LayoutPart(element) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 109 }
109 110
110 LayoutPart::paint(paintInfo, paintOffset); 111 LayoutPart::paint(paintInfo, paintOffset);
111 } 112 }
112 113
113 void LayoutEmbeddedObject::paintReplaced(const PaintInfo& paintInfo, 114 void LayoutEmbeddedObject::paintReplaced(const PaintInfo& paintInfo,
114 const LayoutPoint& paintOffset) const { 115 const LayoutPoint& paintOffset) const {
115 EmbeddedObjectPainter(*this).paintReplaced(paintInfo, paintOffset); 116 EmbeddedObjectPainter(*this).paintReplaced(paintInfo, paintOffset);
116 } 117 }
117 118
119 PaintInvalidationReason LayoutEmbeddedObject::invalidatePaintIfNeeded(
120 const PaintInvalidatorContext& context) const {
121 return EmbeddedObjectPaintInvalidator(*this, context)
122 .invalidatePaintIfNeeded();
123 }
124
118 void LayoutEmbeddedObject::layout() { 125 void LayoutEmbeddedObject::layout() {
119 ASSERT(needsLayout()); 126 ASSERT(needsLayout());
120 LayoutAnalyzer::Scope analyzer(*this); 127 LayoutAnalyzer::Scope analyzer(*this);
121 128
122 updateLogicalWidth(); 129 updateLogicalWidth();
123 updateLogicalHeight(); 130 updateLogicalHeight();
124 131
125 m_overflow.reset(); 132 m_overflow.reset();
126 addVisualEffectOverflow(); 133 addVisualEffectOverflow();
127 134
128 updateLayerTransformAfterLayout(); 135 updateLayerTransformAfterLayout();
129 136
130 Widget* widget = this->widget(); 137 Widget* widget = this->widget();
131 if (!widget && frameView()) 138 if (!widget && frameView())
132 frameView()->addPartToUpdate(*this); 139 frameView()->addPartToUpdate(*this);
133 140
134 clearNeedsLayout(); 141 clearNeedsLayout();
135 } 142 }
136 143
137 PaintInvalidationReason LayoutEmbeddedObject::invalidatePaintIfNeeded(
138 const PaintInvalidationState& paintInvalidationState) {
139 PaintInvalidationReason reason =
140 LayoutPart::invalidatePaintIfNeeded(paintInvalidationState);
141
142 Widget* widget = this->widget();
143 if (widget && widget->isPluginView())
144 toPluginView(widget)->invalidatePaintIfNeeded();
145
146 return reason;
147 }
148
149 ScrollResult LayoutEmbeddedObject::scroll(ScrollGranularity granularity, 144 ScrollResult LayoutEmbeddedObject::scroll(ScrollGranularity granularity,
150 const FloatSize&) { 145 const FloatSize&) {
151 return ScrollResult(); 146 return ScrollResult();
152 } 147 }
153 148
154 CompositingReasons LayoutEmbeddedObject::additionalCompositingReasons() const { 149 CompositingReasons LayoutEmbeddedObject::additionalCompositingReasons() const {
155 if (requiresAcceleratedCompositing()) 150 if (requiresAcceleratedCompositing())
156 return CompositingReasonPlugin; 151 return CompositingReasonPlugin;
157 return CompositingReasonNone; 152 return CompositingReasonNone;
158 } 153 }
159 154
160 LayoutReplaced* LayoutEmbeddedObject::embeddedReplacedContent() const { 155 LayoutReplaced* LayoutEmbeddedObject::embeddedReplacedContent() const {
161 if (!node() || !widget() || !widget()->isFrameView()) 156 if (!node() || !widget() || !widget()->isFrameView())
162 return nullptr; 157 return nullptr;
163 return toFrameView(widget())->embeddedReplacedContent(); 158 return toFrameView(widget())->embeddedReplacedContent();
164 } 159 }
165 160
166 } // namespace blink 161 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutEmbeddedObject.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698