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

Side by Side Diff: Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp

Issue 12919016: Merge 142928 "Crash when selecting a HarfBuzz text run with SVG ..." (Closed) Base URL: https://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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
« no previous file with comments | « Source/WebCore/platform/graphics/SimpleFontData.h ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection) 316 bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
317 { 317 {
318 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_ destroy); 318 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_ destroy);
319 319
320 hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs() ); 320 hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs() );
321 321
322 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { 322 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
323 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i; 323 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i;
324 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); 324 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
325 const SimpleFontData* currentFontData = currentRun->fontData(); 325 const SimpleFontData* currentFontData = currentRun->fontData();
326 if (currentFontData->isSVGFont())
327 return false;
326 328
327 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); 329 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
328 if (shouldSetDirection) 330 if (shouldSetDirection)
329 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB _DIRECTION_RTL : HB_DIRECTION_LTR); 331 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB _DIRECTION_RTL : HB_DIRECTION_LTR);
330 332
331 // Add a space as pre-context to the buffer. This prevents showing dotte d-circle 333 // Add a space as pre-context to the buffer. This prevents showing dotte d-circle
332 // for combining marks at the beginning of runs. 334 // for combining marks at the beginning of runs.
333 static const uint16_t preContext = ' '; 335 static const uint16_t preContext = ' ';
334 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0); 336 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
335 337
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (!foundToX) 536 if (!foundToX)
535 toX = m_run.rtl() ? 0 : m_totalWidth; 537 toX = m_run.rtl() ? 0 : m_totalWidth;
536 538
537 // Using floorf() and roundf() as the same as mac port. 539 // Using floorf() and roundf() as the same as mac port.
538 if (fromX < toX) 540 if (fromX < toX)
539 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from X), height); 541 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from X), height);
540 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he ight); 542 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he ight);
541 } 543 }
542 544
543 } // namespace WebCore 545 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/platform/graphics/SimpleFontData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698