Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: core/src/fxge/ge/fx_ge_device.cpp

Issue 402463002: Replace agg with skia (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix clang compile error Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/apple/fx_quartz_device.cpp ('k') | core/src/fxge/ge/fx_ge_linux.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_device.cpp
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index 9c268b5606d62c244e59fef0483dadaa7e113a78..edf9391f35e0c55fc0d2af2bb7bd5f6b2677ea6c 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -5,6 +5,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../../include/fxge/fx_ge.h"
+#include "../skia/fx_skia_driver.h"
+
CFX_RenderDevice::CFX_RenderDevice()
{
m_pDeviceDriver = NULL;
@@ -403,3 +405,47 @@ void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle)
{
m_pDeviceDriver->CancelDIBits(handle);
}
+
+
+CFX_FxgeDevice::CFX_FxgeDevice()
+{
+ m_bOwnedBitmap = FALSE;
+}
+FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
+{
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ SetBitmap(pBitmap);
+ CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
+ if (!pDriver) {
+ return FALSE;
+ }
+ SetDeviceDriver(pDriver);
+ return TRUE;
+}
+FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+{
+ m_bOwnedBitmap = TRUE;
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ if (!pBitmap) {
+ return FALSE;
+ }
+ if (!pBitmap->Create(width, height, format)) {
+ delete pBitmap;
+ return FALSE;
+ }
+ SetBitmap(pBitmap);
+ CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
+ if (!pDriver) {
+ return FALSE;
+ }
+ SetDeviceDriver(pDriver);
+ return TRUE;
+}
+CFX_FxgeDevice::~CFX_FxgeDevice()
+{
+ if (m_bOwnedBitmap && GetBitmap()) {
+ delete GetBitmap();
+ }
+}
« no previous file with comments | « core/src/fxge/apple/fx_quartz_device.cpp ('k') | core/src/fxge/ge/fx_ge_linux.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698