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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render.cpp

Issue 1745683002: Fixup FX_RECT and FX_SMALL_RECT classes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, Dan's comments Created 4 years, 10 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
Index: core/src/fpdfapi/fpdf_render/fpdf_render.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index a470e94b869548092b5a0be57bbb16e4e155c478..4c7abea30c0019c6fcbaf101dde4693ff771be64 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -240,7 +240,7 @@ FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
void CPDF_RenderStatus::RenderObjectList(
const CPDF_PageObjectHolder* pObjectHolder,
const CFX_Matrix* pObj2Device) {
- CFX_FloatRect clip_rect = m_pDevice->GetClipBox();
+ CFX_FloatRect clip_rect(m_pDevice->GetClipBox());
CFX_Matrix device2object;
device2object.SetReverse(*pObj2Device);
device2object.TransformRect(clip_rect);
@@ -1059,7 +1059,7 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause) {
m_pContext, m_pDevice, NULL, NULL, NULL, NULL, m_pOptions,
m_pCurrentLayer->m_pObjectHolder->m_Transparency, FALSE, NULL);
m_pDevice->SaveState();
- m_ClipRect = m_pDevice->GetClipBox();
+ m_ClipRect = CFX_FloatRect(m_pDevice->GetClipBox());
CFX_Matrix device2object;
device2object.SetReverse(m_pCurrentLayer->m_Matrix);
device2object.TransformRect(m_ClipRect);
@@ -1295,18 +1295,16 @@ FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext,
dibFormat = FXDIB_Argb;
bpp = 32;
}
- CFX_FloatRect rect;
- int32_t iWidth, iHeight, iPitch;
while (1) {
- rect = pRect;
+ CFX_FloatRect rect(pRect);
m_Matrix.TransformRect(rect);
FX_RECT bitmap_rect = rect.GetOutterRect();
- iWidth = bitmap_rect.Width();
- iHeight = bitmap_rect.Height();
- iPitch = (iWidth * bpp + 31) / 32 * 4;
- if (iWidth * iHeight < 1) {
+ int32_t iWidth = bitmap_rect.Width();
+ int32_t iHeight = bitmap_rect.Height();
+ int32_t iPitch = (iWidth * bpp + 31) / 32 * 4;
+ if (iWidth * iHeight < 1)
return FALSE;
- }
+
if (iPitch * iHeight <= _FPDFAPI_IMAGESIZE_LIMIT_ &&
m_pBitmapDevice->Create(iWidth, iHeight, dibFormat)) {
break;

Powered by Google App Engine
This is Rietveld 408576698