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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 T* get() { return m_ptr; } | 69 T* get() { return m_ptr; } |
70 void set(T* ptr) { m_ptr = ptr; } | 70 void set(T* ptr) { m_ptr = ptr; } |
71 private: | 71 private: |
72 T* m_ptr; | 72 T* m_ptr; |
73 DestroyFunction m_destroy; | 73 DestroyFunction m_destroy; |
74 }; | 74 }; |
75 | 75 |
76 | 76 |
77 static const int cHarfBuzzCacheMaxSize = 256; | 77 static const unsigned cHarfBuzzCacheMaxSize = 256; |
78 | 78 |
79 struct CachedShapingResultsLRUNode; | 79 struct CachedShapingResultsLRUNode; |
80 struct CachedShapingResults; | 80 struct CachedShapingResults; |
81 typedef std::map<std::wstring, CachedShapingResults*> CachedShapingResultsMap; | 81 typedef std::map<std::wstring, CachedShapingResults*> CachedShapingResultsMap; |
82 typedef std::list<CachedShapingResultsLRUNode*> CachedShapingResultsLRU; | 82 typedef std::list<CachedShapingResultsLRUNode*> CachedShapingResultsLRU; |
83 | 83 |
84 struct CachedShapingResults { | 84 struct CachedShapingResults { |
85 CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* runFont, hb_di
rection_t runDir); | 85 CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* runFont, hb_di
rection_t runDir); |
86 ~CachedShapingResults(); | 86 ~CachedShapingResults(); |
87 | 87 |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 if (!foundToX) | 864 if (!foundToX) |
865 toX = m_run.rtl() ? 0 : m_totalWidth; | 865 toX = m_run.rtl() ? 0 : m_totalWidth; |
866 | 866 |
867 // Using floorf() and roundf() as the same as mac port. | 867 // Using floorf() and roundf() as the same as mac port. |
868 if (fromX < toX) | 868 if (fromX < toX) |
869 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); | 869 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); |
870 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); | 870 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); |
871 } | 871 } |
872 | 872 |
873 } // namespace WebCore | 873 } // namespace WebCore |
OLD | NEW |