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 #include "../../../include/fxge/fx_ge.h" | 5 #include "../../../include/fxge/fx_ge.h" |
6 //#define _SKIA_SUPPORT_ | 6 //#define _SKIA_SUPPORT_ |
7 #if defined(_SKIA_SUPPORT_) | 7 #if defined(_SKIA_SUPPORT_) |
8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
9 | 9 |
10 | 10 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 stroker.setJoin(join); | 203 stroker.setJoin(join); |
204 stroker.setMiterLimit(pGraphState->m_MiterLimit); | 204 stroker.setMiterLimit(pGraphState->m_MiterLimit); |
205 stroker.setWidth(width); | 205 stroker.setWidth(width); |
206 stroker.setDoFill(FALSE); | 206 stroker.setDoFill(FALSE); |
207 stroker.strokePath(path_data, dstPathData); | 207 stroker.strokePath(path_data, dstPathData); |
208 SkMatrix smatrix; | 208 SkMatrix smatrix; |
209 smatrix.setAll(pObject2Device->a, pObject2Device->c, pObject2Dev
ice->e, pObject2Device->b, pObject2Device->d, pObject2Device->f, 0, 0, 1); | 209 smatrix.setAll(pObject2Device->a, pObject2Device->c, pObject2Dev
ice->e, pObject2Device->b, pObject2Device->d, pObject2Device->f, 0, 0, 1); |
210 dstPathData->transform(smatrix); | 210 dstPathData->transform(smatrix); |
211 } else { | 211 } else { |
212 int count = (pGraphState->m_DashCount+1)/2; | 212 int count = (pGraphState->m_DashCount+1)/2; |
213 » » SkScalar* intervals = FX_Alloc(SkScalar, count* sizeof (SkScalar
)); | 213 » » SkScalar* intervals = FX_Alloc2D(SkScalar, count, sizeof(SkScala
r)); |
214 // Set dash pattern | 214 // Set dash pattern |
215 for (int i = 0; i < count; i ++) { | 215 for (int i = 0; i < count; i ++) { |
216 FX_FIXFLOAT on = pGraphState->m_DashArray[i*2]; | 216 FX_FIXFLOAT on = pGraphState->m_DashArray[i*2]; |
217 if (on <= 0.000001f) on = FIX8_ONE/10; | 217 if (on <= 0.000001f) on = FIX8_ONE/10; |
218 FX_FIXFLOAT off = i*2+1 == pGraphState->m_DashCount ? on
: | 218 FX_FIXFLOAT off = i*2+1 == pGraphState->m_DashCount ? on
: |
219 pGraphState->m_DashArray[i*2+1]; | 219 pGraphState->m_DashArray[i*2+1]; |
220 if (off < 0) off = 0; | 220 if (off < 0) off = 0; |
221 intervals[i*2]=on*scale; | 221 intervals[i*2]=on*scale; |
222 intervals[i*2+1]=off*scale; | 222 intervals[i*2+1]=off*scale; |
223 } | 223 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 CFX_SkiaDeviceDriver* pDriver = FX_NEW CFX_SkiaDeviceDriver(pBitmap, di
ther_bits, FALSE, pOriDevice, FALSE); | 522 CFX_SkiaDeviceDriver* pDriver = FX_NEW CFX_SkiaDeviceDriver(pBitmap, di
ther_bits, FALSE, pOriDevice, FALSE); |
523 SetDeviceDriver(pDriver); | 523 SetDeviceDriver(pDriver); |
524 return TRUE; | 524 return TRUE; |
525 } | 525 } |
526 CFX_SkiaDevice::~CFX_SkiaDevice() | 526 CFX_SkiaDevice::~CFX_SkiaDevice() |
527 { | 527 { |
528 if (m_bOwnedBitmap && GetBitmap()) delete GetBitmap(); | 528 if (m_bOwnedBitmap && GetBitmap()) delete GetBitmap(); |
529 } | 529 } |
530 | 530 |
531 #endif | 531 #endif |
OLD | NEW |