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

Issue 2064753002: add local caching for skia draws (Closed)

Created:
4 years, 6 months ago by caryclark
Modified:
4 years, 5 months ago
Reviewers:
Lei Zhang, 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

add local caching for skia draws PDFium assumes the lowest common denominator and draws many strings and paths that can be accumulated. Defer canvas->restore() calls until required because the clip changed. Defer text and path draws as long as subsequent calls concatenate additional data. Include debugging switch to allow disabling cache at compile-time while bugs are shaken out. Committed: https://pdfium.googlesource.com/pdfium/+/e89391e2cbec0788d39985df9c0967dd467cbfa8

Patch Set 1 #

Patch Set 2 : wip; puzzling through save restore logic #

Patch Set 3 : wip; working on unit test #

Patch Set 4 : wip; more unit tests #

Patch Set 5 : wip; more to do on flushing #

Patch Set 6 : wip; standardize unit test #

Patch Set 7 : wip; working unit tests #

Patch Set 8 : fix includes #

Patch Set 9 : fix text case #

Total comments: 21

Patch Set 10 : address comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+633 lines, -24 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M core/fxge/skia/DEPS View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 2 comments Download
M core/fxge/skia/fx_skia_device.h View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -0 lines 0 comments Download
M core/fxge/skia/fx_skia_device.cpp View 1 2 3 4 5 6 7 8 9 16 chunks +450 lines, -23 lines 0 comments Download
A core/fxge/skia/fx_skia_device_unittest.cpp View 1 2 3 4 5 6 7 1 chunk +164 lines, -0 lines 2 comments Download
M pdfium.gyp View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (8 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2064753002/140001
4 years, 5 months ago (2016-06-28 18:25:11 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-28 18:42:21 UTC) #6
caryclark
4 years, 5 months ago (2016-06-28 20:56:10 UTC) #8
caryclark
4 years, 5 months ago (2016-06-29 11:45:32 UTC) #9
dsinclair
https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp File core/fxge/skia/fx_skia_device.cpp (right): https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp#newcode482 core/fxge/skia/fx_skia_device.cpp:482: // they can be combined nit: . at end ...
4 years, 5 months ago (2016-06-29 13:22:28 UTC) #10
caryclark
https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp File core/fxge/skia/fx_skia_device.cpp (right): https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp#newcode482 core/fxge/skia/fx_skia_device.cpp:482: // they can be combined On 2016/06/29 13:22:28, dsinclair ...
4 years, 5 months ago (2016-06-29 13:55:11 UTC) #11
dsinclair
lgtm https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp File core/fxge/skia/fx_skia_device.cpp (right): https://codereview.chromium.org/2064753002/diff/160001/core/fxge/skia/fx_skia_device.cpp#newcode810 core/fxge/skia/fx_skia_device.cpp:810: if (!pState->m_DashArray && !refState.m_DashArray) On 2016/06/29 13:55:10, caryclark ...
4 years, 5 months ago (2016-06-29 13:58:35 UTC) #13
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/2064753002/180001
4 years, 5 months ago (2016-06-29 13:58:41 UTC) #14
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://pdfium.googlesource.com/pdfium/+/e89391e2cbec0788d39985df9c0967dd467cbfa8
4 years, 5 months ago (2016-06-29 14:10:55 UTC) #16
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-06-29 14:10:57 UTC) #17
Lei Zhang
https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/DEPS File core/fxge/skia/DEPS (right): https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/DEPS#newcode2 core/fxge/skia/DEPS:2: '+fpdfsdk/include', This is a layering violation. core/ should not ...
4 years, 5 months ago (2016-06-29 18:53:51 UTC) #19
caryclark
4 years, 5 months ago (2016-06-29 19:25:41 UTC) #20
Message was sent while issue was closed.
https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/DEPS
File core/fxge/skia/DEPS (right):

https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/DEPS#ne...
core/fxge/skia/DEPS:2: '+fpdfsdk/include',
On 2016/06/29 18:53:50, Lei Zhang wrote:
> This is a layering violation. core/ should not depend on fpdfsdk/ and public/.

Sounds good. If unit tests belong in core directories, how should they depend on
the includes they need to compile?

https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/fx_skia...
File core/fxge/skia/fx_skia_device_unittest.cpp (right):

https://codereview.chromium.org/2064753002/diff/180001/core/fxge/skia/fx_skia...
core/fxge/skia/fx_skia_device_unittest.cpp:114: FPDF_BITMAP bitmap =
FPDFBitmap_Create(w, h, 1);
On 2016/06/29 18:53:51, Lei Zhang wrote:
> Just create a CFX_DIBitmap instead? That's what you really want below anyway.

I copied the code construction used by pdfium_test to best emulate how the
tested routines are used. Feel free to edit it however you like.

Powered by Google App Engine
This is Rietveld 408576698