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

Issue 18978014: Working plumb of image scaling: (Closed)

Created:
7 years, 5 months ago by humper
Modified:
7 years, 5 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Working plumb of image scaling: 1) always generate mipmaps if we detect that we are downsampling. 2) pre-scale the image if we detect that we are upsampling (currently valid for scale+translate only) 3) A few miscellaneous bug fixes related to image scaling. Still need SSE/Neon versions of these image scalers. BUG= R=bsalomon@google.com, robertphillips@google.com Committed: https://code.google.com/p/skia/source/detail?r=10056

Patch Set 1 #

Patch Set 2 : Rework plumb to have filter quality as an enum, avoid allocating new purgable bitmap #

Total comments: 14

Patch Set 3 : remove mipbitmap, style nits #

Patch Set 4 : whoops, lost a logical negation #

Patch Set 5 : reorganization of chooseProcs to be more readable and correct #

Total comments: 7

Patch Set 6 : fix debug build for SSE3 #

Patch Set 7 : fix bug failing to upscale when there was no translate #

Patch Set 8 : nits and one more small bugfix #

Patch Set 9 : Better performance with floating point by avoiding SkFixedDiv #

Patch Set 10 : Performance improvements; transpose intermediate image for better cache usage; ensure that filter l… #

Patch Set 11 : fix bug in transpose horiz scale #

Patch Set 12 : No need to special case scale=1 #

Total comments: 16

Patch Set 13 : More nits from mike ;) #

Patch Set 14 : Added a comment about passing the clip #

Total comments: 60

Patch Set 15 : recompute the triviality of the matrix because it might possibly have changed #

Patch Set 16 : fixing build errors #

Patch Set 17 : fix warning #

Patch Set 18 : fixing another warning #

