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

Side by Side Diff: third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp

Issue 2465983002: Rename "paint invalidation rect" etc. to "visual rect". (Closed)
Patch Set: - 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/SVGContainerPainter.h" 5 #include "core/paint/SVGContainerPainter.h"
6 6
7 #include "core/layout/svg/LayoutSVGContainer.h" 7 #include "core/layout/svg/LayoutSVGContainer.h"
8 #include "core/layout/svg/LayoutSVGViewportContainer.h" 8 #include "core/layout/svg/LayoutSVGViewportContainer.h"
9 #include "core/layout/svg/SVGLayoutSupport.h" 9 #include "core/layout/svg/SVGLayoutSupport.h"
10 #include "core/paint/FloatClipRecorder.h" 10 #include "core/paint/FloatClipRecorder.h"
11 #include "core/paint/ObjectPainter.h" 11 #include "core/paint/ObjectPainter.h"
12 #include "core/paint/PaintInfo.h" 12 #include "core/paint/PaintInfo.h"
13 #include "core/paint/SVGPaintContext.h" 13 #include "core/paint/SVGPaintContext.h"
14 #include "core/svg/SVGSVGElement.h" 14 #include "core/svg/SVGSVGElement.h"
15 #include "wtf/Optional.h" 15 #include "wtf/Optional.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 void SVGContainerPainter::paint(const PaintInfo& paintInfo) { 19 void SVGContainerPainter::paint(const PaintInfo& paintInfo) {
20 // Spec: groups w/o children still may render filter content. 20 // Spec: groups w/o children still may render filter content.
21 if (!m_layoutSVGContainer.firstChild() && 21 if (!m_layoutSVGContainer.firstChild() &&
22 !m_layoutSVGContainer.selfWillPaint()) 22 !m_layoutSVGContainer.selfWillPaint())
23 return; 23 return;
24 24
25 FloatRect boundingBox = 25 FloatRect boundingBox =
26 m_layoutSVGContainer.paintInvalidationRectInLocalSVGCoordinates(); 26 m_layoutSVGContainer.visualRectInLocalSVGCoordinates();
27 // LayoutSVGHiddenContainer's paint invalidation rect is always empty but we 27 // LayoutSVGHiddenContainer's visual rect is always empty but we need to
28 // need to paint its descendants. 28 // paint its descendants.
29 if (!m_layoutSVGContainer.isSVGHiddenContainer() && 29 if (!m_layoutSVGContainer.isSVGHiddenContainer() &&
30 !paintInfo.cullRect().intersectsCullRect( 30 !paintInfo.cullRect().intersectsCullRect(
31 m_layoutSVGContainer.localToSVGParentTransform(), boundingBox)) 31 m_layoutSVGContainer.localToSVGParentTransform(), boundingBox))
32 return; 32 return;
33 33
34 // Spec: An empty viewBox on the <svg> element disables rendering. 34 // Spec: An empty viewBox on the <svg> element disables rendering.
35 ASSERT(m_layoutSVGContainer.element()); 35 ASSERT(m_layoutSVGContainer.element());
36 if (isSVGSVGElement(*m_layoutSVGContainer.element()) && 36 if (isSVGSVGElement(*m_layoutSVGContainer.element()) &&
37 toSVGSVGElement(*m_layoutSVGContainer.element()).hasEmptyViewBox()) 37 toSVGSVGElement(*m_layoutSVGContainer.element()).hasEmptyViewBox())
38 return; 38 return;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ObjectPainter(m_layoutSVGContainer) 78 ObjectPainter(m_layoutSVGContainer)
79 .paintOutline(outlinePaintInfo, LayoutPoint(boundingBox.location())); 79 .paintOutline(outlinePaintInfo, LayoutPoint(boundingBox.location()));
80 } 80 }
81 81
82 if (paintInfoBeforeFiltering.isPrinting()) 82 if (paintInfoBeforeFiltering.isPrinting())
83 ObjectPainter(m_layoutSVGContainer) 83 ObjectPainter(m_layoutSVGContainer)
84 .addPDFURLRectIfNeeded(paintInfoBeforeFiltering, LayoutPoint()); 84 .addPDFURLRectIfNeeded(paintInfoBeforeFiltering, LayoutPoint());
85 } 85 }
86 86
87 } // namespace blink 87 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGClipPainter.cpp ('k') | third_party/WebKit/Source/core/paint/SVGImagePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698