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

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

Issue 180273020: UMA histograms to measure whether / how long blank text is rendered for loading web fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: early return Created 6 years, 9 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/css/CSSFontFace.h » ('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) 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
(...skipping 17 matching lines...) Expand all
28 28
29 class CSSCustomFontData FINAL : public CustomFontData { 29 class CSSCustomFontData FINAL : public CustomFontData {
30 public: 30 public:
31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false, FallbackVisibility visibility = VisibleFallback) 31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false, FallbackVisibility visibility = VisibleFallback)
32 { 32 {
33 return adoptRef(new CSSCustomFontData(isLoadingFallback, visibility)); 33 return adoptRef(new CSSCustomFontData(isLoadingFallback, visibility));
34 } 34 }
35 35
36 virtual ~CSSCustomFontData() { } 36 virtual ~CSSCustomFontData() { }
37 37
38 virtual bool shouldSkipDrawing() const OVERRIDE
39 {
40 if (m_fontFaceSource)
41 m_fontFaceSource->paintRequested();
42 return m_fallbackVisibility == InvisibleFallback && m_isUsed;
43 }
44
38 virtual void beginLoadIfNeeded() const OVERRIDE 45 virtual void beginLoadIfNeeded() const OVERRIDE
39 { 46 {
40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { 47 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) {
41 m_isUsed = true; 48 m_isUsed = true;
42 m_fontFaceSource->beginLoadIfNeeded(); 49 m_fontFaceSource->beginLoadIfNeeded();
43 } 50 }
44 } 51 }
45 52
46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; } 53 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; }
47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } 54 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; }
48 55
49 private: 56 private:
50 CSSCustomFontData(bool isLoadingFallback, FallbackVisibility visibility) 57 CSSCustomFontData(bool isLoadingFallback, FallbackVisibility visibility)
51 : CustomFontData(isLoadingFallback, visibility) 58 : CustomFontData(isLoadingFallback, visibility)
52 , m_fontFaceSource(0) 59 , m_fontFaceSource(0)
53 { 60 {
54 } 61 }
55 62
56 CSSFontFaceSource* m_fontFaceSource; 63 CSSFontFaceSource* m_fontFaceSource;
57 }; 64 };
58 65
59 } 66 }
60 67
61 #endif // CSSCustomFontData_h 68 #endif // CSSCustomFontData_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698