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

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

Issue 1774943003: blink: Rename platform/ methods to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-platform: rebase-yayyyyyyyy Created 4 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/RoundedInnerRectClipper.h" 5 #include "core/paint/RoundedInnerRectClipper.h"
6 6
7 #include "core/layout/LayoutBox.h" 7 #include "core/layout/LayoutBox.h"
8 #include "core/paint/PaintInfo.h" 8 #include "core/paint/PaintInfo.h"
9 #include "platform/graphics/paint/ClipDisplayItem.h" 9 #include "platform/graphics/paint/ClipDisplayItem.h"
10 #include "platform/graphics/paint/PaintController.h" 10 #include "platform/graphics/paint/PaintController.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 RoundedInnerRectClipper::RoundedInnerRectClipper(const LayoutObject& layoutObjec t, const PaintInfo& paintInfo, const LayoutRect& rect, const FloatRoundedRect& c lipRect, RoundedInnerRectClipperBehavior behavior) 14 RoundedInnerRectClipper::RoundedInnerRectClipper(const LayoutObject& layoutObjec t, const PaintInfo& paintInfo, const LayoutRect& rect, const FloatRoundedRect& c lipRect, RoundedInnerRectClipperBehavior behavior)
15 : m_layoutObject(layoutObject) 15 : m_layoutObject(layoutObject)
16 , m_paintInfo(paintInfo) 16 , m_paintInfo(paintInfo)
17 , m_usePaintController(behavior == ApplyToDisplayList) 17 , m_usePaintController(behavior == ApplyToDisplayList)
18 , m_clipType(m_usePaintController ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst) 18 , m_clipType(m_usePaintController ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst)
19 { 19 {
20 Vector<FloatRoundedRect> roundedRectClips; 20 Vector<FloatRoundedRect> roundedRectClips;
21 if (clipRect.isRenderable()) { 21 if (clipRect.isRenderable()) {
22 roundedRectClips.append(clipRect); 22 roundedRectClips.append(clipRect);
23 } else { 23 } else {
24 // We create a rounded rect for each of the corners and clip it, while m aking sure we clip opposing corners together. 24 // We create a rounded rect for each of the corners and clip it, while m aking sure we clip opposing corners together.
25 if (!clipRect.radii().topLeft().isEmpty() || !clipRect.radii().bottomRig ht().isEmpty()) { 25 if (!clipRect.getRadii().topLeft().isEmpty() || !clipRect.getRadii().bot tomRight().isEmpty()) {
26 FloatRect topCorner(clipRect.rect().x(), clipRect.rect().y(), rect.m axX() - clipRect.rect().x(), rect.maxY() - clipRect.rect().y()); 26 FloatRect topCorner(clipRect.rect().x(), clipRect.rect().y(), rect.m axX() - clipRect.rect().x(), rect.maxY() - clipRect.rect().y());
27 FloatRoundedRect::Radii topCornerRadii; 27 FloatRoundedRect::Radii topCornerRadii;
28 topCornerRadii.setTopLeft(clipRect.radii().topLeft()); 28 topCornerRadii.setTopLeft(clipRect.getRadii().topLeft());
29 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii)) ; 29 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii)) ;
30 30
31 FloatRect bottomCorner(rect.x().toFloat(), rect.y().toFloat(), clipR ect.rect().maxX() - rect.x().toFloat(), clipRect.rect().maxY() - rect.y().toFloa t()); 31 FloatRect bottomCorner(rect.x().toFloat(), rect.y().toFloat(), clipR ect.rect().maxX() - rect.x().toFloat(), clipRect.rect().maxY() - rect.y().toFloa t());
32 FloatRoundedRect::Radii bottomCornerRadii; 32 FloatRoundedRect::Radii bottomCornerRadii;
33 bottomCornerRadii.setBottomRight(clipRect.radii().bottomRight()); 33 bottomCornerRadii.setBottomRight(clipRect.getRadii().bottomRight());
34 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR adii)); 34 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR adii));
35 } 35 }
36 36
37 if (!clipRect.radii().topRight().isEmpty() || !clipRect.radii().bottomLe ft().isEmpty()) { 37 if (!clipRect.getRadii().topRight().isEmpty() || !clipRect.getRadii().bo ttomLeft().isEmpty()) {
38 FloatRect topCorner(rect.x().toFloat(), clipRect.rect().y(), clipRec t.rect().maxX() - rect.x().toFloat(), rect.maxY() - clipRect.rect().y()); 38 FloatRect topCorner(rect.x().toFloat(), clipRect.rect().y(), clipRec t.rect().maxX() - rect.x().toFloat(), rect.maxY() - clipRect.rect().y());
39 FloatRoundedRect::Radii topCornerRadii; 39 FloatRoundedRect::Radii topCornerRadii;
40 topCornerRadii.setTopRight(clipRect.radii().topRight()); 40 topCornerRadii.setTopRight(clipRect.getRadii().topRight());
41 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii)) ; 41 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii)) ;
42 42
43 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect .maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat()); 43 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect .maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat());
44 FloatRoundedRect::Radii bottomCornerRadii; 44 FloatRoundedRect::Radii bottomCornerRadii;
45 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); 45 bottomCornerRadii.setBottomLeft(clipRect.getRadii().bottomLeft());
46 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR adii)); 46 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR adii));
47 } 47 }
48 } 48 }
49 49
50 if (m_usePaintController) { 50 if (m_usePaintController) {
51 m_paintInfo.context.paintController().createAndAppend<ClipDisplayItem>(l ayoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips); 51 m_paintInfo.context.getPaintController().createAndAppend<ClipDisplayItem >(layoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips);
52 } else { 52 } else {
53 ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::in finiteIntRect(), roundedRectClips); 53 ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::in finiteIntRect(), roundedRectClips);
54 clipDisplayItem.replay(paintInfo.context); 54 clipDisplayItem.replay(paintInfo.context);
55 } 55 }
56 } 56 }
57 57
58 RoundedInnerRectClipper::~RoundedInnerRectClipper() 58 RoundedInnerRectClipper::~RoundedInnerRectClipper()
59 { 59 {
60 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType); 60 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
61 if (m_usePaintController) { 61 if (m_usePaintController) {
62 m_paintInfo.context.paintController().endItem<EndClipDisplayItem>(m_layo utObject, endType); 62 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>(m_l ayoutObject, endType);
63 } else { 63 } else {
64 EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType); 64 EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
65 endClipDisplayItem.replay(m_paintInfo.context); 65 endClipDisplayItem.replay(m_paintInfo.context);
66 } 66 }
67 } 67 }
68 68
69 } // namespace blink 69 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PartPainter.cpp ('k') | third_party/WebKit/Source/core/paint/SVGClipPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698