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

Issue 2025043002: remove some calls to dib (Closed)

Created:
4 years, 6 months ago by caryclark
Modified:
4 years, 6 months ago
Reviewers:
dsinclair, reed1
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

The PDFium source in core/fxge/dib implements a bit-blitting backend. This code has several disadvantages over a more modern graphics engine: - no SIMD support - no GPU support - limited quality Further, calling this code locks in the perceived resolution, so that the output cannot be scaled without additional loss. By directing all bitmap drawing through CFX_SkiaDeviceDriver::StartDIBits, Skia can handle all appropriate bitmap optimizations. To that end, SetDIBits and StretchDIBits now call StartDIBits. Other changes: Skia's bitmaps are premultiplied. PDF contains bitmaps that are unpremultiplied. PDFium appears to use premultiplied bitmaps sometimes, and unpremultiplied bitmaps elsewhere. Add a debug check for unpremultiplied bits in Skia's driver, and add a utility to premultiply PDFium's bitmaps' bits. PDFium supports a 24 bit RGB bitmap padded to a 32 bit word. Set the high byte so that Skia can treat this as an ARGB bitmap. Defer the application of the alpha value to the draw call rather than calling MultiplyAlpha where possible. Allow the destination bitmap to be alpha 8 or argb 32. Committed: https://pdfium.googlesource.com/pdfium/+/36e258b475702bdb1a95a88fcebd78b51069c532

Patch Set 1 #

Patch Set 2 : fix unpremultiplied bitmaps #

Patch Set 3 : set alpha type #

Patch Set 4 : premultiply blends #

Patch Set 5 : update create typeface #

Patch Set 6 : use readpixels instead of pixel swizzle #

Patch Set 7 : revert sktypeface interface change #

Total comments: 6

Patch Set 8 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -51 lines) Patch
M core/fpdfapi/fpdf_render/fpdf_render.cpp View 1 2 3 4 5 6 7 1 chunk +7 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_render/fpdf_render_image.cpp View 1 2 3 2 chunks +11 lines, -0 lines 0 comments Download
M core/fxge/dib/fx_dib_main.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M core/fxge/include/fx_ge.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M core/fxge/skia/fx_skia_device.h View 1 2 3 2 chunks +7 lines, -2 lines 0 comments Download
M core/fxge/skia/fx_skia_device.cpp View 1 2 3 4 5 6 7 9 chunks +97 lines, -47 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
caryclark
4 years, 6 months ago (2016-06-02 15:15:20 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2025043002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2025043002/120001
4 years, 6 months ago (2016-06-02 15:16:01 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-02 15:27:11 UTC) #9
dsinclair
lgtm w/ nits. https://codereview.chromium.org/2025043002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render.cpp File core/fpdfapi/fpdf_render/fpdf_render.cpp (right): https://codereview.chromium.org/2025043002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render.cpp#newcode818 core/fpdfapi/fpdf_render/fpdf_render.cpp:818: int blitAlpha = 255; int32_t? https://codereview.chromium.org/2025043002/diff/120001/core/fxge/skia/fx_skia_device.cpp ...
4 years, 6 months ago (2016-06-02 15:37:30 UTC) #10
caryclark
https://codereview.chromium.org/2025043002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render.cpp File core/fpdfapi/fpdf_render/fpdf_render.cpp (right): https://codereview.chromium.org/2025043002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render.cpp#newcode818 core/fpdfapi/fpdf_render/fpdf_render.cpp:818: int blitAlpha = 255; On 2016/06/02 15:37:30, dsinclair wrote: ...
4 years, 6 months ago (2016-06-02 15:47:43 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2025043002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2025043002/140001
4 years, 6 months ago (2016-06-02 15:48:03 UTC) #14
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 15:59:25 UTC) #16
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://pdfium.googlesource.com/pdfium/+/36e258b475702bdb1a95a88fcebd78b51069...

Powered by Google App Engine
This is Rietveld 408576698