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

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

Issue 140913011: Trim FontSelector interface a bit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index dfc10e2023b05f4c6669079f30e827359a07c211..40ab5a15c6532b7cf092c045d9c9dca078070a3e 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -152,7 +152,7 @@ CanvasRenderingContext2D::State::State()
}
CanvasRenderingContext2D::State::State(const State& other)
- : FontSelectorClient()
+ : CSSFontSelectorClient()
, m_unparsedStrokeColor(other.m_unparsedStrokeColor)
, m_unparsedFillColor(other.m_unparsedFillColor)
, m_strokeStyle(other.m_strokeStyle)
@@ -178,7 +178,7 @@ CanvasRenderingContext2D::State::State(const State& other)
, m_realizedFont(other.m_realizedFont)
{
if (m_realizedFont)
- m_font.fontSelector()->registerForInvalidationCallbacks(this);
+ static_cast<CSSFontSelector*>(m_font.fontSelector())->registerForInvalidationCallbacks(this);
eae 2014/01/17 23:13:26 I'm not thrilled about all these casts, I assume t
}
CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(const State& other)
@@ -187,7 +187,7 @@ CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(cons
return *this;
if (m_realizedFont)
- m_font.fontSelector()->unregisterForInvalidationCallbacks(this);
+ static_cast<CSSFontSelector*>(m_font.fontSelector())->unregisterForInvalidationCallbacks(this);
m_unparsedStrokeColor = other.m_unparsedStrokeColor;
m_unparsedFillColor = other.m_unparsedFillColor;
@@ -213,7 +213,7 @@ CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(cons
m_realizedFont = other.m_realizedFont;
if (m_realizedFont)
- m_font.fontSelector()->registerForInvalidationCallbacks(this);
+ static_cast<CSSFontSelector*>(m_font.fontSelector())->registerForInvalidationCallbacks(this);
return *this;
}
@@ -221,10 +221,10 @@ CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(cons
CanvasRenderingContext2D::State::~State()
{
if (m_realizedFont)
- m_font.fontSelector()->unregisterForInvalidationCallbacks(this);
+ static_cast<CSSFontSelector*>(m_font.fontSelector())->unregisterForInvalidationCallbacks(this);
}
-void CanvasRenderingContext2D::State::fontsNeedUpdate(FontSelector* fontSelector)
+void CanvasRenderingContext2D::State::fontsNeedUpdate(CSSFontSelector* fontSelector)
{
ASSERT_ARG(fontSelector, fontSelector == m_font.fontSelector());
ASSERT(m_realizedFont);
@@ -2096,7 +2096,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
styleResolver.applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), newStyle.get());
if (state().m_realizedFont)
- state().m_font.fontSelector()->unregisterForInvalidationCallbacks(&modifiableState());
+ static_cast<CSSFontSelector*>(state().m_font.fontSelector())->unregisterForInvalidationCallbacks(&modifiableState());
modifiableState().m_font = newStyle->font();
modifiableState().m_font.update(canvas()->document().styleEngine()->fontSelector());
modifiableState().m_realizedFont = true;
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698