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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 43d151fa64183945ec214c728c0d8a230ec5a63b..05a111718b7d39b02404da3c695cd4f57ea6f131 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -677,20 +677,22 @@ static inline TextDirection toTextDirection(
*computedStyle = style;
switch (direction) {
case CanvasRenderingContext2DState::DirectionInherit:
- return style ? style->direction() : LTR;
+ return style ? style->direction() : TextDirection::Ltr;
case CanvasRenderingContext2DState::DirectionRTL:
- return RTL;
+ return TextDirection::Rtl;
case CanvasRenderingContext2DState::DirectionLTR:
- return LTR;
+ return TextDirection::Ltr;
}
ASSERT_NOT_REACHED();
- return LTR;
+ return TextDirection::Ltr;
}
String CanvasRenderingContext2D::direction() const {
if (state().getDirection() == CanvasRenderingContext2DState::DirectionInherit)
canvas()->document().updateStyleAndLayoutTreeForNode(canvas());
- return toTextDirection(state().getDirection(), canvas()) == RTL ? rtl : ltr;
+ return toTextDirection(state().getDirection(), canvas()) == TextDirection::Rtl
+ ? rtl
+ : ltr;
}
void CanvasRenderingContext2D::setDirection(const String& directionString) {
@@ -844,7 +846,7 @@ void CanvasRenderingContext2D::drawTextInternal(
const ComputedStyle* computedStyle = 0;
TextDirection direction =
toTextDirection(state().getDirection(), canvas(), &computedStyle);
- bool isRTL = direction == RTL;
+ bool isRTL = direction == TextDirection::Rtl;
bool override =
computedStyle ? isOverride(computedStyle->unicodeBidi()) : false;
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | third_party/WebKit/Source/platform/DragImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698