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

Side by Side Diff: core/fpdfapi/render/cpdf_renderstatus.cpp

Issue 2531643002: Add some methods in CPDF_ImageRenderer (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 "core/fpdfapi/render/cpdf_renderstatus.h" 7 #include "core/fpdfapi/render/cpdf_renderstatus.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 #endif 1051 #endif
1052 } 1052 }
1053 1053
1054 bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj, 1054 bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
1055 const CFX_Matrix* pObj2Device, 1055 const CFX_Matrix* pObj2Device,
1056 IFX_Pause* pPause) { 1056 IFX_Pause* pPause) {
1057 if (m_pImageRenderer) { 1057 if (m_pImageRenderer) {
1058 if (m_pImageRenderer->Continue(pPause)) 1058 if (m_pImageRenderer->Continue(pPause))
1059 return true; 1059 return true;
1060 1060
1061 if (!m_pImageRenderer->m_Result) 1061 if (!m_pImageRenderer->GetResult())
1062 DrawObjWithBackground(pObj, pObj2Device); 1062 DrawObjWithBackground(pObj, pObj2Device);
1063 m_pImageRenderer.reset(); 1063 m_pImageRenderer.reset();
1064 return false; 1064 return false;
1065 } 1065 }
1066 1066
1067 m_pCurObj = pObj; 1067 m_pCurObj = pObj;
1068 if (m_Options.m_pOCContext && pObj->m_ContentMark && 1068 if (m_Options.m_pOCContext && pObj->m_ContentMark &&
1069 !m_Options.m_pOCContext->CheckObjectVisible(pObj)) { 1069 !m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
1070 return false; 1070 return false;
1071 } 1071 }
1072 1072
1073 ProcessClipPath(pObj->m_ClipPath, pObj2Device); 1073 ProcessClipPath(pObj->m_ClipPath, pObj2Device);
1074 if (ProcessTransparency(pObj, pObj2Device)) 1074 if (ProcessTransparency(pObj, pObj2Device))
1075 return false; 1075 return false;
1076 1076
1077 if (pObj->IsImage()) { 1077 if (pObj->IsImage()) {
1078 m_pImageRenderer.reset(new CPDF_ImageRenderer); 1078 m_pImageRenderer.reset(new CPDF_ImageRenderer);
1079 if (!m_pImageRenderer->Start(this, pObj, pObj2Device, false, 1079 if (!m_pImageRenderer->Start(this, pObj, pObj2Device, false,
1080 FXDIB_BLEND_NORMAL)) { 1080 FXDIB_BLEND_NORMAL)) {
1081 if (!m_pImageRenderer->m_Result) 1081 if (!m_pImageRenderer->GetResult())
1082 DrawObjWithBackground(pObj, pObj2Device); 1082 DrawObjWithBackground(pObj, pObj2Device);
1083 m_pImageRenderer.reset(); 1083 m_pImageRenderer.reset();
1084 return false; 1084 return false;
1085 } 1085 }
1086 return ContinueSingleObject(pObj, pObj2Device, pPause); 1086 return ContinueSingleObject(pObj, pObj2Device, pPause);
1087 } 1087 }
1088 1088
1089 ProcessObjectNoClip(pObj, pObj2Device); 1089 ProcessObjectNoClip(pObj, pObj2Device);
1090 return false; 1090 return false;
1091 } 1091 }
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 glyphs[iChar].m_OriginY = origin_y; 1893 glyphs[iChar].m_OriginY = origin_y;
1894 } 1894 }
1895 } else { 1895 } else {
1896 CFX_Matrix image_matrix = pType3Char->m_ImageMatrix; 1896 CFX_Matrix image_matrix = pType3Char->m_ImageMatrix;
1897 image_matrix.Concat(matrix); 1897 image_matrix.Concat(matrix);
1898 CPDF_ImageRenderer renderer; 1898 CPDF_ImageRenderer renderer;
1899 if (renderer.Start(this, pType3Char->m_pBitmap.get(), fill_argb, 255, 1899 if (renderer.Start(this, pType3Char->m_pBitmap.get(), fill_argb, 255,
1900 &image_matrix, 0, false, FXDIB_BLEND_NORMAL)) { 1900 &image_matrix, 0, false, FXDIB_BLEND_NORMAL)) {
1901 renderer.Continue(nullptr); 1901 renderer.Continue(nullptr);
1902 } 1902 }
1903 if (!renderer.m_Result) 1903 if (!renderer.GetResult())
1904 return false; 1904 return false;
1905 } 1905 }
1906 } 1906 }
1907 } 1907 }
1908 1908
1909 if (glyphs.empty()) 1909 if (glyphs.empty())
1910 return true; 1910 return true;
1911 1911
1912 FX_RECT rect = FXGE_GetGlyphsBBox(glyphs, 0, sa, sd); 1912 FX_RECT rect = FXGE_GetGlyphsBBox(glyphs, 0, sa, sd);
1913 CFX_DIBitmap bitmap; 1913 CFX_DIBitmap bitmap;
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 if (StrokeColor.IsPattern()) { 2368 if (StrokeColor.IsPattern()) {
2369 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true); 2369 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true);
2370 bStroke = false; 2370 bStroke = false;
2371 } 2371 }
2372 } 2372 }
2373 } 2373 }
2374 2374
2375 bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, 2375 bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj,
2376 const CFX_Matrix* pObj2Device) { 2376 const CFX_Matrix* pObj2Device) {
2377 CPDF_ImageRenderer render; 2377 CPDF_ImageRenderer render;
2378 if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) { 2378 if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
Tom Sepez 2016/11/28 18:42:53 nit: no {}
npm 2016/11/28 20:51:30 Done.
2379 render.Continue(nullptr); 2379 render.Continue(nullptr);
2380 } 2380 }
2381 return render.m_Result; 2381 return render.GetResult();
2382 } 2382 }
2383 2383
2384 void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, 2384 void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
2385 int left, 2385 int left,
2386 int top, 2386 int top,
2387 FX_ARGB mask_argb, 2387 FX_ARGB mask_argb,
2388 int bitmap_alpha, 2388 int bitmap_alpha,
2389 int blend_mode, 2389 int blend_mode,
2390 int Transparency) { 2390 int Transparency) {
2391 if (!pDIBitmap) { 2391 if (!pDIBitmap) {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2629 } else if (pFunc) { 2629 } else if (pFunc) {
2630 int size = dest_pitch * height; 2630 int size = dest_pitch * height;
2631 for (int i = 0; i < size; i++) { 2631 for (int i = 0; i < size; i++) {
2632 dest_buf[i] = transfers[src_buf[i]]; 2632 dest_buf[i] = transfers[src_buf[i]];
2633 } 2633 }
2634 } else { 2634 } else {
2635 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); 2635 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
2636 } 2636 }
2637 return pMask; 2637 return pMask;
2638 } 2638 }
OLDNEW
« core/fpdfapi/render/cpdf_imagerenderer.cpp ('K') | « core/fpdfapi/render/cpdf_imagerenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698