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/fxge/agg/fx_agg_driver.h" | 7 #include "core/fxge/agg/fx_agg_driver.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (!m_pClipRgn) { | 552 if (!m_pClipRgn) { |
553 m_pClipRgn.reset(new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), | 553 m_pClipRgn.reset(new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), |
554 GetDeviceCaps(FXDC_PIXEL_HEIGHT))); | 554 GetDeviceCaps(FXDC_PIXEL_HEIGHT))); |
555 } | 555 } |
556 if (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) { | 556 if (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) { |
557 CFX_FloatRect rectf; | 557 CFX_FloatRect rectf; |
558 if (pPathData->IsRect(pObject2Device, &rectf)) { | 558 if (pPathData->IsRect(pObject2Device, &rectf)) { |
559 rectf.Intersect( | 559 rectf.Intersect( |
560 CFX_FloatRect(0, 0, (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), | 560 CFX_FloatRect(0, 0, (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), |
561 (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT))); | 561 (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT))); |
562 FX_RECT rect = rectf.GetOutterRect(); | 562 FX_RECT rect = rectf.GetOuterRect(); |
563 m_pClipRgn->IntersectRect(rect); | 563 m_pClipRgn->IntersectRect(rect); |
564 return TRUE; | 564 return TRUE; |
565 } | 565 } |
566 } | 566 } |
567 CAgg_PathData path_data; | 567 CAgg_PathData path_data; |
568 path_data.BuildPath(pPathData, pObject2Device); | 568 path_data.BuildPath(pPathData, pObject2Device); |
569 path_data.m_PathData.end_poly(); | 569 path_data.m_PathData.end_poly(); |
570 agg::rasterizer_scanline_aa rasterizer; | 570 agg::rasterizer_scanline_aa rasterizer; |
571 rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), | 571 rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), |
572 (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT))); | 572 (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT))); |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 WrapUnique(new CFX_AggDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE))); | 1761 WrapUnique(new CFX_AggDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE))); |
1762 return true; | 1762 return true; |
1763 } | 1763 } |
1764 | 1764 |
1765 CFX_FxgeDevice::~CFX_FxgeDevice() { | 1765 CFX_FxgeDevice::~CFX_FxgeDevice() { |
1766 if (m_bOwnedBitmap) { | 1766 if (m_bOwnedBitmap) { |
1767 delete GetBitmap(); | 1767 delete GetBitmap(); |
1768 } | 1768 } |
1769 } | 1769 } |
1770 #endif | 1770 #endif |
OLD | NEW |