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

Side by Side Diff: Source/platform/fonts/SimpleFontData.cpp

Issue 1326563003: (DO NOT LAND) Use roundOut() rather than round() to round glyph bounds in simple path Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | 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) 2005, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov 3 * Copyright (C) 2006 Alexey Proskuryakov
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bo unds) 399 static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bo unds)
400 { 400 {
401 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 401 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
402 402
403 SkPath path; 403 SkPath path;
404 paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path); 404 paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path);
405 bounds = path.getBounds(); 405 bounds = path.getBounds();
406 406
407 if (!paint.isSubpixelText()) { 407 if (!paint.isSubpixelText()) {
408 SkIRect ir; 408 SkIRect ir;
409 bounds.round(&ir); 409 bounds.roundOut(&ir);
410 bounds.set(ir); 410 bounds.set(ir);
411 } 411 }
412 } 412 }
413 413
414 FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const 414 FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
415 { 415 {
416 if (!m_platformData.size()) 416 if (!m_platformData.size())
417 return FloatRect(); 417 return FloatRect();
418 418
419 SkASSERT(sizeof(glyph) == 2); // compile-time assert 419 SkASSERT(sizeof(glyph) == 2); // compile-time assert
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 if (glyphs[i]) { 493 if (glyphs[i]) {
494 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); 494 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this);
495 haveGlyphs = true; 495 haveGlyphs = true;
496 } 496 }
497 } 497 }
498 498
499 return haveGlyphs; 499 return haveGlyphs;
500 } 500 }
501 501
502 } // namespace blink 502 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698