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

Side by Side Diff: third_party/WebKit/WebCore/platform/graphics/skia/SkiaFontWin.cpp

Issue 42087: SkiaFontWin.cpp: close the SkPath after each polygon rather than only once. L... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698