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

Side by Side Diff: core/src/fxge/agg/src/fx_agg_driver.cpp

Issue 1727793002: Remove FXSYS_Div. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698