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

Issue 1390913005: add applyFilter() to SkImage (Closed)

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

Description

add applyFilter() to SkImage Result: - clients can get a filtered version of an image without having to setup a temp drawing environment - for some cases, the process is more efficient even than (deprecated) drawSprite, since there is no need to draw/copy the result Impl: - made Proxy virtual so we don't need to have an existing device to use it This, in conjunction with LocalMatrixImageFilter, should allow us to simplify and optimize ApplyImageFilter() in cc/output/gl_renderer.cc BUG=skia: Committed: https://skia.googlesource.com/skia/+/88d064d0e481949184305c7b1d6b282dddffac39

Patch Set 1 #

Patch Set 2 : fix tests #

Patch Set 3 : more robust gm, fix bounds for non-snug case #

Patch Set 4 : can't use +[] trick on windows :( #

Total comments: 20

Patch Set 5 : appy comments #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : rebase to new effect factories, use stroke to show image bounds #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+326 lines, -20 lines) Patch
M gm/spritebitmap.cpp View 1 2 3 4 5 6 1 chunk +118 lines, -0 lines 0 comments Download
M include/core/SkDevice.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkImage.h View 1 2 3 4 1 chunk +22 lines, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 chunk +16 lines, -4 lines 0 comments Download
M src/core/SkCanvas.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrLayerHoister.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/image/SkImage.cpp View 1 2 3 4 1 chunk +75 lines, -0 lines 0 comments Download
M src/image/SkImage_Base.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M src/image/SkImage_Gpu.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M src/image/SkImage_Gpu.cpp View 1 2 3 4 5 6 3 chunks +68 lines, -2 lines 1 comment Download
M tests/ImageFilterTest.cpp View 1 2 3 4 5 6 7 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 40 (15 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/1
5 years, 2 months ago (2015-10-09 16:44:20 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/builds/3540) Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on ...
5 years, 2 months ago (2015-10-09 16:45:21 UTC) #4
reed1
with this, perhaps we can eliminate the need for drawSprite, and in the case of ...
5 years, 2 months ago (2015-10-09 16:45:44 UTC) #6
reed1
will write some tests for this, but the impl is ready for initial review.
5 years, 2 months ago (2015-10-09 20:08:37 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/20001
5 years, 2 months ago (2015-10-09 20:08:58 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-09 20:15:51 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/40001
5 years, 2 months ago (2015-10-12 16:03:04 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/3689)
5 years, 2 months ago (2015-10-12 16:05:42 UTC) #15
reed1
PTAL
5 years, 2 months ago (2015-10-12 16:06:33 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/60001
5 years, 2 months ago (2015-10-12 16:10:17 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/builds/3566) Build-Ubuntu-GCC-Mips-Debug-Android-Trybot on ...
5 years, 2 months ago (2015-10-12 16:11:14 UTC) #20
robertphillips
https://codereview.chromium.org/1390913005/diff/60001/gm/spritebitmap.cpp File gm/spritebitmap.cpp (right): https://codereview.chromium.org/1390913005/diff/60001/gm/spritebitmap.cpp#newcode125 gm/spritebitmap.cpp:125: SkPaint paint; sk_tool_utils::color_to_565 ? https://codereview.chromium.org/1390913005/diff/60001/gm/spritebitmap.cpp#newcode169 gm/spritebitmap.cpp:169: put "offset1.setZero();" on ...
5 years, 2 months ago (2015-10-12 16:43:33 UTC) #21
reed1
https://codereview.chromium.org/1390913005/diff/60001/include/core/SkImage.h File include/core/SkImage.h (right): https://codereview.chromium.org/1390913005/diff/60001/include/core/SkImage.h#newcode317 include/core/SkImage.h:317: * If the filter makes the result larger by ...
5 years, 2 months ago (2015-10-12 17:08:45 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/80001
5 years, 2 months ago (2015-10-12 17:53:51 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/3696)
5 years, 2 months ago (2015-10-12 17:56:37 UTC) #26
reed1
ptal https://codereview.chromium.org/1390913005/diff/60001/gm/spritebitmap.cpp File gm/spritebitmap.cpp (right): https://codereview.chromium.org/1390913005/diff/60001/gm/spritebitmap.cpp#newcode125 gm/spritebitmap.cpp:125: SkPaint paint; On 2015/10/12 16:43:32, robertphillips wrote: > ...
5 years, 2 months ago (2015-10-12 18:02:19 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/100001
5 years, 2 months ago (2015-10-12 18:02:38 UTC) #29
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
5 years, 2 months ago (2015-10-12 18:02:40 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390913005/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390913005/120001
5 years, 2 months ago (2015-10-12 18:22:53 UTC) #33
reed1
refreshed w/ tweak to gm
5 years, 2 months ago (2015-10-12 18:23:06 UTC) #34
robertphillips
lgtm https://codereview.chromium.org/1390913005/diff/100001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/1390913005/diff/100001/include/core/SkImageFilter.h#newcode117 include/core/SkImageFilter.h:117: bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImageFilter::Context&, ...
5 years, 2 months ago (2015-10-12 18:27:30 UTC) #35
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://skia.googlesource.com/skia/+/88d064d0e481949184305c7b1d6b282dddffac39
5 years, 2 months ago (2015-10-12 18:30:09 UTC) #36
reed1
https://codereview.chromium.org/1390913005/diff/100001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/1390913005/diff/100001/include/core/SkImageFilter.h#newcode117 include/core/SkImageFilter.h:117: bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImageFilter::Context&, On ...
5 years, 2 months ago (2015-10-12 18:43:28 UTC) #37
reed1
oops, landed before I could up load last set of tweaks. Will land on top ...
5 years, 2 months ago (2015-10-12 18:43:53 UTC) #38
Stephen White
5 years, 2 months ago (2015-10-14 19:22:23 UTC) #40
Message was sent while issue was closed.
https://codereview.chromium.org/1390913005/diff/120001/src/image/SkImage_Gpu.cpp
File src/image/SkImage_Gpu.cpp (right):

https://codereview.chromium.org/1390913005/diff/120001/src/image/SkImage_Gpu....
src/image/SkImage_Gpu.cpp:243: if (filter->filterImageGPU(&proxy, src, ctx,
&dst, offsetResult)) {
I'm not 100% certain, but I think if you call filter->filterImage() instead of
filterImageGPU() here, it should work for all cases, and you can remove the
canFilterImageGPU() check above. That'll give the proxy a chance at calling
filter->filterImageGPU() for you (via SkGpuDevice::filterImage()), and fall back
to the generic filter->filterImage() path if not.

Powered by Google App Engine
This is Rietveld 408576698