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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_type3char.cpp

Issue 1824033002: Split core/include/fpdfapi/fpdf_resource.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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/fpdfapi/fpdf_font/cpdf_type3char.h ('k') | core/fpdfapi/fpdf_font/cpdf_type3font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_type3char.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3char.cpp b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c9d44435a3e1c7b641393573cc6d172b56527440
--- /dev/null
+++ b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp
@@ -0,0 +1,43 @@
+// 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 "core/fpdfapi/fpdf_font/cpdf_type3char.h"
+
+#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_image.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h"
+#include "core/include/fxge/fx_dib.h"
+
+CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm)
+ : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {}
+
+CPDF_Type3Char::~CPDF_Type3Char() {
+ delete m_pForm;
+ delete m_pBitmap;
+}
+
+FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) {
+ if (m_pBitmap || !m_pForm) {
+ return TRUE;
+ }
+ if (m_pForm->GetPageObjectList()->size() == 1 && !m_bColored) {
+ auto& pPageObj = m_pForm->GetPageObjectList()->front();
+ if (pPageObj->IsImage()) {
+ m_ImageMatrix = pPageObj->AsImage()->m_Matrix;
+ const CFX_DIBSource* pSource =
+ pPageObj->AsImage()->m_pImage->LoadDIBSource();
+ if (pSource) {
+ m_pBitmap = pSource->Clone();
+ delete pSource;
+ }
+ delete m_pForm;
+ m_pForm = NULL;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_type3char.h ('k') | core/fpdfapi/fpdf_font/cpdf_type3font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698