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

Side by Side Diff: sky/engine/core/rendering/shapes/Shape.h

Issue 683803006: Remove all writing mode function arguments and remove writing mode from RenderStyle. (Closed) Base URL: git@github.com:domokit/mojo.git@writingmode
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/core/rendering/RenderGrid.cpp ('k') | sky/engine/core/rendering/shapes/Shape.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 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // that will fit within or around a shape. The line is defined by a pair of logi cal Y coordinates and the 65 // that will fit within or around a shape. The line is defined by a pair of logi cal Y coordinates and the
66 // computed segments are returned as pairs of logical X coordinates. The BasicSh ape itself is defined in 66 // computed segments are returned as pairs of logical X coordinates. The BasicSh ape itself is defined in
67 // physical coordinates. 67 // physical coordinates.
68 68
69 class Shape { 69 class Shape {
70 public: 70 public:
71 struct DisplayPaths { 71 struct DisplayPaths {
72 Path shape; 72 Path shape;
73 Path marginShape; 73 Path marginShape;
74 }; 74 };
75 static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& lo gicalBoxSize, WritingMode, float margin); 75 static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& lo gicalBoxSize, float margin);
76 static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const La youtRect& imageRect, const LayoutRect& marginRect, WritingMode, float margin); 76 static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const La youtRect& imageRect, const LayoutRect& marginRect, float margin);
77 static PassOwnPtr<Shape> createEmptyRasterShape(WritingMode, float margin); 77 static PassOwnPtr<Shape> createEmptyRasterShape(float margin);
78 static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMod e, float margin); 78 static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, float marg in);
79 79
80 virtual ~Shape() { } 80 virtual ~Shape() { }
81 81
82 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0; 82 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0;
83 virtual bool isEmpty() const = 0; 83 virtual bool isEmpty() const = 0;
84 virtual LineSegment getExcludedInterval(LayoutUnit logicalTop, LayoutUnit lo gicalHeight) const = 0; 84 virtual LineSegment getExcludedInterval(LayoutUnit logicalTop, LayoutUnit lo gicalHeight) const = 0;
85 85
86 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight ) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical BoundingBox()); } 86 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight ) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical BoundingBox()); }
87 virtual void buildDisplayPaths(DisplayPaths&) const = 0; 87 virtual void buildDisplayPaths(DisplayPaths&) const = 0;
88 88
89 protected: 89 protected:
90 float shapeMargin() const { return m_margin; } 90 float shapeMargin() const { return m_margin; }
91 91
92 private: 92 private:
93 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons t LayoutRect& rect) const 93 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons t LayoutRect& rect) const
94 { 94 {
95 if (rect.isEmpty()) 95 if (rect.isEmpty())
96 return false; 96 return false;
97 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l ineHeight && lineTop == rect.y()); 97 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l ineHeight && lineTop == rect.y());
98 } 98 }
99 99
100 WritingMode m_writingMode;
101 float m_margin; 100 float m_margin;
102 }; 101 };
103 102
104 } // namespace blink 103 } // namespace blink
105 104
106 #endif // Shape_h 105 #endif // Shape_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderGrid.cpp ('k') | sky/engine/core/rendering/shapes/Shape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698