OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SkiaFont_Win_h |
| 6 #define SkiaFont_Win_h |
| 7 |
| 8 #include <windows.h> |
| 9 #include <usp10.h> |
| 10 |
| 11 class SkCanvas; |
| 12 class SkPaint; |
| 13 struct SkPoint; |
| 14 |
| 15 // This file provices Skia equivalents to Windows text drawing functions. They |
| 16 // will get the outlines from Windows and draw then using Skia using the given |
| 17 // parameters in the paint arguments. This allows more complex effects and |
| 18 // transforms to be drawn than Windows allows. |
| 19 // |
| 20 // These functions will be significantly slower than Windows GDI, and the text |
| 21 // will look different (no ClearType), so use only when necessary. |
| 22 // |
| 23 // When you call a Skia* text drawing function, various glyph outlines will be |
| 24 // cached. As a result, you should call RemoveFontFromSkiaFontWinCache when |
| 25 // the font is destroyed so that the cache does not outlive the font (since the |
| 26 // HFONTs are recycled). |
| 27 namespace WebCore { |
| 28 |
| 29 // Analog of the Windows GDI function DrawText, except using the given SkPaint |
| 30 // attributes for the text. See above for more. |
| 31 // |
| 32 // Returns true of the text was drawn successfully. False indicates an error |
| 33 // from Windows. |
| 34 bool SkiaDrawText(HFONT hfont, |
| 35 SkCanvas* canvas, |
| 36 const SkPoint& point, |
| 37 SkPaint* paint, |
| 38 const WORD* glyphs, |
| 39 const int* advances, |
| 40 int num_glyphs); |
| 41 |
| 42 // This mirrors the features of ScriptTextOut. |
| 43 /* TODO(brettw) finish this implementation. |
| 44 bool SkiaDrawComplexText(HFONT font, |
| 45 SkCanvas* canvas, |
| 46 const SkPoint& point, |
| 47 SkPaint* paint, |
| 48 UINT fuOptions, |
| 49 const SCRIPT_ANALYSIS* psa, |
| 50 const WORD* pwGlyphs, |
| 51 int cGlyphs, |
| 52 const int* advances, |
| 53 const int* justifies, |
| 54 const GOFFSET* glyph_offsets); |
| 55 */ |
| 56 |
| 57 // Removes any cached glyphs from the outline cache corresponding to the given |
| 58 // font handle. |
| 59 void RemoveFontFromSkiaFontWinCache(HFONT hfont); |
| 60 |
| 61 } // namespace WebCore |
| 62 |
| 63 #endif // SkiaFont_Win_h |
OLD | NEW |