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

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: 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 0da976369683a045bc16b71cda8e3578bef87402..45e7b13289ab4a5e38688e37683e9c8fc8debebd 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,6 +244,12 @@ public:
virtual void trace(Visitor*) OVERRIDE;
private:
+ enum Direction {
+ DirectionInherit,
+ DirectionRTL,
+ DirectionLTR
+ };
+
class State FINAL : public CSSFontSelectorClient {
public:
State();
@@ -279,6 +288,7 @@ private:
// Text state.
TextAlign m_textAlign;
TextBaseline m_textBaseline;
+ Direction m_direction;
String m_unparsedFont;
Font m_font;
@@ -355,6 +365,7 @@ private:
virtual bool isTransformInvertible() const OVERRIDE { return state().m_invertibleCTM; }
virtual blink::WebLayer* platformLayer() const OVERRIDE;
+ TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullptr) const;
WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack;
OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager;

Powered by Google App Engine
This is Rietveld 408576698