OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/src/fxge/agg/include/fx_agg_driver.h" | 7 #include "core/src/fxge/agg/include/fx_agg_driver.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 case CFX_GraphStateData::LineJoinBevel: | 137 case CFX_GraphStateData::LineJoinBevel: |
138 join = agg::bevel_join; | 138 join = agg::bevel_join; |
139 break; | 139 break; |
140 default: | 140 default: |
141 join = agg::miter_join_revert; | 141 join = agg::miter_join_revert; |
142 break; | 142 break; |
143 } | 143 } |
144 FX_FLOAT width = pGraphState->m_LineWidth * scale; | 144 FX_FLOAT width = pGraphState->m_LineWidth * scale; |
145 FX_FLOAT unit = 1.f; | 145 FX_FLOAT unit = 1.f; |
146 if (pObject2Device) { | 146 if (pObject2Device) { |
147 unit = FXSYS_Div( | 147 unit = |
148 1.0f, (pObject2Device->GetXUnit() + pObject2Device->GetYUnit()) / 2); | 148 1.0f / ((pObject2Device->GetXUnit() + pObject2Device->GetYUnit()) / 2); |
149 } | 149 } |
150 if (width < unit) { | 150 if (width < unit) { |
151 width = unit; | 151 width = unit; |
152 } | 152 } |
153 if (pGraphState->m_DashArray) { | 153 if (pGraphState->m_DashArray) { |
154 typedef agg::conv_dash<agg::path_storage> dash_converter; | 154 typedef agg::conv_dash<agg::path_storage> dash_converter; |
155 dash_converter dash(path_data); | 155 dash_converter dash(path_data); |
156 for (int i = 0; i < (pGraphState->m_DashCount + 1) / 2; i++) { | 156 for (int i = 0; i < (pGraphState->m_DashCount + 1) / 2; i++) { |
157 FX_FLOAT on = pGraphState->m_DashArray[i * 2]; | 157 FX_FLOAT on = pGraphState->m_DashArray[i * 2]; |
158 if (on <= 0.000001f) { | 158 if (on <= 0.000001f) { |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 IFX_RenderDeviceDriver* pDriver = | 1786 IFX_RenderDeviceDriver* pDriver = |
1787 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); | 1787 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); |
1788 SetDeviceDriver(pDriver); | 1788 SetDeviceDriver(pDriver); |
1789 return TRUE; | 1789 return TRUE; |
1790 } | 1790 } |
1791 CFX_FxgeDevice::~CFX_FxgeDevice() { | 1791 CFX_FxgeDevice::~CFX_FxgeDevice() { |
1792 if (m_bOwnedBitmap) { | 1792 if (m_bOwnedBitmap) { |
1793 delete GetBitmap(); | 1793 delete GetBitmap(); |
1794 } | 1794 } |
1795 } | 1795 } |
OLD | NEW |