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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "xfa/src/fxgraphics/src/fx_path_generator.h" | 9 #include "xfa/src/fxgraphics/src/fx_path_generator.h" |
10 #include "xfa/src/fxgraphics/src/pre.h" | 10 #include "xfa/src/fxgraphics/src/pre.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 return FX_ERR_Succeeded; | 477 return FX_ERR_Succeeded; |
478 } | 478 } |
479 default: { return FX_ERR_Property_Invalid; } | 479 default: { return FX_ERR_Property_Invalid; } |
480 } | 480 } |
481 } | 481 } |
482 FX_ERR CFX_Graphics::SetClipRect(const CFX_RectF& rect) { | 482 FX_ERR CFX_Graphics::SetClipRect(const CFX_RectF& rect) { |
483 switch (_type) { | 483 switch (_type) { |
484 case FX_CONTEXT_Device: { | 484 case FX_CONTEXT_Device: { |
485 if (!_renderDevice) | 485 if (!_renderDevice) |
486 return FX_ERR_Property_Invalid; | 486 return FX_ERR_Property_Invalid; |
487 FX_RECT r(FXSYS_round(rect.left), FXSYS_round(rect.top), | 487 if (!_renderDevice->SetClip_Rect( |
488 FXSYS_round(rect.right()), FXSYS_round(rect.bottom())); | 488 FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), |
489 FX_BOOL result = _renderDevice->SetClip_Rect(&r); | 489 FXSYS_round(rect.right()), FXSYS_round(rect.bottom())))) { |
490 if (!result) | |
491 return FX_ERR_Method_Not_Supported; | 490 return FX_ERR_Method_Not_Supported; |
| 491 } |
492 return FX_ERR_Succeeded; | 492 return FX_ERR_Succeeded; |
493 } | 493 } |
494 default: { return FX_ERR_Property_Invalid; } | 494 default: { return FX_ERR_Property_Invalid; } |
495 } | 495 } |
496 } | 496 } |
497 FX_ERR CFX_Graphics::ClearClip() { | 497 FX_ERR CFX_Graphics::ClearClip() { |
498 switch (_type) { | 498 switch (_type) { |
499 case FX_CONTEXT_Device: { | 499 case FX_CONTEXT_Device: { |
500 if (!_renderDevice) | 500 if (!_renderDevice) |
501 return FX_ERR_Property_Invalid; | 501 return FX_ERR_Property_Invalid; |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 b3 = (int32_t)(i * bScale); | 1537 b3 = (int32_t)(i * bScale); |
1538 _argbArray[i] = | 1538 _argbArray[i] = |
1539 FXARGB_TODIB(FXARGB_MAKE((a1 + a3), (r1 + r3), (g1 + g3), (b1 + b3))); | 1539 FXARGB_TODIB(FXARGB_MAKE((a1 + a3), (r1 + r3), (g1 + g3), (b1 + b3))); |
1540 } | 1540 } |
1541 return FX_ERR_Succeeded; | 1541 return FX_ERR_Succeeded; |
1542 } | 1542 } |
1543 class CFX_Pause : public IFX_Pause { | 1543 class CFX_Pause : public IFX_Pause { |
1544 public: | 1544 public: |
1545 virtual FX_BOOL NeedToPauseNow() { return TRUE; } | 1545 virtual FX_BOOL NeedToPauseNow() { return TRUE; } |
1546 }; | 1546 }; |
OLD | NEW |