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

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

Issue 1159113010: Optimized box border side painting order (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: forgot the new test 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
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"
11 #include "platform/heap/Heap.h" 11 #include "platform/heap/Heap.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class ComputedStyle; 15 class ComputedStyle;
16 class IntRect; 16 class IntRect;
17 class LayoutBox; 17 class LayoutBox;
18 class LayoutRect; 18 class LayoutRect;
19 struct PaintInfo; 19 struct PaintInfo;
20 20
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;
31
32 BorderEdgeFlags paintOpacityGroup(GraphicsContext*, const ComplexBorderInfo& , unsigned index,
33 float accumulatedOpacity) const;
34 void paintSide(GraphicsContext*, const ComplexBorderInfo&, BoxSide, unsigned alpha, BorderEdgeFlags) const;
35 void paintOneBorderSide(GraphicsContext*, const FloatRect& sideRect, BoxSide , BoxSide adjacentSide1,
36 BoxSide adjacentSide2, const Path*, bool antialias, Color, BorderEdgeFla gs) const;
30 bool paintBorderFastPath(GraphicsContext*, const LayoutRect& borderRect) con st; 37 bool paintBorderFastPath(GraphicsContext*, const LayoutRect& borderRect) con st;
31 void drawDoubleBorder(GraphicsContext*, const LayoutRect& borderRect) const; 38 void drawDoubleBorder(GraphicsContext*, const LayoutRect& borderRect) const;
32 39
33 void paintTranslucentBorderSides(GraphicsContext*, bool antialias) const;
34 void paintOneBorderSide(GraphicsContext*, const FloatRect& sideRect, BoxSide , BoxSide adjacentSide1,
35 BoxSide adjacentSide2, const Path*, bool antialias, const Color* overrid eColor) const;
36 void paintBorderSides(GraphicsContext*, BorderEdgeFlags edgeSet, bool antial ias,
37 const Color* overrideColor = 0) const;
38 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, f loat thickness, 40 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, f loat thickness,
39 float drawThickness, BoxSide, Color, EBorderStyle) const; 41 float drawThickness, BoxSide, Color, EBorderStyle) const;
40 void clipBorderSidePolygon(GraphicsContext*, BoxSide, bool firstEdgeMatches, 42 void clipBorderSidePolygon(GraphicsContext*, BoxSide, bool firstEdgeMatches,
41 bool secondEdgeMatches) const; 43 bool secondEdgeMatches) const;
42 void clipBorderSideForComplexInnerPath(GraphicsContext*, BoxSide) const; 44 void clipBorderSideForComplexInnerPath(GraphicsContext*, BoxSide) const;
43 45
44 const BorderEdge& firstEdge() const 46 const BorderEdge& firstEdge() const
45 { 47 {
46 ASSERT(m_visibleEdgeSet); 48 ASSERT(m_visibleEdgeSet);
47 return m_edges[m_firstVisibleEdge]; 49 return m_edges[m_firstVisibleEdge];
(...skipping 10 matching lines...) Expand all
58 FloatRoundedRect m_inner; 60 FloatRoundedRect m_inner;
59 BorderEdge m_edges[4]; 61 BorderEdge m_edges[4];
60 62
61 unsigned m_visibleEdgeCount; 63 unsigned m_visibleEdgeCount;
62 unsigned m_firstVisibleEdge; 64 unsigned m_firstVisibleEdge;
63 BorderEdgeFlags m_visibleEdgeSet; 65 BorderEdgeFlags m_visibleEdgeSet;
64 66
65 bool m_isUniformStyle; 67 bool m_isUniformStyle;
66 bool m_isUniformWidth; 68 bool m_isUniformWidth;
67 bool m_isUniformColor; 69 bool m_isUniformColor;
70 bool m_isRounded;
68 bool m_hasAlpha; 71 bool m_hasAlpha;
69 }; 72 };
70 73
71 } // namespace blink 74 } // namespace blink
72 75
73 #endif 76 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/borders/border-mixed-alpha2-expected.txt ('k') | Source/core/paint/BoxBorderPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698