| 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 "IntRect.h" | 13 #include "IntRect.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 14 | 15 |
| 15 class SkCanvas; | 16 class SkCanvas; |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Point; | 19 class Point; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace cc { | 22 namespace cc { |
| 22 | 23 |
| 23 class IntSize; | 24 class IntSize; |
| 24 | 25 |
| 25 // This class provides basic ability to draw text onto the heads-up display. | 26 // This class provides basic ability to draw text onto the heads-up display. |
| 26 class FontAtlas { | 27 class CC_EXPORT FontAtlas { |
| 27 public: | 28 public: |
| 28 static scoped_ptr<FontAtlas> create(SkBitmap bitmap, IntRect asciiToRectTabl
e[128], int fontHeight) | 29 static scoped_ptr<FontAtlas> create(SkBitmap bitmap, IntRect asciiToRectTabl
e[128], int fontHeight) |
| 29 { | 30 { |
| 30 return make_scoped_ptr(new FontAtlas(bitmap, asciiToRectTable, fontHeigh
t)); | 31 return make_scoped_ptr(new FontAtlas(bitmap, asciiToRectTable, fontHeigh
t)); |
| 31 } | 32 } |
| 32 ~FontAtlas(); | 33 ~FontAtlas(); |
| 33 | 34 |
| 34 // Draws multiple lines of text where each line of text is separated by '\n'
. | 35 // Draws multiple lines of text where each line of text is separated by '\n'
. |
| 35 // - Correct glyphs will be drawn for ASCII codes in the range 32-127; any c
haracters | 36 // - Correct glyphs will be drawn for ASCII codes in the range 32-127; any c
haracters |
| 36 // outside that range will be displayed as a default rectangle glyph. | 37 // outside that range will be displayed as a default rectangle glyph. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 IntRect m_asciiToRectTable[128]; | 55 IntRect m_asciiToRectTable[128]; |
| 55 | 56 |
| 56 int m_fontHeight; | 57 int m_fontHeight; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(FontAtlas); | 59 DISALLOW_COPY_AND_ASSIGN(FontAtlas); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace cc | 62 } // namespace cc |
| 62 | 63 |
| 63 #endif | 64 #endif |
| OLD | NEW |