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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 10 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 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 #ifndef TextPainter_h 5 #ifndef TextPainter_h
6 #define TextPainter_h 6 #define TextPainter_h
7 7
8 #include "core/rendering/FloatToLayoutUnit.h" 8 #include "core/rendering/FloatToLayoutUnit.h"
9 #include "core/rendering/style/RenderStyleConstants.h" 9 #include "core/rendering/style/RenderStyleConstants.h"
10 #include "platform/fonts/TextBlob.h" 10 #include "platform/fonts/TextBlob.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 bool operator==(const Style& other) 50 bool operator==(const Style& other)
51 { 51 {
52 return fillColor == other.fillColor 52 return fillColor == other.fillColor
53 && strokeColor == other.strokeColor 53 && strokeColor == other.strokeColor
54 && emphasisMarkColor == other.emphasisMarkColor 54 && emphasisMarkColor == other.emphasisMarkColor
55 && strokeWidth == other.strokeWidth 55 && strokeWidth == other.strokeWidth
56 && shadow == other.shadow; 56 && shadow == other.shadow;
57 } 57 }
58 bool operator!=(const Style& other) { return !(*this == other); } 58 bool operator!=(const Style& other) { return !(*this == other); }
59 }; 59 };
60 static Style textPaintingStyle(RenderObject&, RenderStyle*, bool forceBlackT ext, bool isPrinting); 60 static Style textPaintingStyle(RenderObject&, const RenderStyle*, bool force BlackText, bool isPrinting);
61 static Style selectionPaintingStyle(RenderObject&, bool haveSelection, bool forceBlackText, bool isPrinting, const Style& textStyle); 61 static Style selectionPaintingStyle(RenderObject&, bool haveSelection, bool forceBlackText, bool isPrinting, const Style& textStyle);
62 62
63 enum RotationDirection { Counterclockwise, Clockwise }; 63 enum RotationDirection { Counterclockwise, Clockwise };
64 static AffineTransform rotation(const FloatRectWillBeLayoutRect& boxRect, Ro tationDirection); 64 static AffineTransform rotation(const FloatRectWillBeLayoutRect& boxRect, Ro tationDirection);
65 65
66 private: 66 private:
67 void updateGraphicsContext(const Style& style, GraphicsContextStateSaver& sa ver) 67 void updateGraphicsContext(const Style& style, GraphicsContextStateSaver& sa ver)
68 { 68 {
69 updateGraphicsContext(m_graphicsContext, style, m_horizontal, saver); 69 updateGraphicsContext(m_graphicsContext, style, m_horizontal, saver);
70 } 70 }
(...skipping 21 matching lines...) Expand all
92 92
93 inline AffineTransform TextPainter::rotation(const FloatRectWillBeLayoutRect& bo xRect, RotationDirection rotationDirection) 93 inline AffineTransform TextPainter::rotation(const FloatRectWillBeLayoutRect& bo xRect, RotationDirection rotationDirection)
94 { 94 {
95 return rotationDirection == Clockwise ? AffineTransform(0, 1, -1, 0, boxRect .x() + boxRect.maxY(), boxRect.maxY() - boxRect.x()) 95 return rotationDirection == Clockwise ? AffineTransform(0, 1, -1, 0, boxRect .x() + boxRect.maxY(), boxRect.maxY() - boxRect.x())
96 : AffineTransform(0, -1, 1, 0, boxRect.x() - boxRect.maxY(), boxRect.x() + boxRect.maxY()); 96 : AffineTransform(0, -1, 1, 0, boxRect.x() - boxRect.maxY(), boxRect.x() + boxRect.maxY());
97 } 97 }
98 98
99 } // namespace blink 99 } // namespace blink
100 100
101 #endif // TextPainter_h 101 #endif // TextPainter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698