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

Side by Side Diff: Source/platform/fonts/CustomFontData.h

Issue 676373003: Cleanup CustomFontData after SVG Fonts removal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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) 2013 Google, Inc. 2 * Copyright (C) 2013 Google, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 * 18 *
19 */ 19 */
20 20
21 #ifndef CustomFontData_h 21 #ifndef CustomFontData_h
22 #define CustomFontData_h 22 #define CustomFontData_h
23 23
24 #include "platform/PlatformExport.h" 24 #include "platform/PlatformExport.h"
25 #include "platform/fonts/Glyph.h"
26 #include "wtf/PassRefPtr.h" 25 #include "wtf/PassRefPtr.h"
27 #include "wtf/RefCounted.h" 26 #include "wtf/RefCounted.h"
28 #include <unicode/uchar.h>
29 27
30 namespace blink { 28 namespace blink {
31 29
32 struct GlyphData;
33 class GlyphPage;
34 class SimpleFontData; 30 class SimpleFontData;
35 struct SimpleShaper;
36 31
37 class PLATFORM_EXPORT CustomFontData : public RefCounted<CustomFontData> { 32 class PLATFORM_EXPORT CustomFontData : public RefCounted<CustomFontData> {
38 public: 33 public:
39 static PassRefPtr<CustomFontData> create() { return adoptRef(new CustomFontD ata()); } 34 static PassRefPtr<CustomFontData> create() { return adoptRef(new CustomFontD ata()); }
40 35
41 virtual ~CustomFontData() { } 36 virtual ~CustomFontData() { }
42 37
43 virtual void beginLoadIfNeeded() const { }; 38 virtual void beginLoadIfNeeded() const { };
f(malita) 2014/10/27 14:59:25 nit: since we're touching this header, let's zap t
44 virtual bool isLoading() const { return false; } 39 virtual bool isLoading() const { return false; }
45 virtual bool isLoadingFallback() const { return false; } 40 virtual bool isLoadingFallback() const { return false; }
46 virtual bool shouldSkipDrawing() const { return false; } 41 virtual bool shouldSkipDrawing() const { return false; }
47 virtual void clearFontFaceSource() { } 42 virtual void clearFontFaceSource() { }
48 43
49 virtual void initializeFontData(SimpleFontData*, float) { } 44 virtual void initializeFontData(SimpleFontData*, float) { }
50 virtual float widthForSVGGlyph(Glyph, float) const { return 0.0f; }
51 virtual bool fillSVGGlyphPage(GlyphPage*, unsigned, unsigned, UChar*, unsign ed, const SimpleFontData*) const { return false; }
52 virtual bool applySVGGlyphSelection(SimpleShaper&, GlyphData&, bool, int, un signed&) const { return false; }
53 45
54 protected: 46 protected:
55 CustomFontData() { } 47 CustomFontData() { }
56 }; 48 };
57 49
58 #define DEFINE_CUSTOM_FONT_DATA_TYPE_CASTS(thisType, predicate) \
59 template<typename T> inline thisType* to##thisType(const RefPtr<T>& customFo ntData) { return to##thisType(customFontData.get()); } \
60 DEFINE_TYPE_CASTS(thisType, CustomFontData, customFontData, customFontData-> predicate, customFontData.predicate)
61
62 } // namespace blink 50 } // namespace blink
63 51
64 #endif // CustomFontData_h 52 #endif // CustomFontData_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698