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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../skia/fx_skia_driver.h"
9
8 CFX_RenderDevice::CFX_RenderDevice() 10 CFX_RenderDevice::CFX_RenderDevice()
9 { 11 {
10 m_pDeviceDriver = NULL; 12 m_pDeviceDriver = NULL;
11 m_pBitmap = NULL; 13 m_pBitmap = NULL;
12 } 14 }
13 CFX_RenderDevice::~CFX_RenderDevice() 15 CFX_RenderDevice::~CFX_RenderDevice()
14 { 16 {
15 if (m_pDeviceDriver) { 17 if (m_pDeviceDriver) {
16 delete m_pDeviceDriver; 18 delete m_pDeviceDriver;
17 } 19 }
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, fl ags, handle, alpha_flag, pIccTransform, blend_mode); 398 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, fl ags, handle, alpha_flag, pIccTransform, blend_mode);
397 } 399 }
398 FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause) 400 FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
399 { 401 {
400 return m_pDeviceDriver->ContinueDIBits(handle, pPause); 402 return m_pDeviceDriver->ContinueDIBits(handle, pPause);
401 } 403 }
402 void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle) 404 void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle)
403 { 405 {
404 m_pDeviceDriver->CancelDIBits(handle); 406 m_pDeviceDriver->CancelDIBits(handle);
405 } 407 }
408
409
410 CFX_FxgeDevice::CFX_FxgeDevice()
411 {
412 m_bOwnedBitmap = FALSE;
413 }
414 FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL b RgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
415 {
416 if (pBitmap == NULL) {
417 return FALSE;
418 }
419 SetBitmap(pBitmap);
420 CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, bRgbBy teOrder, pOriDevice, bGroupKnockout);
421 if (!pDriver) {
422 return FALSE;
423 }
424 SetDeviceDriver(pDriver);
425 return TRUE;
426 }
427 FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int d ither_bits, CFX_DIBitmap* pOriDevice)
428 {
429 m_bOwnedBitmap = TRUE;
430 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
431 if (!pBitmap) {
432 return FALSE;
433 }
434 if (!pBitmap->Create(width, height, format)) {
435 delete pBitmap;
436 return FALSE;
437 }
438 SetBitmap(pBitmap);
439 CFX_SkiaDriver* pDriver = FX_NEW CFX_SkiaDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
440 if (!pDriver) {
441 return FALSE;
442 }
443 SetDeviceDriver(pDriver);
444 return TRUE;
445 }
446 CFX_FxgeDevice::~CFX_FxgeDevice()
447 {
448 if (m_bOwnedBitmap && GetBitmap()) {
449 delete GetBitmap();
450 }
451 }
OLDNEW
« 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