Patch Set 19 : nits from robert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+577 lines, -512 lines) Patch
A + gm/downsamplebitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +59 lines, -97 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M src/core/SkBitmapFilter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +18 lines, -13 lines 0 comments Download
M src/core/SkBitmapFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +109 lines, -151 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M src/core/SkBitmapProcState.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +19 lines, -8 lines 0 comments Download
M src/core/SkBitmapProcState.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 14 chunks +318 lines, -190 lines 0 comments Download
M src/core/SkBitmapProcState_matrix.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +6 lines, -6 lines 0 comments Download
M src/core/SkBitmapProcState_matrixProcs.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -3 lines 0 comments Download
M src/core/SkBitmapProcState_sample.h View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkBitmapProcState_shaderproc.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M src/opts/SkBitmapFilter_opts_SSE2.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +7 lines, -7 lines 0 comments Download
M src/opts/SkBitmapProcState_matrix_clamp_neon.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +8 lines, -8 lines 0 comments Download
M src/opts/SkBitmapProcState_matrix_repeat_neon.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +8 lines, -8 lines 0 comments Download
M src/opts/SkBitmapProcState_opts_SSE2.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +9 lines, -9 lines 0 comments Download
M src/opts/SkBitmapProcState_opts_SSSE3.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/opts/SkBitmapProcState_opts_arm.cpp View 1 2 3 4 5 6 7 4 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
humper
7 years, 5 months ago (2013-07-10 22:51:47 UTC) #1
reed1
I think if we add a new bool to SkBitmapProcState.h (next to fDoFilter) or change ...
7 years, 5 months ago (2013-07-11 14:06:36 UTC) #2
humper
On 2013/07/11 14:06:36, reed1 wrote: > I think if we add a new bool to ...
7 years, 5 months ago (2013-07-11 14:22:51 UTC) #3
humper
7 years, 5 months ago (2013-07-11 15:34:21 UTC) #4
reed1
https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp File src/core/SkBitmapProcState.cpp (right): https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp#newcode130 src/core/SkBitmapProcState.cpp:130: fScaledBitmap.setConfig(SkBitmap::kARGB_8888_Config, fOrigBitmap.width() / inv.getScaleX(), fOrigBitmap.height() / inv.getScaleY()); nit: line-wrap ...
7 years, 5 months ago (2013-07-11 15:43:42 UTC) #5
reed1
https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp File src/core/SkBitmapProcState.cpp (right): https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp#newcode130 src/core/SkBitmapProcState.cpp:130: fScaledBitmap.setConfig(SkBitmap::kARGB_8888_Config, fOrigBitmap.width() / inv.getScaleX(), fOrigBitmap.height() / inv.getScaleY()); grrrr, this ...
7 years, 5 months ago (2013-07-11 15:49:08 UTC) #6
reed1
Seems like we should *not* create a mipmap unless the caller is asking for HQ ...
7 years, 5 months ago (2013-07-11 15:49:43 UTC) #7
humper
https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp File src/core/SkBitmapProcState.cpp (right): https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.cpp#newcode130 src/core/SkBitmapProcState.cpp:130: fScaledBitmap.setConfig(SkBitmap::kARGB_8888_Config, fOrigBitmap.width() / inv.getScaleX(), fOrigBitmap.height() / inv.getScaleY()); On 2013/07/11 ...
7 years, 5 months ago (2013-07-11 16:03:03 UTC) #8
humper
https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.h File src/core/SkBitmapProcState.h (right): https://codereview.chromium.org/18978014/diff/6001/src/core/SkBitmapProcState.h#newcode64 src/core/SkBitmapProcState.h:64: SkBitmap* fBitmap; // chooseProcs - orig or mip On ...
7 years, 5 months ago (2013-07-11 16:04:09 UTC) #9
humper
7 years, 5 months ago (2013-07-11 20:10:18 UTC) #10
reed1
https://codereview.chromium.org/18978014/diff/5629499534213120/src/core/SkBitmapProcState.cpp File src/core/SkBitmapProcState.cpp (right): https://codereview.chromium.org/18978014/diff/5629499534213120/src/core/SkBitmapProcState.cpp#newcode111 src/core/SkBitmapProcState.cpp:111: fOrigBitmap.width() / fUnitInvMatrix.getScaleX(), This / produces a float (SkScalar). ...
7 years, 5 months ago (2013-07-11 20:26:18 UTC) #11
humper
On 2013/07/11 20:26:18, reed1 wrote: > https://codereview.chromium.org/18978014/diff/5629499534213120/src/core/SkBitmapProcState.cpp > File src/core/SkBitmapProcState.cpp (right): > > https://codereview.chromium.org/18978014/diff/5629499534213120/src/core/SkBitmapProcState.cpp#newcode111 > ...
7 years, 5 months ago (2013-07-11 22:01:41 UTC) #12
reed1
https://codereview.chromium.org/18978014/diff/35002/src/core/SkBitmapFilter.cpp File src/core/SkBitmapFilter.cpp (right): https://codereview.chromium.org/18978014/diff/35002/src/core/SkBitmapFilter.cpp#newcode55 src/core/SkBitmapFilter.cpp:55: fr = SkScalarDiv(fr, weight); All of the SkScalarDiv() calls ...
7 years, 5 months ago (2013-07-12 14:01:05 UTC) #13
humper
getting closer! https://codereview.chromium.org/18978014/diff/35002/src/core/SkBitmapProcState.cpp File src/core/SkBitmapProcState.cpp (right): https://codereview.chromium.org/18978014/diff/35002/src/core/SkBitmapProcState.cpp#newcode93 src/core/SkBitmapProcState.cpp:93: void SkBitmapProcState::possiblyScaleImage() { On 2013/07/12 14:01:06, reed1 ...
7 years, 5 months ago (2013-07-12 17:18:01 UTC) #14
reed1
I think pre-clipping the src bitmap is non-trivial, so it may be fine to do ...
7 years, 5 months ago (2013-07-12 18:33:24 UTC) #15
humper
As of patch set 14, here are the bitmap_scale benchmark numbers for top-of-tree vs. this ...
7 years, 5 months ago (2013-07-12 18:34:14 UTC) #16
humper
matrix triviality recomputed
7 years, 5 months ago (2013-07-12 19:02:47 UTC) #17
bsalomon
I mostly just looked at the new code flow in src/core/SkBitmapProcShader.cpp and it lgtm
7 years, 5 months ago (2013-07-12 19:13:51 UTC) #18
robertphillips
lgtm + nits & some questions https://codereview.chromium.org/18978014/diff/50001/gm/downsamplebitmap.cpp File gm/downsamplebitmap.cpp (right): https://codereview.chromium.org/18978014/diff/50001/gm/downsamplebitmap.cpp#newcode29 gm/downsamplebitmap.cpp:29: this->fBitmapMade = false; ...
7 years, 5 months ago (2013-07-12 19:42:30 UTC) #19
humper
https://codereview.chromium.org/18978014/diff/50001/gm/downsamplebitmap.cpp File gm/downsamplebitmap.cpp (right): https://codereview.chromium.org/18978014/diff/50001/gm/downsamplebitmap.cpp#newcode29 gm/downsamplebitmap.cpp:29: this->fBitmapMade = false; On 2013/07/12 19:42:31, robertphillips wrote: > ...
7 years, 5 months ago (2013-07-12 21:12:03 UTC) #20
humper
Committed patchset #19 manually as r10056 (presubmit successful).
7 years, 5 months ago (2013-07-12 21:14:39 UTC) #21
robertphillips
7 years, 5 months ago (2013-07-13 15:39:55 UTC) #22
Message was sent while issue was closed.
I tried to turn the bots green again by disabling this by defining
SK_IGNORE_IMAGE_PRESCALE but GM was still hitting some asserts even with this.

I reverted this CL in r10060.

Powered by Google App Engine
This is Rietveld 408576698