summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorcaryclark <caryclark@google.com>2016-05-13 10:57:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-13 10:57:20 -0700
commitd6e18875ce024a341e221db689cedf10d433be8d (patch)
treeb04343fd19f155c6606322dc39813840b07f107e /fpdfsdk
parent594b20b485046c954b68734e63e8d2c93fbe4ef5 (diff)
downloadpdfium-d6e18875ce024a341e221db689cedf10d433be8d.tar.xz
allow Skia to be the default graphics engine
PDFium uses fxge to denote the graphics engine used for general rendering. When pdf_use_skia=1 is set, use Skia as the default engine instead of antigrain. R=tsepez@chromium.org,dsinclair@chromium.org Review-Url: https://codereview.chromium.org/1975143002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_progressive.cpp9
-rw-r--r--fpdfsdk/fpdfformfill.cpp4
-rw-r--r--fpdfsdk/fpdfview.cpp21
3 files changed, 2 insertions, 32 deletions
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 1450f8e74b..d42d954bb9 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -41,21 +41,12 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
CRenderContext* pContext = new CRenderContext;
pPage->SetPrivateData((void*)1, pContext, DropContext);
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = new CFX_SkiaDevice;
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)
- ->Attach((CFX_DIBitmap*)bitmap, 0, TRUE);
- else
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
((CFX_FxgeDevice*)pContext->m_pDevice)
->Attach((CFX_DIBitmap*)bitmap, 0, TRUE);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#endif
IFSDK_PAUSE_Adapter IPauseAdapter(pause);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 9f4e2944ca..153c1057a5 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -342,11 +342,9 @@ static void FFLCommon(FPDF_FORMHANDLE hHandle,
FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y);
+ std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
#ifdef _SKIA_SUPPORT_
- std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice());
pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder));
-#else
- std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
#endif
pDevice->Attach((CFX_DIBitmap*)bitmap);
pDevice->SaveState();
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 405d8dc749..020ff8df6d 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -549,13 +549,8 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
pBitmap = new CFX_DIBitmap;
pBitmap->Create(size_x, size_y, FXDIB_Argb);
pBitmap->Clear(0x00ffffff);
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = new CFX_SkiaDevice;
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
-#else
pContext->m_pDevice = new CFX_FxgeDevice;
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
-#endif
} else {
pContext->m_pDevice = new CFX_WindowsDevice(dc);
}
@@ -648,15 +643,6 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
return;
CRenderContext* pContext = new CRenderContext;
pPage->SetPrivateData((void*)1, pContext, DropContext);
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = new CFX_SkiaDevice();
-
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)
- ->Attach((CFX_DIBitmap*)bitmap, 0, TRUE);
- else
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
@@ -664,7 +650,6 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
->Attach((CFX_DIBitmap*)bitmap, 0, TRUE);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#endif
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
rotate, flags, TRUE, NULL);
@@ -682,7 +667,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page,
return nullptr;
std::unique_ptr<CRenderContext> pContext(new CRenderContext);
pPage->SetPrivateData((void*)1, pContext.get(), DropContext);
- CFX_SkiaDevice* skDevice = new CFX_SkiaDevice();
+ CFX_FxgeDevice* skDevice = new CFX_FxgeDevice;
FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y);
pContext->m_pDevice = skDevice;
@@ -835,11 +820,7 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
FPDF_DWORD color) {
if (!bitmap)
return;
-#ifdef _SKIA_SUPPORT_
- CFX_SkiaDevice device;
-#else
CFX_FxgeDevice device;
-#endif
device.Attach((CFX_DIBitmap*)bitmap);
if (!((CFX_DIBitmap*)bitmap)->HasAlpha())
color |= 0xFF000000;