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

Issue 1911963008: DNC - JSON of flattenables, with field names.

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

Description

Patch Set 1 #

Patch Set 2 : Add name to signature of write funcs #

Patch Set 3 : Add names to call sites #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+575 lines, -303 lines) Patch
M experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M gm/dcshader.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M gyp/debugger.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/dm.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/skiaserve.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/tests.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M include/core/SkWriteBuffer.h View 1 2 2 chunks +33 lines, -28 lines 1 comment Download
M samplecode/ClockFaceView.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M samplecode/SampleAll.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkBitmap.cpp View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M src/core/SkBlitter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkColorFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkColorFilterShader.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkColorMatrixFilterRowMajor255.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkColorTable.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkComposeShader.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/core/SkFlattenableSerialization.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/core/SkImageInfo.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/core/SkLightingShader.cpp View 1 2 1 chunk +9 lines, -9 lines 0 comments Download
M src/core/SkLocalMatrixImageFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkLocalMatrixShader.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkMatrixImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkModeColorFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 chunks +12 lines, -12 lines 0 comments Download
M src/core/SkPathEffect.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkPicture.cpp View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M src/core/SkPictureData.cpp View 1 2 5 chunks +9 lines, -9 lines 0 comments Download
M src/core/SkPictureShader.cpp View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M src/core/SkShader.cpp View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M src/core/SkTextBlob.cpp View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M src/core/SkWriteBuffer.cpp View 1 2 9 chunks +39 lines, -39 lines 0 comments Download
M src/core/SkXfermode.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/Sk1DPathEffect.cpp View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M src/effects/Sk2DPathEffect.cpp View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M src/effects/SkAlphaThresholdFilter.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/SkArcToPathEffect.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkArithmeticMode.cpp View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/effects/SkBlurDrawLooper.cpp View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/SkColorCubeFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkCornerPathEffect.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkDashPathEffect.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkDiscretePathEffect.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/SkDropShadowImageFilter.cpp View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M src/effects/SkEmbossMaskFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkImageSource.cpp View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M src/effects/SkLayerDrawLooper.cpp View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M src/effects/SkLayerRasterizer.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 2 6 chunks +12 lines, -12 lines 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 2 1 chunk +9 lines, -9 lines 0 comments Download
M src/effects/SkMergeImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkOffsetImageFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkPaintImageFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkPerlinNoiseShader.cpp View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M src/effects/SkPictureImageFilter.cpp View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/effects/SkTableColorFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkTableMaskFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkTestImageFilters.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkTileImageFilter.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkXfermodeImageFilter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 1 chunk +9 lines, -9 lines 0 comments Download
M src/effects/gradients/SkLinearGradient.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkRadialGradient.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkSweepGradient.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.cpp View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M src/image/SkImageShader.cpp View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M tools/debugger/SkDrawCommand.cpp View 3 chunks +9 lines, -0 lines 0 comments Download
A tools/debugger/SkJsonWriteBuffer.h View 1 1 chunk +64 lines, -0 lines 0 comments Download
A tools/debugger/SkJsonWriteBuffer.cpp View 1 2 1 chunk +185 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
mtklein
https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuffer.h File include/core/SkWriteBuffer.h (right): https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuffer.h#newcode27 include/core/SkWriteBuffer.h:27: #define SK_STRING_AND_VALUE(x) #x , x Looks like this is ...
4 years, 7 months ago (2016-04-27 13:55:05 UTC) #3
Brian Osman
On 2016/04/27 13:55:05, mtklein wrote: > https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuffer.h > File include/core/SkWriteBuffer.h (right): > > https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuffer.h#newcode27 > ...
4 years, 7 months ago (2016-04-27 14:12:00 UTC) #4
mtklein
4 years, 7 months ago (2016-04-27 14:26:52 UTC) #5
On 2016/04/27 at 14:12:00, brianosman wrote:
> On 2016/04/27 13:55:05, mtklein wrote:
> >
https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuf...
> > File include/core/SkWriteBuffer.h (right):
> > 
> >
https://codereview.chromium.org/1911963008/diff/40001/include/core/SkWriteBuf...
> > include/core/SkWriteBuffer.h:27: #define SK_STRING_AND_VALUE(x) #x , x
> > Looks like this is used sparsely.
> > 
> > What are your thoughts on this vs. manually writing everything out?  Too
much
> > miscellaneous baggage, like .get(), (int), arrays?
> > 
> > I can see arguments that both of two extremes are possibly friendliest to
> > debugger users:
> >    - literal quotation of the value as done here, to make cross-referencing
with
> > the implementation easy;
> >    - use the same human friendly names as the constructors / factories to
make
> > cross-referencing with the API easy.
> 
> ... yeah. This change (obviously) involved a lot of typing, and I ended up
having different
> ideas about policy as I went. Unfortunately, I ended up not being super
consistent, as a
> result - I'd have to clean it up and use one strategy everywhere.
> 
> I originally created the macro, imagining I'd use that almost everywhere, and
then I ran
> into all the sub-struct, array, accessor stuff you mentioned, and decided that
it would
> make the json pretty ugly. I also agree that both extremes are useful,
although I think
> I'd tend to pick the explicit human-readable version, if forced to express an
opinion.

SGTM.

> It's also possible to move the names to the end of the calls, defaulting to
nullptr. Then
> we could emit the type (as in the other change), unless a name is given. That
just lets us
> name-ify all the calls consistently over time. (Although, this took me a
couple hours, so
> it's probably better to just make the names required and do it once,
correctly).

I'd be happy to start with optional names, and I don't even think that's
necessarily a
long-term bad state to be in.  For many flattened effects, the field types are
plenty
expressive: consider SkComposeShader, SkLocalMatrixImageFilter... once you know
the type
name and the field types and values recursively, there's not much added by
naming the fields.

Now things like SkMatrixConvolutionImageFilter... kind of a mess without field
names.
I suspect as these effects become visible in the debugger we'll get a sense for
which need 
field names and just fill them in as we go.

Making these optional also does prevent people from relying on them for other
uses, which
is probably a feature.  My more devious part was already thinking about how to
use these
field names in other ways...

Powered by Google App Engine
This is Rietveld 408576698