OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 -FIXEDToSkScalar(polyHeader->pfxStart.y)); | 160 -FIXEDToSkScalar(polyHeader->pfxStart.y)); |
161 | 161 |
162 const char* curPoly = curGlyph + sizeof(TTPOLYGONHEADER); | 162 const char* curPoly = curGlyph + sizeof(TTPOLYGONHEADER); |
163 const char* endPoly = curGlyph + polyHeader->cb; | 163 const char* endPoly = curGlyph + polyHeader->cb; |
164 while (curPoly < endPoly) { | 164 while (curPoly < endPoly) { |
165 const TTPOLYCURVE* polyCurve = | 165 const TTPOLYCURVE* polyCurve = |
166 reinterpret_cast<const TTPOLYCURVE*>(curPoly); | 166 reinterpret_cast<const TTPOLYCURVE*>(curPoly); |
167 addPolyCurveToPath(polyCurve, path); | 167 addPolyCurveToPath(polyCurve, path); |
168 curPoly += sizeof(WORD) * 2 + sizeof(POINTFX) * polyCurve->cpfx; | 168 curPoly += sizeof(WORD) * 2 + sizeof(POINTFX) * polyCurve->cpfx; |
169 } | 169 } |
| 170 path->close(); |
170 curGlyph += polyHeader->cb; | 171 curGlyph += polyHeader->cb; |
171 } | 172 } |
172 | 173 |
173 path->close(); | |
174 return true; | 174 return true; |
175 } | 175 } |
176 | 176 |
177 // Returns a SkPath corresponding to the give glyph in the given font. The font | 177 // Returns a SkPath corresponding to the give glyph in the given font. The font |
178 // should be selected into the given DC. The returned path is owned by the | 178 // should be selected into the given DC. The returned path is owned by the |
179 // hashtable. Returns 0 on error. | 179 // hashtable. Returns 0 on error. |
180 const SkPath* SkiaWinOutlineCache::lookupOrCreatePathForGlyph(HDC hdc, HFONT fon
t, WORD glyph) | 180 const SkPath* SkiaWinOutlineCache::lookupOrCreatePathForGlyph(HDC hdc, HFONT fon
t, WORD glyph) |
181 { | 181 { |
182 CachedOutlineKey key(font, glyph); | 182 CachedOutlineKey key(font, glyph); |
183 OutlineCache::iterator found = outlineCache.find(key); | 183 OutlineCache::iterator found = outlineCache.find(key); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 return false; | 370 return false; |
371 } | 371 } |
372 | 372 |
373 SelectObject(dc, oldFont); | 373 SelectObject(dc, oldFont); |
374 ReleaseDC(0, dc); | 374 ReleaseDC(0, dc); |
375 | 375 |
376 return true; | 376 return true; |
377 } | 377 } |
378 | 378 |
379 } // namespace WebCore | 379 } // namespace WebCore |
OLD | NEW |