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

Issue 1992283002: Add drawBitmapLattice() API (Closed)

Created:
4 years, 7 months ago by msarett
Modified:
4 years, 4 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 drawImageLattice() and drawBitmapLattice() APIs The specified image/bitmap is divided into rects, which can be draw stretched, shrunk, or at a fixed size. Will be used by Android to draw 9patch (which are acutally N-patch) images. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1992283002 Committed: https://skia.googlesource.com/skia/+/c573a40ed5024b463e47088d307e3164a486dba5

Patch Set 1 #

Patch Set 2 : NinePatchDivs struct #

Total comments: 4

Patch Set 3 : Added software implementation #

Patch Set 4 : Minus bench of code that lives in Android #

Patch Set 5 : Rebase #

Patch Set 6 : Add implementation for SkRecorder and SkPictureRecord #

Total comments: 6

Patch Set 7 : Rebase #

Patch Set 8 : drawImageLattice and drawBitmapLattice #

Patch Set 9 : SkLatticeIter #

Patch Set 10 : Rebase #

Patch Set 11 : Add implementation for SkPDFCanvas #

Patch Set 12 : Rewrite picture impls #

Unified diffs Side-by-side diffs Delta from patch set Stats (+688 lines, -131 lines) Patch
A bench/DrawLatticeBench.cpp View 1 2 3 4 5 6 7 1 chunk +59 lines, -0 lines 0 comments Download
A gm/lattice.cpp View 1 2 3 4 5 6 7 1 chunk +147 lines, -0 lines 0 comments Download
M gyp/core.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkCanvas.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +44 lines, -1 line 0 comments Download
M include/core/SkDevice.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M include/private/SkRecords.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -0 lines 0 comments Download
M src/core/SkCanvas.cpp View 1 2 3 4 5 6 7 8 4 chunks +44 lines, -3 lines 0 comments Download
M src/core/SkDevice.cpp View 1 2 3 4 5 6 7 8 4 chunks +14 lines, -3 lines 0 comments Download
A src/core/SkLatticeIter.h View 1 2 3 4 5 6 7 8 1 chunk +49 lines, -0 lines 0 comments Download
A src/core/SkLatticeIter.cpp View 1 2 3 4 5 6 7 8 1 chunk +230 lines, -0 lines 0 comments Download
M src/core/SkNinePatchIter.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -41 lines 0 comments Download
M src/core/SkNinePatchIter.cpp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -72 lines 0 comments Download
M src/core/SkPictureFlat.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkPicturePlayback.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -0 lines 0 comments Download
M src/core/SkPictureRecord.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +18 lines, -0 lines 0 comments Download
M src/core/SkRecordDraw.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +13 lines, -0 lines 0 comments Download
M src/core/SkRecorder.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkRecorder.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/batches/GrNinePatch.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/pdf/SkPDFCanvas.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M src/pdf/SkPDFCanvas.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +14 lines, -3 lines 0 comments Download
M tests/PictureTest.cpp View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 46 (26 generated)
msarett
Let me know what you think. Once we're happy with this, I'll apply similar changes ...
4 years, 7 months ago (2016-05-19 17:22:52 UTC) #3
reed1
1. I suggest we keep the old version as well (even w/ the same name) ...
4 years, 7 months ago (2016-05-19 17:39:30 UTC) #4
msarett
On 2016/05/19 17:39:30, reed1 wrote: > 1. I suggest we keep the old version as ...
4 years, 7 months ago (2016-05-19 18:01:27 UTC) #5
reed1
seems like we can impl the older api in terms of this one trivially using ...
4 years, 7 months ago (2016-05-19 18:21:01 UTC) #7
msarett
On 2016/05/19 18:21:01, reed1 wrote: > seems like we can impl the older api in ...
4 years, 7 months ago (2016-05-19 19:18:47 UTC) #8
f(malita)
https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h#newcode956 include/core/SkCanvas.h:956: * (in the x-dimension) to fit into dst or ...
4 years, 7 months ago (2016-05-19 19:24:20 UTC) #9
msarett
https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h#newcode956 include/core/SkCanvas.h:956: * (in the x-dimension) to fit into dst or ...
4 years, 7 months ago (2016-05-19 19:30:58 UTC) #10
f(malita)
https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/20001/include/core/SkCanvas.h#newcode956 include/core/SkCanvas.h:956: * (in the x-dimension) to fit into dst or ...
4 years, 7 months ago (2016-05-19 19:36:11 UTC) #11
msarett
PTAL. I've added a software implementation, a test, and a benchmark. GPU implementation is coming ...
4 years, 6 months ago (2016-05-25 20:35:40 UTC) #15
reed1
Seems like a good start. Will be interesting to see how you override this for ...
4 years, 6 months ago (2016-05-31 15:29:57 UTC) #16
msarett
On 2016/05/31 15:29:57, reed1 wrote: > Seems like a good start. > > Will be ...
4 years, 5 months ago (2016-07-15 14:20:57 UTC) #18
reed1
https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h#newcode974 include/core/SkCanvas.h:974: void drawBitmapNine(const SkBitmap& bitmap, const NinePatchDivs& divs, const SkRect& ...
4 years, 5 months ago (2016-07-15 16:27:04 UTC) #19
msarett
What do you think about drawNPatch() and NPatchDivs?
4 years, 5 months ago (2016-07-15 16:38:34 UTC) #20
reed1
lgtm w/ name suggestions https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h#newcode941 include/core/SkCanvas.h:941: struct NinePatchDivs { drawBitmapLattice https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h#newcode945 ...
4 years, 4 months ago (2016-08-01 16:26:02 UTC) #21
msarett
https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1992283002/diff/160001/include/core/SkCanvas.h#newcode941 include/core/SkCanvas.h:941: struct NinePatchDivs { On 2016/08/01 16:26:02, reed1 wrote: > ...
4 years, 4 months ago (2016-08-01 23:25:10 UTC) #30
msarett
Needs an override for SkPDFCanvas. Adding Hal.
4 years, 4 months ago (2016-08-02 13:54:32 UTC) #34
hal.canary
PDF: 1gtm
4 years, 4 months ago (2016-08-02 13:56:19 UTC) #35
msarett
Rewrote impls for picture serialization
4 years, 4 months ago (2016-08-02 14:41:15 UTC) #39
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/1992283002/320001
4 years, 4 months ago (2016-08-02 15:05:00 UTC) #44
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 15:06:00 UTC) #46
Message was sent while issue was closed.
Committed patchset #12 (id:320001) as
https://skia.googlesource.com/skia/+/c573a40ed5024b463e47088d307e3164a486dba5

Powered by Google App Engine
This is Rietveld 408576698