OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CCFontAtlas_h | 5 #ifndef CCFontAtlas_h |
6 #define CCFontAtlas_h | 6 #define CCFontAtlas_h |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/cc_export.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
14 | 15 |
15 class SkCanvas; | 16 class SkCanvas; |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 class Point; | 19 class Point; |
19 class Size; | 20 class Size; |
20 } | 21 } |
21 | 22 |
22 namespace cc { | 23 namespace cc { |
23 | 24 |
24 // This class provides basic ability to draw text onto the heads-up display. | 25 // This class provides basic ability to draw text onto the heads-up display. |
25 class FontAtlas { | 26 class CC_EXPORT FontAtlas { |
26 public: | 27 public: |
27 static scoped_ptr<FontAtlas> create(SkBitmap bitmap, gfx::Rect asciiToRectTa
ble[128], int fontHeight) | 28 static scoped_ptr<FontAtlas> create(SkBitmap bitmap, gfx::Rect asciiToRectTa
ble[128], int fontHeight) |
28 { | 29 { |
29 return make_scoped_ptr(new FontAtlas(bitmap, asciiToRectTable, fontHeigh
t)); | 30 return make_scoped_ptr(new FontAtlas(bitmap, asciiToRectTable, fontHeigh
t)); |
30 } | 31 } |
31 ~FontAtlas(); | 32 ~FontAtlas(); |
32 | 33 |
33 // Draws multiple lines of text where each line of text is separated by '\n'
. | 34 // Draws multiple lines of text where each line of text is separated by '\n'
. |
34 // - Correct glyphs will be drawn for ASCII codes in the range 32-127; any c
haracters | 35 // - Correct glyphs will be drawn for ASCII codes in the range 32-127; any c
haracters |
35 // outside that range will be displayed as a default rectangle glyph. | 36 // outside that range will be displayed as a default rectangle glyph. |
(...skipping 17 matching lines...) Expand all Loading... |
53 gfx::Rect m_asciiToRectTable[128]; | 54 gfx::Rect m_asciiToRectTable[128]; |
54 | 55 |
55 int m_fontHeight; | 56 int m_fontHeight; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(FontAtlas); | 58 DISALLOW_COPY_AND_ASSIGN(FontAtlas); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace cc | 61 } // namespace cc |
61 | 62 |
62 #endif | 63 #endif |
OLD | NEW |