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

Side by Side Diff: Source/core/paint/BoxBorderPainter.h

Issue 1171583003: Rework BoxBorderPainter's mitre clipping logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: expectations Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/paint/BoxBorderPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef BoxBorderPainter_h 5 #ifndef BoxBorderPainter_h
6 #define BoxBorderPainter_h 6 #define BoxBorderPainter_h
7 7
8 #include "core/layout/LayoutBoxModelObject.h" 8 #include "core/layout/LayoutBoxModelObject.h"
9 #include "core/style/BorderEdge.h" 9 #include "core/style/BorderEdge.h"
10 #include "platform/geometry/FloatRoundedRect.h" 10 #include "platform/geometry/FloatRoundedRect.h"
(...skipping 10 matching lines...) Expand all
21 class BoxBorderPainter { 21 class BoxBorderPainter {
22 STACK_ALLOCATED(); 22 STACK_ALLOCATED();
23 public: 23 public:
24 BoxBorderPainter(const LayoutRect& borderRect, const ComputedStyle&, const I ntRect& clipRect, 24 BoxBorderPainter(const LayoutRect& borderRect, const ComputedStyle&, const I ntRect& clipRect,
25 BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogic alRightEdge); 25 BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogic alRightEdge);
26 26
27 void paintBorder(const PaintInfo&, const LayoutRect& borderRect) const; 27 void paintBorder(const PaintInfo&, const LayoutRect& borderRect) const;
28 28
29 private: 29 private:
30 struct ComplexBorderInfo; 30 struct ComplexBorderInfo;
31 enum MitreType {
fs 2015/06/08 21:06:31 Maybe MiterType (etc.) so them Americans understan
32 NoMitre,
33 SoftMitre, // Anti-aliased
34 HardMitre, // Not anti-aliased
35 };
31 36
32 BorderEdgeFlags paintOpacityGroup(GraphicsContext*, const ComplexBorderInfo& , unsigned index, 37 BorderEdgeFlags paintOpacityGroup(GraphicsContext*, const ComplexBorderInfo& , unsigned index,
33 float accumulatedOpacity) const; 38 float accumulatedOpacity) const;
34 void paintSide(GraphicsContext*, const ComplexBorderInfo&, BoxSide, unsigned alpha, BorderEdgeFlags) const; 39 void paintSide(GraphicsContext*, const ComplexBorderInfo&, BoxSide, unsigned alpha, BorderEdgeFlags) const;
35 void paintOneBorderSide(GraphicsContext*, const FloatRect& sideRect, BoxSide , BoxSide adjacentSide1, 40 void paintOneBorderSide(GraphicsContext*, const FloatRect& sideRect, BoxSide , BoxSide adjacentSide1,
36 BoxSide adjacentSide2, const Path*, bool antialias, Color, BorderEdgeFla gs) const; 41 BoxSide adjacentSide2, const Path*, bool antialias, Color, BorderEdgeFla gs) const;
37 bool paintBorderFastPath(GraphicsContext*, const LayoutRect& borderRect) con st; 42 bool paintBorderFastPath(GraphicsContext*, const LayoutRect& borderRect) con st;
38 void drawDoubleBorder(GraphicsContext*, const LayoutRect& borderRect) const; 43 void drawDoubleBorder(GraphicsContext*, const LayoutRect& borderRect) const;
39 44
40 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, f loat thickness, 45 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, f loat thickness,
41 float drawThickness, BoxSide, Color, EBorderStyle) const; 46 float drawThickness, BoxSide, Color, EBorderStyle) const;
42 void clipBorderSidePolygon(GraphicsContext*, BoxSide, bool firstEdgeMatches, 47 void clipBorderSidePolygon(GraphicsContext*, BoxSide, MitreType mitre1, Mitr eType mitre2) const;
43 bool secondEdgeMatches) const;
44 void clipBorderSideForComplexInnerPath(GraphicsContext*, BoxSide) const; 48 void clipBorderSideForComplexInnerPath(GraphicsContext*, BoxSide) const;
45 49
50 MitreType computeMitre(BoxSide, BoxSide adjacentSide, BorderEdgeFlags, bool antialias) const;
51 static bool mitresRequireClipping(MitreType mitre1, MitreType mitre2, EBorde rStyle, bool antialias);
52
46 const BorderEdge& firstEdge() const 53 const BorderEdge& firstEdge() const
47 { 54 {
48 ASSERT(m_visibleEdgeSet); 55 ASSERT(m_visibleEdgeSet);
49 return m_edges[m_firstVisibleEdge]; 56 return m_edges[m_firstVisibleEdge];
50 } 57 }
51 58
52 // const inputs 59 // const inputs
53 const ComputedStyle& m_style; 60 const ComputedStyle& m_style;
54 const BackgroundBleedAvoidance m_bleedAvoidance; 61 const BackgroundBleedAvoidance m_bleedAvoidance;
55 const bool m_includeLogicalLeftEdge; 62 const bool m_includeLogicalLeftEdge;
(...skipping 11 matching lines...) Expand all
67 bool m_isUniformStyle; 74 bool m_isUniformStyle;
68 bool m_isUniformWidth; 75 bool m_isUniformWidth;
69 bool m_isUniformColor; 76 bool m_isUniformColor;
70 bool m_isRounded; 77 bool m_isRounded;
71 bool m_hasAlpha; 78 bool m_hasAlpha;
72 }; 79 };
73 80
74 } // namespace blink 81 } // namespace blink
75 82
76 #endif 83 #endif
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/paint/BoxBorderPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698