diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-23 13:30:34 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-23 18:53:44 +0000 |
commit | b9c69ab7f1338684ffddbc1076052c546f1a95ad (patch) | |
tree | 59e5ecfcfaf1ae28956b725168854c1fb8adf684 /xfa/fxgraphics | |
parent | efcf362b6658346ae0f8f3cdb73d871fdd82c8af (diff) | |
download | pdfium-b9c69ab7f1338684ffddbc1076052c546f1a95ad.tar.xz |
Cleanup CFX_Graphics.
This Cl removes unused methods, removes unused return values, removes unused
hatch data.
Change-Id: Id76240170a3bd1c3ef156fbda25a6ac96462cbda
Reviewed-on: https://pdfium-review.googlesource.com/2827
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxgraphics')
-rw-r--r-- | xfa/fxgraphics/cagg_graphics.cpp | 30 | ||||
-rw-r--r-- | xfa/fxgraphics/cagg_graphics.h | 29 | ||||
-rw-r--r-- | xfa/fxgraphics/cfx_color.cpp | 13 | ||||
-rw-r--r-- | xfa/fxgraphics/cfx_color.h | 6 | ||||
-rw-r--r-- | xfa/fxgraphics/cfx_graphics.cpp | 1268 | ||||
-rw-r--r-- | xfa/fxgraphics/cfx_graphics.h | 216 | ||||
-rw-r--r-- | xfa/fxgraphics/cfx_pattern.cpp | 3 |
7 files changed, 176 insertions, 1389 deletions
diff --git a/xfa/fxgraphics/cagg_graphics.cpp b/xfa/fxgraphics/cagg_graphics.cpp deleted file mode 100644 index 5d1f563613..0000000000 --- a/xfa/fxgraphics/cagg_graphics.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fxgraphics/cagg_graphics.h" - -CAGG_Graphics::CAGG_Graphics() : m_owner(nullptr) {} - -FWL_Error CAGG_Graphics::Create(CFX_Graphics* owner, - int32_t width, - int32_t height, - FXDIB_Format format) { - if (owner->m_renderDevice) - return FWL_Error::ParameterInvalid; - if (m_owner) - return FWL_Error::PropertyInvalid; - - CFX_FxgeDevice* device = new CFX_FxgeDevice; - device->Create(width, height, format, nullptr); - m_owner = owner; - m_owner->m_renderDevice = device; - m_owner->m_renderDevice->GetBitmap()->Clear(0xFFFFFFFF); - return FWL_Error::Succeeded; -} - -CAGG_Graphics::~CAGG_Graphics() { - delete m_owner->m_renderDevice; -} diff --git a/xfa/fxgraphics/cagg_graphics.h b/xfa/fxgraphics/cagg_graphics.h deleted file mode 100644 index 9f57a72343..0000000000 --- a/xfa/fxgraphics/cagg_graphics.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ -#define XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ - -#include "core/fxge/fx_dib.h" -#include "xfa/fxgraphics/cfx_graphics.h" - -class CFX_Graphics; - -class CAGG_Graphics { - public: - CAGG_Graphics(); - virtual ~CAGG_Graphics(); - - FWL_Error Create(CFX_Graphics* owner, - int32_t width, - int32_t height, - FXDIB_Format format); - - private: - CFX_Graphics* m_owner; -}; - -#endif // XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ diff --git a/xfa/fxgraphics/cfx_color.cpp b/xfa/fxgraphics/cfx_color.cpp index 2044b76054..36025a82c8 100644 --- a/xfa/fxgraphics/cfx_color.cpp +++ b/xfa/fxgraphics/cfx_color.cpp @@ -24,26 +24,23 @@ CFX_Color::~CFX_Color() { m_type = FX_COLOR_None; } -FWL_Error CFX_Color::Set(const FX_ARGB argb) { +void CFX_Color::Set(const FX_ARGB argb) { m_type = FX_COLOR_Solid; m_info.argb = argb; m_info.pattern = nullptr; - return FWL_Error::Succeeded; } -FWL_Error CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { +void CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { if (!pattern) - return FWL_Error::ParameterInvalid; + return; m_type = FX_COLOR_Pattern; m_info.argb = argb; m_info.pattern = pattern; - return FWL_Error::Succeeded; } -FWL_Error CFX_Color::Set(CFX_Shading* shading) { +void CFX_Color::Set(CFX_Shading* shading) { if (!shading) - return FWL_Error::ParameterInvalid; + return; m_type = FX_COLOR_Shading; m_shading = shading; - return FWL_Error::Succeeded; } diff --git a/xfa/fxgraphics/cfx_color.h b/xfa/fxgraphics/cfx_color.h index f47f8c472b..75f7fe2010 100644 --- a/xfa/fxgraphics/cfx_color.h +++ b/xfa/fxgraphics/cfx_color.h @@ -23,9 +23,9 @@ class CFX_Color { CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb); virtual ~CFX_Color(); - FWL_Error Set(const FX_ARGB argb); - FWL_Error Set(CFX_Pattern* pattern, const FX_ARGB argb); - FWL_Error Set(CFX_Shading* shading); + void Set(const FX_ARGB argb); + void Set(CFX_Pattern* pattern, const FX_ARGB argb); + void Set(CFX_Shading* shading); private: friend class CFX_Graphics; diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp index d47c261868..d2f2151d91 100644 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ b/xfa/fxgraphics/cfx_graphics.cpp @@ -13,7 +13,6 @@ #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/cfx_unicodeencoding.h" #include "third_party/base/ptr_util.h" -#include "xfa/fxgraphics/cagg_graphics.h" #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cfx_pattern.h" @@ -35,663 +34,111 @@ struct FX_HATCHDATA { }; const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = { - {16, + {16, // Horizontal 16, { - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }}, - {16, + {16, // Vertical 16, { - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, + 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, + 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, }}, - {16, + {16, // ForwardDiagonal 16, { - 0x80, 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, - 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, - 0x01, 0x01, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, + 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, + 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, + 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, + 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, }}, - {16, + {16, // BackwardDiagonal 16, { - 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, + 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, + 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, + 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, + 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, + 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, }}, - {16, + {16, // Cross 16, { - 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, + 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, }}, - {16, + {16, // DiagonalCross 16, { - 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, - 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, - 0x81, 0x81, 0x00, 0x00, - }}, - {16, - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, - }}, - {16, - 16, - { - 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x11, 0x11, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x11, 0x11, 0x00, 0x00, - }}, - {16, - 16, - { - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x51, 0x51, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x15, 0x15, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x51, 0x51, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x15, 0x15, 0x00, 0x00, - }}, - {16, - 16, - { - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, - }}, - {16, - 16, - { - 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xbb, 0xbb, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, - }}, - {16, - 16, - { - 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, - 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, - 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, - 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, - 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, - 0xdd, 0xdd, 0x00, 0x00, - }}, - {16, - 16, - { - 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xdd, 0xdd, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, - }}, - {16, - 16, - { - 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xfe, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xef, 0xef, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xf7, 0xf7, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xf7, 0xf7, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x7f, 0x7f, 0x00, 0x00, - }}, - {16, - 16, - { - 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x11, 0x11, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x11, 0x11, 0x00, 0x00, - }}, - {16, - 16, - { - 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, - }}, - {16, - 16, - { - 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0x33, 0x33, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, - }}, - {16, - 16, - { - 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, - 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, - 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, - }}, - {16, - 16, - { - 0xc1, 0xc1, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, - 0x38, 0x38, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, - 0x07, 0x07, 0x00, 0x00, 0x83, 0x83, 0x00, 0x00, 0xc1, 0xc1, 0x00, 0x00, - 0xe0, 0xe0, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, - 0x1c, 0x1c, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, - 0x83, 0x83, 0x00, 0x00, - }}, - {16, - 16, - { - 0x83, 0x83, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, - 0x1c, 0x1c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, - 0xe0, 0xe0, 0x00, 0x00, 0xc1, 0xc1, 0x00, 0x00, 0x83, 0x83, 0x00, 0x00, - 0x07, 0x07, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, - 0x38, 0x38, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00, - 0xc1, 0xc1, 0x00, 0x00, - }}, - {16, - 16, - { - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, - 0xcc, 0xcc, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, - }}, - {16, - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, - 0x02, 0x02, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x20, 0x20, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x04, 0x04, 0x00, 0x00, - }}, - {16, - 16, - { - 0xb1, 0xb1, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, - 0x1b, 0x1b, 0x00, 0x00, 0xd8, 0xd8, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, - 0x0c, 0x0c, 0x00, 0x00, 0x8d, 0x8d, 0x00, 0x00, 0xb1, 0xb1, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x1b, 0x1b, 0x00, 0x00, - 0xd8, 0xd8, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, - 0x8d, 0x8d, 0x00, 0x00, - }}, - {16, - 16, - { - 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, - 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, - 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, - }}, - {16, - 16, - { - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00, - 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x25, 0x25, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00, - 0xc0, 0xc0, 0x00, 0x00, - }}, - {16, - 16, - { - 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, - 0x81, 0x81, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, - }}, - {16, - 16, - { - 0x88, 0x88, 0x00, 0x00, 0x54, 0x54, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x45, 0x45, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x51, 0x51, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x54, 0x54, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x45, 0x45, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x51, 0x51, 0x00, 0x00, - }}, - {16, - 16, - { - 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0xf0, 0xf0, 0x00, 0x00, - }}, - {16, - 16, - { - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, - }}, - {16, - 16, - { - 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }}, - {16, - 16, - { - 0x03, 0x03, 0x00, 0x00, 0x84, 0x84, 0x00, 0x00, 0x48, 0x48, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, - 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, - 0x84, 0x84, 0x00, 0x00, 0x48, 0x48, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, - 0x0c, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x01, 0x01, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, - }}, - {16, - 16, - { - 0x77, 0x77, 0x00, 0x00, 0x89, 0x89, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00, - 0x8f, 0x8f, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0x98, 0x98, 0x00, 0x00, - 0xf8, 0xf8, 0x00, 0x00, 0xf8, 0xf8, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, - 0x89, 0x89, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00, - 0x77, 0x77, 0x00, 0x00, 0x98, 0x98, 0x00, 0x00, 0xf8, 0xf8, 0x00, 0x00, - 0xf8, 0xf8, 0x00, 0x00, - }}, - {16, - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, - 0x88, 0x88, 0x00, 0x00, - }}, - {16, - 16, - { - 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0x66, 0x66, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, - 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, - 0x99, 0x99, 0x00, 0x00, - }}, - {16, - 16, - { - 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, - 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, - 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, - 0x0f, 0x0f, 0x00, 0x00, - }}, - {16, - 16, - { - 0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, - 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, - 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, - 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, - 0x01, 0x01, 0x00, 0x00, - }}, - {16, - 16, - { - 0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, - 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, - 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, - 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, + 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, + 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, + 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x81, + 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, + 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, }}, }; } // namespace -CFX_Graphics::CFX_Graphics() - : m_type(FX_CONTEXT_None), m_renderDevice(nullptr) {} - -FWL_Error CFX_Graphics::Create(CFX_RenderDevice* renderDevice, - bool isAntialiasing) { +CFX_Graphics::CFX_Graphics(CFX_RenderDevice* renderDevice) + : m_type(FX_CONTEXT_None), m_renderDevice(renderDevice) { if (!renderDevice) - return FWL_Error::ParameterInvalid; - if (m_type != FX_CONTEXT_None) - return FWL_Error::PropertyInvalid; - - m_type = FX_CONTEXT_Device; - m_info.isAntialiasing = isAntialiasing; - m_renderDevice = renderDevice; - if (m_renderDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP) - return FWL_Error::Succeeded; - return FWL_Error::Indefinite; -} - -FWL_Error CFX_Graphics::Create(int32_t width, - int32_t height, - FXDIB_Format format, - bool isNative, - bool isAntialiasing) { - if (m_type != FX_CONTEXT_None) - return FWL_Error::PropertyInvalid; - + return; m_type = FX_CONTEXT_Device; - m_info.isAntialiasing = isAntialiasing; - m_aggGraphics = pdfium::MakeUnique<CAGG_Graphics>(); - return m_aggGraphics->Create(this, width, height, format); } CFX_Graphics::~CFX_Graphics() {} -FWL_Error CFX_Graphics::GetDeviceCap(const int32_t capID, - FX_DeviceCap& capVal) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - capVal = m_renderDevice->GetDeviceCaps(capID); - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::IsPrinterDevice(bool& isPrinter) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - isPrinter = m_renderDevice->GetDeviceClass() == FXDC_PRINTER; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::EnableAntialiasing(bool isAntialiasing) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.isAntialiasing = isAntialiasing; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SaveGraphState() { +void CFX_Graphics::SaveGraphState() { if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return FWL_Error::PropertyInvalid; + return; m_renderDevice->SaveState(); m_infoStack.push_back(pdfium::MakeUnique<TInfo>(m_info)); - return FWL_Error::Succeeded; } -FWL_Error CFX_Graphics::RestoreGraphState() { +void CFX_Graphics::RestoreGraphState() { if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return FWL_Error::PropertyInvalid; + return; m_renderDevice->RestoreState(false); if (m_infoStack.empty() || !m_infoStack.back()) - return FWL_Error::IntermediateValueInvalid; + return; m_info = *m_infoStack.back(); m_infoStack.pop_back(); - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::GetLineCap(CFX_GraphStateData::LineCap& lineCap) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - lineCap = m_info.graphState.m_LineCap; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; + return; } -FWL_Error CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) { +void CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) { if (m_type == FX_CONTEXT_Device && m_renderDevice) { m_info.graphState.m_LineCap = lineCap; - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::GetDashCount(int32_t& dashCount) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - dashCount = m_info.graphState.m_DashCount; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::GetLineDash(FX_FLOAT& dashPhase, - FX_FLOAT* dashArray) const { - if (!dashArray) - return FWL_Error::ParameterInvalid; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - dashPhase = m_info.graphState.m_DashPhase; - FXSYS_memcpy(dashArray, m_info.graphState.m_DashArray, - m_info.graphState.m_DashCount * sizeof(FX_FLOAT)); - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, - FX_FLOAT* dashArray, - int32_t dashCount) { +void CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, + FX_FLOAT* dashArray, + int32_t dashCount) { if (dashCount > 0 && !dashArray) - return FWL_Error::ParameterInvalid; + return; dashCount = dashCount < 0 ? 0 : dashCount; if (m_type == FX_CONTEXT_Device && m_renderDevice) { @@ -704,165 +151,68 @@ FWL_Error CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, for (int32_t i = 0; i < dashCount; i++) { m_info.graphState.m_DashArray[i] = dashArray[i] * scale; } - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::SetLineDash(FX_DashStyle dashStyle) { +void CFX_Graphics::SetLineDash(FX_DashStyle dashStyle) { if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceSetLineDash(dashStyle); - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::GetLineJoin( - CFX_GraphStateData::LineJoin& lineJoin) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - lineJoin = m_info.graphState.m_LineJoin; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; + RenderDeviceSetLineDash(dashStyle); } -FWL_Error CFX_Graphics::SetLineJoin(CFX_GraphStateData::LineJoin lineJoin) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.graphState.m_LineJoin = lineJoin; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::GetMiterLimit(FX_FLOAT& miterLimit) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - miterLimit = m_info.graphState.m_MiterLimit; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetMiterLimit(FX_FLOAT miterLimit) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.graphState.m_MiterLimit = miterLimit; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::GetLineWidth(FX_FLOAT& lineWidth) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - lineWidth = m_info.graphState.m_LineWidth; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash) { +void CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash) { if (m_type == FX_CONTEXT_Device && m_renderDevice) { m_info.graphState.m_LineWidth = lineWidth; m_info.isActOnDash = isActOnDash; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::GetStrokeAlignment( - FX_StrokeAlignment& strokeAlignment) const { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - strokeAlignment = m_info.strokeAlignment; - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::SetStrokeAlignment(FX_StrokeAlignment strokeAlignment) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.strokeAlignment = strokeAlignment; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetStrokeColor(CFX_Color* color) { +void CFX_Graphics::SetStrokeColor(CFX_Color* color) { if (!color) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) { m_info.strokeColor = color; - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::SetFillColor(CFX_Color* color) { +void CFX_Graphics::SetFillColor(CFX_Color* color) { if (!color) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) { m_info.fillColor = color; - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::StrokePath(CFX_Path* path, CFX_Matrix* matrix) { - if (!path) - return FWL_Error::ParameterInvalid; - if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceStrokePath(path, matrix); - return FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::FillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { +void CFX_Graphics::StrokePath(CFX_Path* path, CFX_Matrix* matrix) { if (!path) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceFillPath(path, fillMode, matrix); - return FWL_Error::PropertyInvalid; + RenderDeviceStrokePath(path, matrix); } -FWL_Error CFX_Graphics::ClipPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { +void CFX_Graphics::FillPath(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { if (!path) - return FWL_Error::ParameterInvalid; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - bool result = - m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); - if (!result) - return FWL_Error::Indefinite; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::DrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix) { - if (!source) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceDrawImage(source, point, matrix); - return FWL_Error::PropertyInvalid; + RenderDeviceFillPath(path, fillMode, matrix); } -FWL_Error CFX_Graphics::StretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix) { +void CFX_Graphics::StretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, + CFX_Matrix* matrix) { if (!source) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceStretchImage(source, rect, matrix); - return FWL_Error::PropertyInvalid; + RenderDeviceStretchImage(source, rect, matrix); } -FWL_Error CFX_Graphics::ConcatMatrix(const CFX_Matrix* matrix) { +void CFX_Graphics::ConcatMatrix(const CFX_Matrix* matrix) { if (!matrix) - return FWL_Error::ParameterInvalid; + return; if (m_type == FX_CONTEXT_Device && m_renderDevice) { m_info.CTM.Concat(*matrix); - return FWL_Error::Succeeded; } - return FWL_Error::PropertyInvalid; } CFX_Matrix* CFX_Graphics::GetMatrix() { @@ -879,275 +229,52 @@ CFX_RectF CFX_Graphics::GetClipRect() const { return CFX_Rect(r.left, r.top, r.Width(), r.Height()).As<FX_FLOAT>(); } -FWL_Error CFX_Graphics::SetClipRect(const CFX_RectF& rect) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - if (!m_renderDevice->SetClip_Rect( - FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), - FXSYS_round(rect.right()), FXSYS_round(rect.bottom())))) { - return FWL_Error::MethodNotSupported; - } - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::ClearClip() { - if (m_type == FX_CONTEXT_Device && m_renderDevice) - return FWL_Error::Succeeded; - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetFont(CFX_Font* font) { - if (!font) - return FWL_Error::ParameterInvalid; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.font = font; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetFontSize(const FX_FLOAT size) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.fontSize = size <= 0 ? 1.0f : size; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetFontHScale(const FX_FLOAT scale) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.fontHScale = scale <= 0 ? 1.0f : scale; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing) { +void CFX_Graphics::SetClipRect(const CFX_RectF& rect) { if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.fontSpacing = spacing < 0 ? 0 : spacing; - return FWL_Error::Succeeded; + m_renderDevice->SetClip_Rect( + FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), + FXSYS_round(rect.right()), FXSYS_round(rect.bottom()))); } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::SetTextDrawingMode(const int32_t mode) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) - return FWL_Error::Succeeded; - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::ShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) - return RenderDeviceShowText(point, text, matrix); - return FWL_Error::PropertyInvalid; -} - -void CFX_Graphics::CalcTextRect(CFX_RectF& rect, - const CFX_WideString& text, - bool isMultiline, - CFX_Matrix* matrix) { - if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return; - - int32_t length = text.GetLength(); - uint32_t* charCodes = FX_Alloc(uint32_t, length); - FXTEXT_CHARPOS* charPos = FX_Alloc(FXTEXT_CHARPOS, length); - CalcTextInfo(text, charCodes, charPos, rect); - FX_Free(charPos); - FX_Free(charCodes); -} - -FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics, - const CFX_Matrix* matrix) { - if (!graphics || !graphics->m_renderDevice) - return FWL_Error::ParameterInvalid; - CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m.Concat(*matrix); - } - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - CFX_DIBitmap* bitmap = graphics->m_renderDevice->GetBitmap(); - bool result = m_renderDevice->SetDIBits(bitmap, 0, 0); - if (!result) - return FWL_Error::MethodNotSupported; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; -} - -FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics, - FX_FLOAT srcLeft, - FX_FLOAT srcTop, - const CFX_RectF& dstRect, - const CFX_Matrix* matrix) { - if (!graphics || !graphics->m_renderDevice) - return FWL_Error::ParameterInvalid; - CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m.Concat(*matrix); - } - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - CFX_DIBitmap bmp; - bool result = - bmp.Create((int32_t)dstRect.width, (int32_t)dstRect.height, - graphics->m_renderDevice->GetBitmap()->GetFormat()); - if (!result) - return FWL_Error::IntermediateValueInvalid; - result = graphics->m_renderDevice->GetDIBits(&bmp, (int32_t)srcLeft, - (int32_t)srcTop); - if (!result) - return FWL_Error::MethodNotSupported; - result = m_renderDevice->SetDIBits(&bmp, (int32_t)dstRect.left, - (int32_t)dstRect.top); - if (!result) - return FWL_Error::MethodNotSupported; - return FWL_Error::Succeeded; - } - return FWL_Error::PropertyInvalid; } CFX_RenderDevice* CFX_Graphics::GetRenderDevice() { return m_renderDevice; } -FWL_Error CFX_Graphics::InverseRect(const CFX_RectF& rect) { - if (!m_renderDevice) - return FWL_Error::PropertyInvalid; - CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); - if (!bitmap) - return FWL_Error::PropertyInvalid; - CFX_RectF temp(rect); - m_info.CTM.TransformRect(temp); - CFX_RectF r(0, 0, (FX_FLOAT)bitmap->GetWidth(), (FX_FLOAT)bitmap->GetWidth()); - r.Intersect(temp); - if (r.IsEmpty()) { - return FWL_Error::ParameterInvalid; - } - FX_ARGB* pBuf = - (FX_ARGB*)(bitmap->GetBuffer() + int32_t(r.top) * bitmap->GetPitch()); - int32_t bottom = (int32_t)r.bottom(); - int32_t right = (int32_t)r.right(); - for (int32_t i = (int32_t)r.top; i < bottom; i++) { - FX_ARGB* pLine = pBuf + (int32_t)r.left; - for (int32_t j = (int32_t)r.left; j < right; j++) { - FX_ARGB c = *pLine; - *pLine++ = (c & 0xFF000000) | (0xFFFFFF - (c & 0x00FFFFFF)); - } - pBuf = (FX_ARGB*)((uint8_t*)pBuf + bitmap->GetPitch()); - } - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::XorDIBitmap(const CFX_DIBitmap* srcBitmap, - const CFX_RectF& rect) { - if (!m_renderDevice) - return FWL_Error::PropertyInvalid; - CFX_DIBitmap* dst = m_renderDevice->GetBitmap(); - if (!dst) - return FWL_Error::PropertyInvalid; - CFX_RectF temp(rect); - m_info.CTM.TransformRect(temp); - CFX_RectF r(0, 0, (FX_FLOAT)dst->GetWidth(), (FX_FLOAT)dst->GetWidth()); - r.Intersect(temp); - if (r.IsEmpty()) { - return FWL_Error::ParameterInvalid; - } - FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + - int32_t(r.top) * srcBitmap->GetPitch()); - FX_ARGB* pDstBuf = - (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch()); - int32_t bottom = (int32_t)r.bottom(); - int32_t right = (int32_t)r.right(); - for (int32_t i = (int32_t)r.top; i < bottom; i++) { - FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left; - FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left; - for (int32_t j = (int32_t)r.left; j < right; j++) { - FX_ARGB c = *pDstLine; - *pDstLine++ = - ArgbEncode(FXARGB_A(c), (c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF)); - pSrcLine++; - } - pSrcBuf = (FX_ARGB*)((uint8_t*)pSrcBuf + srcBitmap->GetPitch()); - pDstBuf = (FX_ARGB*)((uint8_t*)pDstBuf + dst->GetPitch()); - } - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap* srcBitmap, - const CFX_RectF& rect) { - if (!m_renderDevice) - return FWL_Error::PropertyInvalid; - CFX_DIBitmap* dst = m_renderDevice->GetBitmap(); - if (!dst) - return FWL_Error::PropertyInvalid; - CFX_RectF temp(rect); - m_info.CTM.TransformRect(temp); - CFX_RectF r(0, 0, (FX_FLOAT)dst->GetWidth(), (FX_FLOAT)dst->GetWidth()); - r.Intersect(temp); - if (r.IsEmpty()) { - return FWL_Error::ParameterInvalid; - } - FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + - int32_t(r.top) * srcBitmap->GetPitch()); - FX_ARGB* pDstBuf = - (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch()); - int32_t bottom = (int32_t)r.bottom(); - int32_t right = (int32_t)r.right(); - for (int32_t i = (int32_t)r.top; i < bottom; i++) { - FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left; - FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left; - for (int32_t j = (int32_t)r.left; j < right; j++) { - FX_ARGB c = *pDstLine; - *pDstLine++ = - ArgbEncode(FXARGB_A(c), ~((c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF))); - pSrcLine++; - } - pSrcBuf = (FX_ARGB*)((uint8_t*)pSrcBuf + srcBitmap->GetPitch()); - pDstBuf = (FX_ARGB*)((uint8_t*)pDstBuf + dst->GetPitch()); - } - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) { +void CFX_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) { switch (dashStyle) { case FX_DASHSTYLE_Solid: { m_info.graphState.SetDashCount(0); - return FWL_Error::Succeeded; + return; } case FX_DASHSTYLE_Dash: { FX_FLOAT dashArray[] = {3, 1}; SetLineDash(0, dashArray, 2); - return FWL_Error::Succeeded; + return; } case FX_DASHSTYLE_Dot: { FX_FLOAT dashArray[] = {1, 1}; SetLineDash(0, dashArray, 2); - return FWL_Error::Succeeded; + return; } case FX_DASHSTYLE_DashDot: { FX_FLOAT dashArray[] = {3, 1, 1, 1}; SetLineDash(0, dashArray, 4); - return FWL_Error::Succeeded; + return; } case FX_DASHSTYLE_DashDotDot: { FX_FLOAT dashArray[] = {4, 1, 2, 1, 2, 1}; SetLineDash(0, dashArray, 6); - return FWL_Error::Succeeded; + return; } default: - return FWL_Error::ParameterInvalid; + return; } } -FWL_Error CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path, - CFX_Matrix* matrix) { +void CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix) { if (!m_info.strokeColor) - return FWL_Error::PropertyInvalid; + return; CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e, m_info.CTM.f); if (matrix) { @@ -1155,27 +282,20 @@ FWL_Error CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path, } switch (m_info.strokeColor->m_type) { case FX_COLOR_Solid: { - bool result = - m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, - 0x0, m_info.strokeColor->m_info.argb, 0); - if (!result) - return FWL_Error::Indefinite; - return FWL_Error::Succeeded; + m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, 0x0, + m_info.strokeColor->m_info.argb, 0); + return; } - case FX_COLOR_Pattern: - return StrokePathWithPattern(path, &m); - case FX_COLOR_Shading: - return StrokePathWithShading(path, &m); default: - return FWL_Error::PropertyInvalid; + return; } } -FWL_Error CFX_Graphics::RenderDeviceFillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { +void CFX_Graphics::RenderDeviceFillPath(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { if (!m_info.fillColor) - return FWL_Error::PropertyInvalid; + return; CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e, m_info.CTM.f); if (matrix) { @@ -1183,54 +303,24 @@ FWL_Error CFX_Graphics::RenderDeviceFillPath(CFX_Path* path, } switch (m_info.fillColor->m_type) { case FX_COLOR_Solid: { - bool result = m_renderDevice->DrawPath( - path->GetPathData(), &m, &m_info.graphState, - m_info.fillColor->m_info.argb, 0x0, fillMode); - if (!result) - return FWL_Error::Indefinite; - return FWL_Error::Succeeded; + m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, + m_info.fillColor->m_info.argb, 0x0, fillMode); + return; } case FX_COLOR_Pattern: - return FillPathWithPattern(path, fillMode, &m); + FillPathWithPattern(path, fillMode, &m); + return; case FX_COLOR_Shading: - return FillPathWithShading(path, fillMode, &m); + FillPathWithShading(path, fillMode, &m); + return; default: - return FWL_Error::PropertyInvalid; - } -} - -FWL_Error CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix) { - CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m1.Concat(*matrix); - } - CFX_Matrix m2((FX_FLOAT)source->GetWidth(), 0.0, 0.0, - (FX_FLOAT)source->GetHeight(), point.x, point.y); - m2.Concat(m1); - int32_t left, top; - std::unique_ptr<CFX_DIBitmap> bmp1 = source->FlipImage(false, true); - std::unique_ptr<CFX_DIBitmap> bmp2 = bmp1->TransformTo(&m2, left, top); - CFX_RectF r = GetClipRect(); - CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); - CFX_DIBitmap bmp; - if (bmp.Create(bitmap->GetWidth(), bitmap->GetHeight(), FXDIB_Argb) && - m_renderDevice->GetDIBits(&bmp, 0, 0) && - bmp.TransferBitmap(FXSYS_round(r.left), FXSYS_round(r.top), - FXSYS_round(r.Width()), FXSYS_round(r.Height()), - bmp2.get(), FXSYS_round(r.left - left), - FXSYS_round(r.top - top)) && - m_renderDevice->SetDIBits(&bmp, 0, 0)) { - return FWL_Error::Succeeded; + return; } - return FWL_Error::Indefinite; } -FWL_Error CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix) { +void CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, + CFX_Matrix* matrix) { CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e, m_info.CTM.f); if (matrix) { @@ -1247,52 +337,15 @@ FWL_Error CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source, std::unique_ptr<CFX_DIBitmap> bmp3 = bmp2->TransformTo(&m2, left, top); CFX_RectF r = GetClipRect(); CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); - if (bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), - FXSYS_round(r.Width()), FXSYS_round(r.Height()), - bmp3.get(), FXSYS_round(r.left - left), - FXSYS_round(r.top - top))) { - return FWL_Error::Succeeded; - } - return FWL_Error::Indefinite; -} - -FWL_Error CFX_Graphics::RenderDeviceShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix) { - int32_t length = text.GetLength(); - uint32_t* charCodes = FX_Alloc(uint32_t, length); - FXTEXT_CHARPOS* charPos = FX_Alloc(FXTEXT_CHARPOS, length); - CFX_RectF rect(point.x, point.y, 0, 0); - CalcTextInfo(text, charCodes, charPos, rect); - CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - m.Translate(0.0f, m_info.fontSize * m_info.fontHScale); - if (matrix) { - m.Concat(*matrix); - } - bool result = m_renderDevice->DrawNormalText( - length, charPos, m_info.font, -m_info.fontSize * m_info.fontHScale, &m, - m_info.fillColor->m_info.argb, FXTEXT_CLEARTYPE); - if (!result) - return FWL_Error::Indefinite; - FX_Free(charPos); - FX_Free(charCodes); - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::StrokePathWithPattern(CFX_Path* path, - CFX_Matrix* matrix) { - return FWL_Error::MethodNotSupported; + bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), + FXSYS_round(r.Width()), FXSYS_round(r.Height()), + bmp3.get(), FXSYS_round(r.left - left), + FXSYS_round(r.top - top)); } -FWL_Error CFX_Graphics::StrokePathWithShading(CFX_Path* path, - CFX_Matrix* matrix) { - return FWL_Error::MethodNotSupported; -} - -FWL_Error CFX_Graphics::FillPathWithPattern(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { +void CFX_Graphics::FillPathWithPattern(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { CFX_Pattern* pattern = m_info.fillColor->m_info.pattern; CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); int32_t width = bitmap->GetWidth(); @@ -1302,11 +355,8 @@ FWL_Error CFX_Graphics::FillPathWithPattern(CFX_Path* path, m_renderDevice->GetDIBits(&bmp, 0, 0); FX_HatchStyle hatchStyle = m_info.fillColor->m_info.pattern->m_hatchStyle; - if (hatchStyle < FX_HATCHSTYLE_Horizontal || - hatchStyle > FX_HATCHSTYLE_SolidDiamond) { - return FWL_Error::IntermediateValueInvalid; - } - const FX_HATCHDATA& data = hatchBitmapData[hatchStyle]; + const FX_HATCHDATA& data = hatchBitmapData[static_cast<int>(hatchStyle)]; + CFX_DIBitmap mask; mask.Create(data.width, data.height, FXDIB_1bppMask); FXSYS_memcpy(mask.GetBuffer(), data.maskBits, mask.GetPitch() * data.height); @@ -1330,12 +380,11 @@ FWL_Error CFX_Graphics::FillPathWithPattern(CFX_Path* path, m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); SetDIBitsWithMatrix(&bmp, &pattern->m_matrix); m_renderDevice->RestoreState(false); - return FWL_Error::Succeeded; } -FWL_Error CFX_Graphics::FillPathWithShading(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { +void CFX_Graphics::FillPathWithShading(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); int32_t width = bitmap->GetWidth(); int32_t height = bitmap->GetHeight(); @@ -1451,11 +500,10 @@ FWL_Error CFX_Graphics::FillPathWithShading(CFX_Path* path, SetDIBitsWithMatrix(&bmp, matrix); m_renderDevice->RestoreState(false); } - return result ? FWL_Error::Succeeded : FWL_Error::PropertyInvalid; } -FWL_Error CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source, - CFX_Matrix* matrix) { +void CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source, + CFX_Matrix* matrix) { if (matrix->IsIdentity()) { m_renderDevice->SetDIBits(source, 0, 0); } else { @@ -1468,87 +516,23 @@ FWL_Error CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source, std::unique_ptr<CFX_DIBitmap> bmp2 = bmp1->TransformTo(&m, left, top); m_renderDevice->SetDIBits(bmp2.get(), left, top); } - return FWL_Error::Succeeded; -} - -FWL_Error CFX_Graphics::CalcTextInfo(const CFX_WideString& text, - uint32_t* charCodes, - FXTEXT_CHARPOS* charPos, - CFX_RectF& rect) { - std::unique_ptr<CFX_UnicodeEncoding> encoding( - new CFX_UnicodeEncoding(m_info.font)); - int32_t length = text.GetLength(); - FX_FLOAT penX = (FX_FLOAT)rect.left; - FX_FLOAT penY = (FX_FLOAT)rect.top; - FX_FLOAT left = (FX_FLOAT)(0); - FX_FLOAT top = (FX_FLOAT)(0); - charCodes[0] = text.GetAt(0); - charPos[0].m_Origin = CFX_PointF(penX + left, penY + top); - charPos[0].m_GlyphIndex = encoding->GlyphFromCharCode(charCodes[0]); - charPos[0].m_FontCharWidth = FXSYS_round( - m_info.font->GetGlyphWidth(charPos[0].m_GlyphIndex) * m_info.fontHScale); - charPos[0].m_bGlyphAdjust = true; - charPos[0].m_AdjustMatrix[0] = -1; - charPos[0].m_AdjustMatrix[1] = 0; - charPos[0].m_AdjustMatrix[2] = 0; - charPos[0].m_AdjustMatrix[3] = 1; - penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * m_info.fontSize / 1000 + - m_info.fontSpacing; - for (int32_t i = 1; i < length; i++) { - charCodes[i] = text.GetAt(i); - charPos[i].m_Origin = CFX_PointF(penX + left, penY + top); - charPos[i].m_GlyphIndex = encoding->GlyphFromCharCode(charCodes[i]); - charPos[i].m_FontCharWidth = - FXSYS_round(m_info.font->GetGlyphWidth(charPos[i].m_GlyphIndex) * - m_info.fontHScale); - charPos[i].m_bGlyphAdjust = true; - charPos[i].m_AdjustMatrix[0] = -1; - charPos[i].m_AdjustMatrix[1] = 0; - charPos[i].m_AdjustMatrix[2] = 0; - charPos[i].m_AdjustMatrix[3] = 1; - penX += (FX_FLOAT)(charPos[i].m_FontCharWidth) * m_info.fontSize / 1000 + - m_info.fontSpacing; - } - rect.width = (FX_FLOAT)penX - rect.left; - rect.height = rect.top + m_info.fontSize * m_info.fontHScale - rect.top; - return FWL_Error::Succeeded; } CFX_Graphics::TInfo::TInfo() - : isAntialiasing(true), - strokeAlignment(FX_STROKEALIGNMENT_Center), - isActOnDash(false), - strokeColor(nullptr), - fillColor(nullptr), - font(nullptr), - fontSize(40.0), - fontHScale(1.0), - fontSpacing(0.0) {} + : isActOnDash(false), strokeColor(nullptr), fillColor(nullptr) {} CFX_Graphics::TInfo::TInfo(const TInfo& info) : graphState(info.graphState), - isAntialiasing(info.isAntialiasing), - strokeAlignment(info.strokeAlignment), CTM(info.CTM), isActOnDash(info.isActOnDash), strokeColor(info.strokeColor), - fillColor(info.fillColor), - font(info.font), - fontSize(info.fontSize), - fontHScale(info.fontHScale), - fontSpacing(info.fontSpacing) {} + fillColor(info.fillColor) {} CFX_Graphics::TInfo& CFX_Graphics::TInfo::operator=(const TInfo& other) { graphState.Copy(other.graphState); - isAntialiasing = other.isAntialiasing; - strokeAlignment = other.strokeAlignment; CTM = other.CTM; isActOnDash = other.isActOnDash; strokeColor = other.strokeColor; fillColor = other.fillColor; - font = other.font; - fontSize = other.fontSize; - fontHScale = other.fontHScale; - fontSpacing = other.fontSpacing; return *this; } diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h index ed219de967..c18f8eb4c9 100644 --- a/xfa/fxgraphics/cfx_graphics.h +++ b/xfa/fxgraphics/cfx_graphics.h @@ -16,13 +16,10 @@ #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/fx_dib.h" #include "core/fxge/fx_font.h" -#include "xfa/fwl/fwl_error.h" class CFX_Color; class CFX_Path; -class CAGG_Graphics; -using FX_DeviceCap = int32_t; using FX_FillMode = int32_t; enum FX_DashStyle { @@ -33,152 +30,44 @@ enum FX_DashStyle { FX_DASHSTYLE_DashDotDot = 4 }; -enum FX_StrokeAlignment { - FX_STROKEALIGNMENT_Center = 0, - FX_STROKEALIGNMENT_Inset = 1, - FX_STROKEALIGNMENT_Outset = 2, - FX_STROKEALIGNMENT_Left = 3, - FX_STROKEALIGNMENT_Right = 4 -}; - -enum FX_HatchStyle { - FX_HATCHSTYLE_Horizontal = 0, - FX_HATCHSTYLE_Vertical = 1, - FX_HATCHSTYLE_ForwardDiagonal = 2, - FX_HATCHSTYLE_BackwardDiagonal = 3, - FX_HATCHSTYLE_Cross = 4, - FX_HATCHSTYLE_DiagonalCross = 5, - FX_HATCHSTYLE_05Percent = 6, - FX_HATCHSTYLE_10Percent = 7, - FX_HATCHSTYLE_20Percent = 8, - FX_HATCHSTYLE_25Percent = 9, - FX_HATCHSTYLE_30Percent = 10, - FX_HATCHSTYLE_40Percent = 11, - FX_HATCHSTYLE_50Percent = 12, - FX_HATCHSTYLE_60Percent = 13, - FX_HATCHSTYLE_70Percent = 14, - FX_HATCHSTYLE_75Percent = 15, - FX_HATCHSTYLE_80Percent = 16, - FX_HATCHSTYLE_90Percent = 17, - FX_HATCHSTYLE_LightDownwardDiagonal = 18, - FX_HATCHSTYLE_LightUpwardDiagonal = 19, - FX_HATCHSTYLE_DarkDownwardDiagonal = 20, - FX_HATCHSTYLE_DarkUpwardDiagonal = 21, - FX_HATCHSTYLE_WideDownwardDiagonal = 22, - FX_HATCHSTYLE_WideUpwardDiagonal = 23, - FX_HATCHSTYLE_LightVertical = 24, - FX_HATCHSTYLE_LightHorizontal = 25, - FX_HATCHSTYLE_NarrowVertical = 26, - FX_HATCHSTYLE_NarrowHorizontal = 27, - FX_HATCHSTYLE_DarkVertical = 28, - FX_HATCHSTYLE_DarkHorizontal = 29, - FX_HATCHSTYLE_DashedDownwardDiagonal = 30, - FX_HATCHSTYLE_DashedUpwardDiagonal = 31, - FX_HATCHSTYLE_DashedHorizontal = 32, - FX_HATCHSTYLE_DashedVertical = 33, - FX_HATCHSTYLE_SmallConfetti = 34, - FX_HATCHSTYLE_LargeConfetti = 35, - FX_HATCHSTYLE_ZigZag = 36, - FX_HATCHSTYLE_Wave = 37, - FX_HATCHSTYLE_DiagonalBrick = 38, - FX_HATCHSTYLE_HorizontalBrick = 39, - FX_HATCHSTYLE_Weave = 40, - FX_HATCHSTYLE_Plaid = 41, - FX_HATCHSTYLE_Divot = 42, - FX_HATCHSTYLE_DottedGrid = 43, - FX_HATCHSTYLE_DottedDiamond = 44, - FX_HATCHSTYLE_Shingle = 45, - FX_HATCHSTYLE_Trellis = 46, - FX_HATCHSTYLE_Sphere = 47, - FX_HATCHSTYLE_SmallGrid = 48, - FX_HATCHSTYLE_SmallCheckerBoard = 49, - FX_HATCHSTYLE_LargeCheckerBoard = 50, - FX_HATCHSTYLE_OutlinedDiamond = 51, - FX_HATCHSTYLE_SolidDiamond = 52 +enum class FX_HatchStyle { + Horizontal = 0, + Vertical = 1, + ForwardDiagonal = 2, + BackwardDiagonal = 3, + Cross = 4, + DiagonalCross = 5 }; class CFX_RenderDevice; class CFX_Graphics { public: - CFX_Graphics(); - virtual ~CFX_Graphics(); - - FWL_Error Create(CFX_RenderDevice* renderDevice, bool isAntialiasing = true); - FWL_Error Create(int32_t width, - int32_t height, - FXDIB_Format format, - bool isNative = true, - bool isAntialiasing = true); - - FWL_Error GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal); - FWL_Error IsPrinterDevice(bool& isPrinter); - FWL_Error EnableAntialiasing(bool isAntialiasing); - - FWL_Error SaveGraphState(); - FWL_Error RestoreGraphState(); - - FWL_Error GetLineCap(CFX_GraphStateData::LineCap& lineCap) const; - FWL_Error GetDashCount(int32_t& dashCount) const; - FWL_Error GetLineDash(FX_FLOAT& dashPhase, FX_FLOAT* dashArray) const; - FWL_Error GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const; - FWL_Error GetMiterLimit(FX_FLOAT& miterLimit) const; - FWL_Error GetLineWidth(FX_FLOAT& lineWidth) const; - FWL_Error GetStrokeAlignment(FX_StrokeAlignment& strokeAlignment) const; + explicit CFX_Graphics(CFX_RenderDevice* renderDevice); + ~CFX_Graphics(); + + void SaveGraphState(); + void RestoreGraphState(); + CFX_RectF GetClipRect() const; CFX_Matrix* GetMatrix(); CFX_RenderDevice* GetRenderDevice(); - FWL_Error SetLineCap(CFX_GraphStateData::LineCap lineCap); - FWL_Error SetLineDash(FX_FLOAT dashPhase, - FX_FLOAT* dashArray, - int32_t dashCount); - FWL_Error SetLineDash(FX_DashStyle dashStyle); - FWL_Error SetLineJoin(CFX_GraphStateData::LineJoin lineJoin); - FWL_Error SetMiterLimit(FX_FLOAT miterLimit); - FWL_Error SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash = false); - FWL_Error SetStrokeAlignment(FX_StrokeAlignment strokeAlignment); - FWL_Error SetStrokeColor(CFX_Color* color); - FWL_Error SetFillColor(CFX_Color* color); - FWL_Error SetClipRect(const CFX_RectF& rect); - FWL_Error SetFont(CFX_Font* font); - FWL_Error SetFontSize(const FX_FLOAT size); - FWL_Error SetFontHScale(const FX_FLOAT scale); - FWL_Error SetCharSpacing(const FX_FLOAT spacing); - FWL_Error SetTextDrawingMode(const int32_t mode); - - FWL_Error StrokePath(CFX_Path* path, CFX_Matrix* matrix = nullptr); - FWL_Error FillPath(CFX_Path* path, - FX_FillMode fillMode = FXFILL_WINDING, - CFX_Matrix* matrix = nullptr); - FWL_Error ClipPath(CFX_Path* path, - FX_FillMode fillMode = FXFILL_WINDING, - CFX_Matrix* matrix = nullptr); - FWL_Error DrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix = nullptr); - FWL_Error StretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix = nullptr); - FWL_Error ConcatMatrix(const CFX_Matrix* matrix); - FWL_Error ClearClip(); - FWL_Error ShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix = nullptr); - void CalcTextRect(CFX_RectF& rect, - const CFX_WideString& text, - bool isMultiline = false, + void SetLineCap(CFX_GraphStateData::LineCap lineCap); + void SetLineDash(FX_FLOAT dashPhase, FX_FLOAT* dashArray, int32_t dashCount); + void SetLineDash(FX_DashStyle dashStyle); + void SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash = false); + void SetStrokeColor(CFX_Color* color); + void SetFillColor(CFX_Color* color); + void SetClipRect(const CFX_RectF& rect); + void StrokePath(CFX_Path* path, CFX_Matrix* matrix = nullptr); + void FillPath(CFX_Path* path, + FX_FillMode fillMode = FXFILL_WINDING, + CFX_Matrix* matrix = nullptr); + void StretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, CFX_Matrix* matrix = nullptr); - FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix); - FWL_Error Transfer(CFX_Graphics* graphics, - FX_FLOAT srcLeft, - FX_FLOAT srcTop, - const CFX_RectF& dstRect, - const CFX_Matrix* matrix); - - FWL_Error InverseRect(const CFX_RectF& rect); - FWL_Error XorDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); - FWL_Error EqvDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); + void ConcatMatrix(const CFX_Matrix* matrix); protected: int32_t m_type; @@ -190,53 +79,32 @@ class CFX_Graphics { TInfo& operator=(const TInfo& other); CFX_GraphStateData graphState; - bool isAntialiasing; - FX_StrokeAlignment strokeAlignment; CFX_Matrix CTM; bool isActOnDash; CFX_Color* strokeColor; CFX_Color* fillColor; - CFX_Font* font; - FX_FLOAT fontSize; - FX_FLOAT fontHScale; - FX_FLOAT fontSpacing; } m_info; - FWL_Error RenderDeviceSetLineDash(FX_DashStyle dashStyle); - FWL_Error RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix); - FWL_Error RenderDeviceFillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - FWL_Error RenderDeviceDrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix); - FWL_Error RenderDeviceStretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix); - FWL_Error RenderDeviceShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix); - - FWL_Error StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix); - FWL_Error StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix); - - FWL_Error FillPathWithPattern(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - FWL_Error FillPathWithShading(CFX_Path* path, - FX_FillMode fillMode, + void RenderDeviceSetLineDash(FX_DashStyle dashStyle); + void RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix); + void RenderDeviceFillPath(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + void RenderDeviceStretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, CFX_Matrix* matrix); - FWL_Error SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix); - FWL_Error CalcTextInfo(const CFX_WideString& text, - uint32_t* charCodes, - FXTEXT_CHARPOS* charPos, - CFX_RectF& rect); + void FillPathWithPattern(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + void FillPathWithShading(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + + void SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix); CFX_RenderDevice* m_renderDevice; std::vector<std::unique_ptr<TInfo>> m_infoStack; - std::unique_ptr<CAGG_Graphics> m_aggGraphics; - friend class CAGG_Graphics; }; #endif // XFA_FXGRAPHICS_CFX_GRAPHICS_H_ diff --git a/xfa/fxgraphics/cfx_pattern.cpp b/xfa/fxgraphics/cfx_pattern.cpp index 8293ba1748..a20ec24aa5 100644 --- a/xfa/fxgraphics/cfx_pattern.cpp +++ b/xfa/fxgraphics/cfx_pattern.cpp @@ -11,9 +11,6 @@ CFX_Pattern::CFX_Pattern(FX_HatchStyle hatchStyle, const FX_ARGB backArgb, CFX_Matrix* matrix) : m_hatchStyle(hatchStyle), m_foreArgb(foreArgb), m_backArgb(backArgb) { - ASSERT(m_hatchStyle >= FX_HATCHSTYLE_Horizontal && - m_hatchStyle <= FX_HATCHSTYLE_SolidDiamond); - if (matrix) m_matrix = *matrix; else |