Simplify CFX_DIBitmap::ConvertColorScale() and ConvertBGRColorScale() [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
May 8, 2026, 3:52:42 PM (5 days ago) May 8
to Lei Zhang, Tom Sepez, pdfium...@luci-project-accounts.iam.gserviceaccount.com, pdfium-...@googlegroups.com
Attention needed from Tom Sepez

Lei Zhang added 1 comment

File core/fxge/dib/cfx_dibitmap.cpp
Line 484, Patchset 2 (Parent): if (forecolor == 0 && backcolor == 0xffffff) {
Lei Zhang . resolved

Strangely, this reduced down to the same code as the loop below, I think.

Open in Gerrit

Related details

Attention is currently required from:
  • Tom Sepez
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I29c8e813a600006cd96c28ced719a6340b345c9e
Gerrit-Change-Number: 147371
Gerrit-PatchSet: 2
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Comment-Date: Fri, 08 May 2026 19:52:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Sepez (Gerrit)

unread,
May 8, 2026, 4:03:45 PM (5 days ago) May 8
to Lei Zhang, pdfium...@luci-project-accounts.iam.gserviceaccount.com, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Tom Sepez voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I29c8e813a600006cd96c28ced719a6340b345c9e
Gerrit-Change-Number: 147371
Gerrit-PatchSet: 2
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Fri, 08 May 2026 20:02:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
May 8, 2026, 4:35:58 PM (5 days ago) May 8
to Lei Zhang, Tom Sepez, pdfium-...@googlegroups.com

pdfium...@luci-project-accounts.iam.gserviceaccount.com submitted the change

Change information

Commit message:
Simplify CFX_DIBitmap::ConvertColorScale() and ConvertBGRColorScale()

Since ConvertColorScale() callers only pass in white/black or
black/white, change its 2 color parameters to a single bool. Then
ConvertBGRColorScale() can simplify its calculations, since the RGB
channels are all the same, and the only possible foreground/background
difference is 255.
Change-Id: I29c8e813a600006cd96c28ced719a6340b345c9e
Reviewed-by: Tom Sepez <tse...@chromium.org>
Commit-Queue: Lei Zhang <the...@chromium.org>
Files:
  • M core/fpdfapi/render/cpdf_imagerenderer.cpp
  • M core/fpdfapi/render/cpdf_rendershading.cpp
  • M core/fpdfapi/render/cpdf_rendertiling.cpp
  • M core/fxge/dib/cfx_dibitmap.cpp
  • M core/fxge/dib/cfx_dibitmap.h
Change size: M
Delta: 5 files changed, 20 insertions(+), 38 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Tom Sepez
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I29c8e813a600006cd96c28ced719a6340b345c9e
Gerrit-Change-Number: 147371
Gerrit-PatchSet: 3
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages