OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h" | 32 #include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h" |
33 | 33 |
34 #include <unicode/normlzr.h> | 34 #include <unicode/normlzr.h> |
35 #include <unicode/uchar.h> | 35 #include <unicode/uchar.h> |
36 #include "core/platform/graphics/Font.h" | 36 #include "core/platform/graphics/Font.h" |
37 #include "core/platform/graphics/SurrogatePairAwareTextIterator.h" | 37 #include "core/platform/graphics/SurrogatePairAwareTextIterator.h" |
38 #include "core/platform/graphics/TextRun.h" | 38 #include "core/platform/graphics/TextRun.h" |
39 #include "core/platform/graphics/harfbuzz/HarfBuzzFace.h" | 39 #include "core/platform/graphics/harfbuzz/HarfBuzzFace.h" |
40 #include "hb-icu.h" | 40 #include "hb-icu.h" |
41 #include <wtf/MathExtras.h> | 41 #include "wtf/MathExtras.h" |
42 #include <wtf/unicode/Unicode.h> | 42 #include "wtf/unicode/Unicode.h" |
43 #include <wtf/Vector.h> | 43 #include "wtf/Vector.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 template<typename T> | 47 template<typename T> |
48 class HarfBuzzScopedPtr { | 48 class HarfBuzzScopedPtr { |
49 public: | 49 public: |
50 typedef void (*DestroyFunction)(T*); | 50 typedef void (*DestroyFunction)(T*); |
51 | 51 |
52 HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy) | 52 HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy) |
53 : m_ptr(ptr) | 53 : m_ptr(ptr) |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 if (!foundToX) | 678 if (!foundToX) |
679 toX = m_run.rtl() ? 0 : m_totalWidth; | 679 toX = m_run.rtl() ? 0 : m_totalWidth; |
680 | 680 |
681 // Using floorf() and roundf() as the same as mac port. | 681 // Using floorf() and roundf() as the same as mac port. |
682 if (fromX < toX) | 682 if (fromX < toX) |
683 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); | 683 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); |
684 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); | 684 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); |
685 } | 685 } |
686 | 686 |
687 } // namespace WebCore | 687 } // namespace WebCore |
OLD | NEW |