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

Issue 2195853002: SkRasterPipeline: new APIs for fusion (Closed)

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

Description

SkRasterPipeline: new APIs for fusion Most visibly this adds a macro SK_RASTER_STAGE that cuts down on the boilerplate of defining a raster pipeline stage function. Most interestingly, SK_RASTER_STAGE doesn't define a SkRasterPipeline::Fn, but rather a new type EasyFn. This function is always static and inlined, and the details of interacting with the SkRasterPipeline::Stage are taken care of for you: ctx is just passed as a void*, and st->next() is always called. All EasyFns have to do is take care of the meat of the work: update r,g,b, etc. and read and write from their context. The really neat new feature here is that you can either add EasyFns to a pipeline with the new append() functions, _or_ call them directly yourself. This lets you use the same set of pieces to build either a pipelined version of the function or a custom, fused version. The bench shows this off. On my desktop, the pipeline version of the bench takes about 25% more time to run than the fused one. The old approach to creating stages still works fine. I haven't updated SkXfermode.cpp or SkArithmeticMode.cpp because they seemed just as clear using Fn directly as they would have using EasyFn. If this looks okay to you I will rework the comments in SkRasterPipeline to explain SK_RASTER_STAGE and EasyFn a bit as I've done here in the CL description. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195853002 Committed: https://skia.googlesource.com/skia/+/fe2042e60fa7382461a45b1de0a02d345009f468

Patch Set 1 #

Patch Set 2 : simpler context #

Patch Set 3 : bench both ways #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -219 lines) Patch
M bench/SkRasterPipelineBench.cpp View 1 2 5 chunks +61 lines, -60 lines 0 comments Download
M src/core/SkRasterPipeline.h View 1 2 4 chunks +35 lines, -0 lines 0 comments Download
M src/core/SkRasterPipelineBlitter.cpp View 1 2 13 chunks +56 lines, -116 lines 0 comments Download
M tests/SkRasterPipelineTest.cpp View 1 3 chunks +28 lines, -43 lines 0 comments Download

Messages

Total messages: 19 (15 generated)
mtklein_C
4 years, 4 months ago (2016-07-29 21:01:24 UTC) #13
msarett
lgtm
4 years, 4 months ago (2016-07-29 21:13:06 UTC) #14
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/2195853002/40001
4 years, 4 months ago (2016-07-29 21:19:26 UTC) #17
commit-bot: I haz the power
4 years, 4 months ago (2016-07-29 21:27:44 UTC) #19
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/fe2042e60fa7382461a45b1de0a02d345009f468

Powered by Google App Engine
This is Rietveld 408576698