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

Issue 2182763002: add native draw bitmap with alpha mask (Closed)

Created:
4 years, 4 months ago by caryclark
Modified:
4 years, 4 months ago
Reviewers:
dsinclair, herb1, 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

add native draw bitmap with alpha mask PDFs draw bitmaps with alpha by supplying an image alpha mask along side the image color data. The alpha mask may not be the same scale as the image data. Skia doesn't have a direct mapping for this draw call, but can come close by using the internal SkCompositeShader class. This scales the alpha mask to match the size of the image data, then puts both in the composite shader to draw. There are more things to do: - Allow Alpha8 or Gray8 to draw scaled to a matching device (blit doesn't work today) Temporary code marked with a TODO implements this functionality. - Refactor PDFium to allow SkComposeShader's components to take a matrix. The latter goal will defer drawing so that PDFium doesn't resize the mask, discarding resolution, before Skia has a chance to record it. Additionally fix drawing text with a negative font size. R=reed@google.com,dsinclair@chromium.org,herb@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/c4f3c0f183c9ce472cd22e831075c3897e14c3af

Patch Set 1 #

Patch Set 2 : wip; working on composer shader #

Patch Set 3 : skip premul step on mask #

Patch Set 4 : wip; hack in a alpha-8 point sampler #

Patch Set 5 : negative font size means negate everything #

Patch Set 6 : fix upside down text #

Patch Set 7 : adapt new virtuals #

Total comments: 6

Patch Set 8 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+289 lines, -83 lines) Patch
M core/fpdfapi/fpdf_render/fpdf_render_image.cpp View 1 2 3 4 5 6 7 5 chunks +18 lines, -4 lines 0 comments Download
M core/fxge/ge/cfx_renderdevice.cpp View 1 2 3 4 5 6 1 chunk +10 lines, -1 line 0 comments Download
M core/fxge/ifx_renderdevicedriver.cpp View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M core/fxge/include/cfx_fxgedevice.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M core/fxge/include/cfx_renderdevice.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M core/fxge/include/ifx_renderdevicedriver.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M core/fxge/skia/fx_skia_device.h View 1 2 3 4 5 6 3 chunks +13 lines, -0 lines 0 comments Download
M core/fxge/skia/fx_skia_device.cpp View 1 2 3 4 5 6 7 10 chunks +220 lines, -78 lines 0 comments Download

Messages

Total messages: 22 (14 generated)
caryclark
(not ready for checking -- publishing so stakeholders can help me eliminate dependencies)
4 years, 4 months ago (2016-08-11 18:58:24 UTC) #5
reed1
each shader can be built with a local-matrix, so when you build a composeshader, each ...
4 years, 4 months ago (2016-08-12 11:35:45 UTC) #7
caryclark
Ready for review
4 years, 4 months ago (2016-08-12 18:26:18 UTC) #11
dsinclair
code lgtm w/ nits. one of the Skia folks will need to verify the graphics ...
4 years, 4 months ago (2016-08-15 13:33:30 UTC) #15
reed1
lgtm
4 years, 4 months ago (2016-08-15 15:50:34 UTC) #16
caryclark
https://codereview.chromium.org/2182763002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render_image.cpp File core/fpdfapi/fpdf_render/fpdf_render_image.cpp (right): https://codereview.chromium.org/2182763002/diff/120001/core/fpdfapi/fpdf_render/fpdf_render_image.cpp#newcode757 core/fpdfapi/fpdf_render/fpdf_render_image.cpp:757: #endif On 2016/08/15 13:33:30, dsinclair wrote: > nit: #endif ...
4 years, 4 months ago (2016-08-15 16:55:04 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2182763002/140001
4 years, 4 months ago (2016-08-15 16:55:21 UTC) #20
commit-bot: I haz the power
4 years, 4 months ago (2016-08-15 17:09:53 UTC) #22
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://pdfium.googlesource.com/pdfium/+/c4f3c0f183c9ce472cd22e831075c3897e14...

Powered by Google App Engine
This is Rietveld 408576698