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

Side by Side Diff: Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.h

Issue 24874002: Have all skia platforms share FontPlatformData::hash() implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. 2 * Copyright (C) 2006, 2007 Apple Computer, Inc.
3 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved. 3 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void setupPaint(SkPaint*, GraphicsContext* = 0) const; 80 void setupPaint(SkPaint*, GraphicsContext* = 0) const;
81 81
82 FontPlatformData& operator=(const FontPlatformData&); 82 FontPlatformData& operator=(const FontPlatformData&);
83 83
84 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } 84 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
85 85
86 ~FontPlatformData(); 86 ~FontPlatformData();
87 87
88 bool isFixedPitch() const; 88 bool isFixedPitch() const;
89 HFONT hfont() const { return m_font ? m_font->hfont() : 0; } 89 HFONT hfont() const { return m_font ? m_font->hfont() : 0; }
90 float size() const { return m_size; } 90 float size() const { return m_textSize; }
91 SkTypeface* typeface() const { return m_typeface.get(); } 91 SkTypeface* typeface() const { return m_typeface.get(); }
92 int paintTextFlags() const { return m_paintTextFlags; } 92 int paintTextFlags() const { return m_paintTextFlags; }
93 93
94 String fontFamilyName() const; 94 String fontFamilyName() const;
95 95
96 FontOrientation orientation() const { return m_orientation; } 96 FontOrientation orientation() const { return m_orientation; }
97 void setOrientation(FontOrientation orientation) { m_orientation = orientati on; } 97 void setOrientation(FontOrientation orientation) { m_orientation = orientati on; }
98 98
99 #if ENABLE(GDI_FONTS_ON_WINDOWS)
99 unsigned hash() const 100 unsigned hash() const
100 { 101 {
101 return m_font ? m_font->hash() : NULL; 102 return m_font ? m_font->hash() : NULL;
102 } 103 }
104 #else
105 unsigned hash() const;
106 #endif
103 107
104 bool operator==(const FontPlatformData& other) const 108 bool operator==(const FontPlatformData& other) const
105 { 109 {
106 return m_font == other.m_font && m_size == other.m_size && m_fakeBold == other.m_fakeBold && m_fakeItalic == other.m_fakeItalic && m_orientation == othe r.m_orientation; 110 return m_font == other.m_font && m_textSize == other.m_textSize && m_fak eBold == other.m_fakeBold && m_fakeItalic == other.m_fakeItalic && m_orientation == other.m_orientation;
107 } 111 }
108 112
109 #if ENABLE(OPENTYPE_VERTICAL) 113 #if ENABLE(OPENTYPE_VERTICAL)
110 PassRefPtr<OpenTypeVerticalData> verticalData() const; 114 PassRefPtr<OpenTypeVerticalData> verticalData() const;
111 PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const; 115 PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
112 #endif 116 #endif
113 117
114 #ifndef NDEBUG 118 #ifndef NDEBUG
115 String description() const; 119 String description() const;
116 #endif 120 #endif
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // The create() function assumes there is already a refcount of one 152 // The create() function assumes there is already a refcount of one
149 // so it can do adoptRef. 153 // so it can do adoptRef.
150 RefCountedHFONT(HFONT hfont) : m_hfont(hfont) 154 RefCountedHFONT(HFONT hfont) : m_hfont(hfont)
151 { 155 {
152 } 156 }
153 157
154 HFONT m_hfont; 158 HFONT m_hfont;
155 }; 159 };
156 160
157 RefPtr<RefCountedHFONT> m_font; 161 RefPtr<RefCountedHFONT> m_font;
158 float m_size; // Point size of the font in pixels. 162 float m_textSize; // Point size of the font in pixels.
159 FontOrientation m_orientation; 163 FontOrientation m_orientation;
160 bool m_fakeBold; 164 bool m_fakeBold;
161 bool m_fakeItalic; 165 bool m_fakeItalic;
162 166
163 RefPtr<SkTypeface> m_typeface; // cached from m_font 167 RefPtr<SkTypeface> m_typeface; // cached from m_font
164 int m_paintTextFlags; // cached from m_font 168 int m_paintTextFlags; // cached from m_font
165 169
166 mutable SCRIPT_CACHE m_scriptCache; 170 mutable SCRIPT_CACHE m_scriptCache;
167 mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties; 171 mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties;
168 172
169 bool m_isHashTableDeletedValue; 173 bool m_isHashTableDeletedValue;
170 }; 174 };
171 175
172 } // WebCore 176 } // WebCore
173 177
174 #endif // FontPlatformDataChromiumWin_h 178 #endif // FontPlatformDataChromiumWin_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698