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

Issue 2225393002: Optimized implementation of quickReject() (Closed)

Created:
4 years, 4 months ago by msarett
Modified:
4 years, 4 months ago
Reviewers:
herb_g, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Optimized implementation of quickReject() Impl Overview (1) Keep the device clip bounds up to date. This requires minimal additional work in a few places throughout canvas. (2) Keep track of if the ctm isScaleTranslate. Yes, there's a function that does this, but it's slow to call. (3) Perform the src->device transform in quick reject, then check intersection/nan. Other Notes: (1) NaN and intersection checks are performed simultaneously. (2) We no longer quick reject infinity. (3) Affine and perspective are both handled in the slow case. (4) SkRasterClip::isEmpty() is handled by the intersection check. Performance on Nexus 6P: 93.2ms -> 59.8ms Overall Android Jank Tests Performance Impact: Should gain us a ms or two on some tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002 Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da Committed: https://skia.googlesource.com/skia/+/fbfa25802709139c2f14e304319c9541da65ca27

Patch Set 1 #

Patch Set 2 : Fix SkCanvas::init() #

Patch Set 3 : Update the clip *after* changing the matrix/clip stack #

Patch Set 4 : Add null check #

Patch Set 5 : Include fwd transform in quickReject() #

Patch Set 6 : use float 4s #

Patch Set 7 : Cache fIsScaleTranslate and fDeviceClipBounds #

Patch Set 8 : Cleaning things up #

Total comments: 20

Patch Set 9 : Rebase on deletion of quickRejectY() #

Patch Set 10 : Response to comments #

Total comments: 2

Patch Set 11 : Adding test and Debug asserts #

Total comments: 2

Patch Set 12 : Fixed a bug and assert #

Patch Set 13 : Fix NX_NOSIMD and Chrome assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -48 lines) Patch
A bench/QuickRejectBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +61 lines, -0 lines 0 comments Download
M include/core/SkCanvas.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -14 lines 0 comments Download
M include/core/SkPostConfig.h View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -0 lines 0 comments Download
M src/core/SkCanvas.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 20 chunks +97 lines, -34 lines 0 comments Download
M tests/QuickRejectTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +38 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 48 (32 generated)
msarett
4 years, 4 months ago (2016-08-09 13:52:38 UTC) #3
msarett
Ahh this breaks everything... Stay tuned for bug fixes.
4 years, 4 months ago (2016-08-09 13:59:20 UTC) #4
msarett
Please take a look. I think this has evolved into something we could actually land. ...
4 years, 4 months ago (2016-08-10 22:43:16 UTC) #6
mtklein
I am a fan. https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp#newcode269 src/core/SkCanvas.cpp:269: static inline void set_qr_clip_bounds(SkRect* dst, ...
4 years, 4 months ago (2016-08-11 01:24:42 UTC) #11
mtklein
https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp#newcode1507 src/core/SkCanvas.cpp:1507: fIsScaleTranslate = fMCRec->fMatrix.isScaleTranslate(); On 2016/08/11 01:24:41, mtklein wrote: > ...
4 years, 4 months ago (2016-08-11 01:25:44 UTC) #12
msarett
https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.chromium.org/2225393002/diff/140001/src/core/SkCanvas.cpp#newcode269 src/core/SkCanvas.cpp:269: static inline void set_qr_clip_bounds(SkRect* dst, const SkIRect& src) { ...
4 years, 4 months ago (2016-08-11 16:04:01 UTC) #13
reed1
lgtm w/ request for assert and possibly find a way to more tightly associate changing ...
4 years, 4 months ago (2016-08-11 18:36:28 UTC) #14
msarett
Adding debug asserts to catch bugs if they exist (or pop up later). Also adding ...
4 years, 4 months ago (2016-08-11 20:15:16 UTC) #15
mtklein
https://codereview.chromium.org/2225393002/diff/200001/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.chromium.org/2225393002/diff/200001/src/core/SkCanvas.cpp#newcode1509 src/core/SkCanvas.cpp:1509: // independ of preConcat() may allow us to go ...
4 years, 4 months ago (2016-08-11 20:19:12 UTC) #18
msarett
Assert caught a bug...fixed. https://codereview.chromium.org/2225393002/diff/200001/src/core/SkCanvas.cpp File src/core/SkCanvas.cpp (right): https://codereview.chromium.org/2225393002/diff/200001/src/core/SkCanvas.cpp#newcode1509 src/core/SkCanvas.cpp:1509: // independ of preConcat() may ...
4 years, 4 months ago (2016-08-11 21:11:57 UTC) #23
mtklein
lgtm
4 years, 4 months ago (2016-08-11 21:33:58 UTC) #30
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/2225393002/260001
4 years, 4 months ago (2016-08-11 21:38:53 UTC) #35
commit-bot: I haz the power
Committed patchset #12 (id:260001) as https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da
4 years, 4 months ago (2016-08-11 21:40:08 UTC) #37
mtklein
A revert of this CL (patchset #12 id:260001) has been created in https://codereview.chromium.org/2231393003/ by mtklein@google.com. ...
4 years, 4 months ago (2016-08-12 09:22:25 UTC) #38
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/2225393002/280001
4 years, 4 months ago (2016-08-12 15:28:13 UTC) #46
commit-bot: I haz the power
4 years, 4 months ago (2016-08-12 15:29:12 UTC) #48
Message was sent while issue was closed.
Committed patchset #13 (id:280001) as
https://skia.googlesource.com/skia/+/fbfa25802709139c2f14e304319c9541da65ca27

Powered by Google App Engine
This is Rietveld 408576698