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

Unified Diff: Source/core/css/resolver/FontBuilder.h

Issue 714163002: Remove RenderStyle member from FontBuilder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ensure font is created before taking animation snapshot. Created 6 years, 1 month 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/css/resolver/FontBuilder.h
diff --git a/Source/core/css/resolver/FontBuilder.h b/Source/core/css/resolver/FontBuilder.h
index 964c3ddae2d89393e849aadbcfbeb8ce226543dd..09efe4066af8dd8a1ddcf97f8397c8d20e5be44d 100644
--- a/Source/core/css/resolver/FontBuilder.h
+++ b/Source/core/css/resolver/FontBuilder.h
@@ -43,7 +43,9 @@ class FontBuilder {
public:
FontBuilder(const Document&);
- void setStyle(RenderStyle* style) { m_style = style; }
+ void setFontDescription(const FontDescription& fd) { m_fontDescription = fd; }
+ const FontDescription& fontDescription() const { return m_fontDescription; }
+
void setInitial(float effectiveZoom);
void didChangeFontParameters(bool);
@@ -68,7 +70,7 @@ public:
void setFontSmoothing(FontSmoothingMode);
// FIXME: These need to just vend a Font object eventually.
- void createFont(PassRefPtrWillBeRawPtr<FontSelector>, const RenderStyle* parentStyle, RenderStyle*);
+ void createFont(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle*, const RenderStyle* parentStyle);
void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle*);
@@ -105,12 +107,7 @@ private:
float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom, float specifiedSize);
const Document& m_document;
- // FIXME: This member is here on a short-term lease. The plan is to remove
- // any notion of RenderStyle from here, allowing FontBuilder to build Font objects
- // directly, rather than as a byproduct of calling RenderStyle::setFontDescription.
- // FontDescriptionChangeScope should be the only consumer of this member.
- // If you're using it, U R DOIN IT WRONG.
- RenderStyle* m_style;
+ FontDescription m_fontDescription;
// Fontbuilder is responsbile for creating the Font()
// object on RenderStyle from various other font-related
@@ -118,8 +115,6 @@ private:
// is changed, FontBuilder tracks the need to update
// style->font() with this bool.
bool m_fontDirty;
-
- friend class FontBuilderTest;
};
}

Powered by Google App Engine
This is Rietveld 408576698