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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.h

Issue 468483003: Implement canvas2d direction attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Supporting the case of save/restore Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/CanvasRenderingContext2D.h
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h
index 6eba5f5b313772a10a5e9c24f1d7f6c3be305281..7dae8870e730a27d21b8275801311b2b842afdb8 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.h
@@ -211,6 +211,9 @@ public:
String textBaseline() const;
void setTextBaseline(const String&);
+ String direction() const;
+ void setDirection(const String&);
+
void fillText(const String& text, float x, float y);
void fillText(const String& text, float x, float y, float maxWidth);
void strokeText(const String& text, float x, float y);
@@ -241,9 +244,15 @@ public:
virtual void trace(Visitor*) OVERRIDE;
private:
+ enum Direction {
+ DirectionInherit = -1,
+ DirectionRTL,
+ DirectionLTR
+ };
+
class State FINAL : public CSSFontSelectorClient {
public:
- State();
+ explicit State(Direction = DirectionInherit);
virtual ~State();
State(const State&);
@@ -279,6 +288,7 @@ private:
// Text state.
TextAlign m_textAlign;
TextBaseline m_textBaseline;
+ Direction m_direction;
String m_unparsedFont;
Font m_font;

Powered by Google App Engine
This is Rietveld 408576698