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

Side by Side Diff: Source/core/css/CSSFontFace.h

Issue 23446007: Use unicode-range to prevent unnecessary @font-face donwnloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 19 matching lines...) Expand all
30 #include "core/css/CSSFontFaceSource.h" 30 #include "core/css/CSSFontFaceSource.h"
31 #include "wtf/Forward.h" 31 #include "wtf/Forward.h"
32 #include "wtf/PassRefPtr.h" 32 #include "wtf/PassRefPtr.h"
33 #include "wtf/RefCounted.h" 33 #include "wtf/RefCounted.h"
34 #include "wtf/Vector.h" 34 #include "wtf/Vector.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 class CSSSegmentedFontFace; 38 class CSSSegmentedFontFace;
39 class FontDescription; 39 class FontDescription;
40 class FontResource;
40 class SimpleFontData; 41 class SimpleFontData;
41 42
42 class CSSFontFace : public RefCounted<CSSFontFace> { 43 class CSSFontFace : public RefCounted<CSSFontFace> {
43 public: 44 public:
44 static PassRefPtr<CSSFontFace> create(PassRefPtr<CSSFontFaceRule> rule, bool isLocalFallback = false) { return adoptRef(new CSSFontFace(rule, isLocalFallbac k)); } 45 static PassRefPtr<CSSFontFace> create(PassRefPtr<CSSFontFaceRule> rule, bool isLocalFallback = false) { return adoptRef(new CSSFontFace(rule, isLocalFallbac k)); }
45 46
46 struct UnicodeRange; 47 struct UnicodeRange;
47 48
48 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); } 49 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); }
49 const Vector<UnicodeRange>& ranges() const { return m_ranges; } 50 const Vector<UnicodeRange>& ranges() const { return m_ranges; }
50 51
51 void setSegmentedFontFace(CSSSegmentedFontFace*); 52 void setSegmentedFontFace(CSSSegmentedFontFace*);
52 void clearSegmentedFontFace() { m_segmentedFontFace = 0; } 53 void clearSegmentedFontFace() { m_segmentedFontFace = 0; }
53 54
54 bool isLoaded() const; 55 bool isLoaded() const;
55 bool isValid() const; 56 bool isValid() const;
56 57
57 void addSource(PassOwnPtr<CSSFontFaceSource>); 58 void addSource(PassOwnPtr<CSSFontFaceSource>);
58 59
60 void beginLoadingFontSoon(FontResource*);
59 void fontLoaded(CSSFontFaceSource*); 61 void fontLoaded(CSSFontFaceSource*);
60 62
61 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti cBold, bool syntheticItalic); 63 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti cBold, bool syntheticItalic);
62 64
63 struct UnicodeRange { 65 struct UnicodeRange {
64 UnicodeRange(UChar32 from, UChar32 to) 66 UnicodeRange(UChar32 from, UChar32 to)
65 : m_from(from) 67 : m_from(from)
66 , m_to(to) 68 , m_to(to)
67 { 69 {
68 } 70 }
(...skipping 29 matching lines...) Expand all
98 CSSSegmentedFontFace* m_segmentedFontFace; 100 CSSSegmentedFontFace* m_segmentedFontFace;
99 Vector<OwnPtr<CSSFontFaceSource> > m_sources; 101 Vector<OwnPtr<CSSFontFaceSource> > m_sources;
100 CSSFontFaceSource* m_activeSource; 102 CSSFontFaceSource* m_activeSource;
101 LoadState m_loadState; 103 LoadState m_loadState;
102 RefPtr<CSSFontFaceRule> m_rule; 104 RefPtr<CSSFontFaceRule> m_rule;
103 }; 105 };
104 106
105 } 107 }
106 108
107 #endif 109 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698