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

Issue 134163010: Refactor read and write buffers. (Closed)

Created:
6 years, 10 months ago by mtklein_C
Modified:
6 years, 10 months ago
Reviewers:
djsollen, scroggo, mtklein, reed1
CC:
skia-review_googlegroups.com, ian_cottrell
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Refactor read and write buffers. Eliminates SkFlattenable{Read,Write}Buffer, promoting SkOrdered{Read,Write}Buffer a step each in the hierarchy. What used to be this: SkFlattenableWriteBuffer -> SkOrderedWriteBuffer SkFlattenableReadBuffer -> SkOrderedReadBuffer SkFlattenableReadBuffer -> SkValidatingReadBuffer is now SkWriteBuffer SkReadBuffer -> SkValidatingReadBuffer Benefits: - code is simpler, names are less wordy - the generic SkFlattenableFooBuffer code in SkPaint was incorrect; removed - write buffers are completely devirtualized, important for record speed This refactoring was mostly mechanical. You aren't going to find anything interesting in files with less than 10 lines changed. BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=13245

Patch Set 1 #

Patch Set 2 : tweaks #

Patch Set 3 : little things #

Patch Set 4 : original write flags were fine #

Total comments: 4

Patch Set 5 : indent #

Patch Set 6 : fix some Android-only .size() calls #

Patch Set 7 : whoops, read buffers have .size() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1086 lines, -1978 lines) Patch
M gm/imagefiltersbase.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M gm/imagefiltersgraph.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M gm/texteffects.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M gyp/core.gypi View 2 chunks +2 lines, -3 lines 0 comments Download
M include/core/SkAnnotation.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkBitmap.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkColorFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkColorShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkColorTable.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkComposeShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkDrawLooper.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkEmptyShader.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkFlattenable.h View 1 4 chunks +8 lines, -8 lines 0 comments Download
M include/core/SkFlattenableBuffers.h View 1 chunk +5 lines, -255 lines 0 comments Download
M include/core/SkImageFilter.h View 1 chunk +4 lines, -4 lines 0 comments Download
M include/core/SkImageInfo.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkMallocPixelRef.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkMaskFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkPaint.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkPaintOptionsAndroid.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkPathEffect.h View 4 chunks +5 lines, -5 lines 0 comments Download
M include/core/SkPicture.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkPixelRef.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkRasterizer.h View 1 chunk +1 line, -1 line 0 comments Download
A include/core/SkReadBuffer.h View 1 2 1 chunk +205 lines, -0 lines 0 comments Download
M include/core/SkShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkUnitMapper.h View 1 chunk +1 line, -1 line 0 comments Download
A include/core/SkWriteBuffer.h View 3 1 chunk +121 lines, -0 lines 0 comments Download
M include/core/SkXfermode.h View 2 chunks +3 lines, -3 lines 0 comments Download
M include/effects/Sk1DPathEffect.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/Sk2DPathEffect.h View 3 chunks +6 lines, -6 lines 0 comments Download
M include/effects/SkAvoidXfermode.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkBicubicImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkBitmapSource.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkBlurDrawLooper.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkBlurImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkColorFilterImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkColorMatrixFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkComposeImageFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkCornerPathEffect.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkDashPathEffect.h View 1 chunk +3 lines, -3 lines 0 comments Download
M include/effects/SkDiscretePathEffect.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkDisplacementMapEffect.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkDropShadowImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkEmbossMaskFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkKernel33MaskFilter.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/effects/SkLayerDrawLooper.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkLayerRasterizer.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkLerpXfermode.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkLightingImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkLumaColorFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkMagnifierImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkMatrixConvolutionImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkMergeImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkMorphologyImageFilter.h View 3 chunks +4 lines, -4 lines 0 comments Download
M include/effects/SkOffsetImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkPerlinNoiseShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkPictureImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkPixelXorXfermode.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkRectShaderImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkResizeImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkStippleMaskFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkTableMaskFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkTestImageFilters.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkTileImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkTransparentShader.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkXfermodeImageFilter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/images/SkImageRef.h View 1 chunk +2 lines, -2 lines 0 comments Download
M include/images/SkImageRef_GlobalPool.h View 1 chunk +1 line, -1 line 0 comments Download
M include/utils/SkUnitMappers.h View 2 chunks +3 lines, -3 lines 0 comments Download
M samplecode/ClockFaceView.cpp View 3 chunks +5 lines, -4 lines 0 comments Download
M samplecode/SampleAll.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M samplecode/SampleSlides.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M samplecode/SampleText.cpp View 5 chunks +7 lines, -6 lines 0 comments Download
M src/core/SkAnnotation.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkBitmap.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkBitmapHeap.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkBitmapProcShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkBlitter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkColorFilter.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkColorTable.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkComposeShader.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkData.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkDraw.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkFilterShader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkFilterShader.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkFlattenable.cpp View 1 chunk +1 line, -1 line 0 comments Download
D src/core/SkFlattenableBuffers.cpp View 1 chunk +0 lines, -115 lines 0 comments Download
M src/core/SkFlattenableSerialization.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/core/SkImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkImageInfo.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkMallocPixelRef.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
D src/core/SkOrderedReadBuffer.h View 1 chunk +0 lines, -140 lines 0 comments Download
D src/core/SkOrderedReadBuffer.cpp View 1 chunk +0 lines, -320 lines 0 comments Download
D src/core/SkOrderedWriteBuffer.h View 1 chunk +0 lines, -115 lines 0 comments Download
D src/core/SkOrderedWriteBuffer.cpp View 1 chunk +0 lines, -325 lines 0 comments Download
M src/core/SkPaint.cpp View 7 chunks +60 lines, -98 lines 0 comments Download
M src/core/SkPaintOptionsAndroid.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkPathEffect.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkPathHeap.h View 2 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkPathHeap.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkPictureFlat.h View 8 chunks +10 lines, -10 lines 0 comments Download
M src/core/SkPicturePlayback.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/core/SkPicturePlayback.cpp View 9 chunks +13 lines, -13 lines 0 comments Download
M src/core/SkPixelRef.cpp View 3 chunks +5 lines, -4 lines 0 comments Download
A + src/core/SkReadBuffer.cpp View 1 11 chunks +48 lines, -34 lines 0 comments Download
M src/core/SkScalerContext.cpp View 1 2 3 4 5 6 5 chunks +8 lines, -7 lines 0 comments Download
M src/core/SkShader.cpp View 5 chunks +6 lines, -5 lines 0 comments Download
M src/core/SkValidatingReadBuffer.h View 2 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkValidatingReadBuffer.cpp View 1 chunk +1 line, -1 line 0 comments Download
A + src/core/SkWriteBuffer.cpp View 14 chunks +38 lines, -38 lines 0 comments Download
M src/core/SkXfermode.cpp View 9 chunks +10 lines, -9 lines 0 comments Download
M src/core/SkXfermode_proccoeff.h View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/Sk1DPathEffect.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/Sk2DPathEffect.cpp View 4 chunks +8 lines, -7 lines 0 comments Download
M src/effects/SkAlphaThresholdFilter.cpp View 4 chunks +6 lines, -5 lines 0 comments Download
M src/effects/SkArithmeticMode.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkAvoidXfermode.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkBicubicImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkBitmapSource.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkBlurDrawLooper.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 4 chunks +6 lines, -5 lines 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkColorFilters.cpp View 11 chunks +14 lines, -13 lines 0 comments Download
M src/effects/SkColorMatrix.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/SkColorMatrixFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkComposeImageFilter.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M src/effects/SkCornerPathEffect.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkDashPathEffect.cpp View 3 chunks +5 lines, -4 lines 0 comments Download
M src/effects/SkDiscretePathEffect.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkDropShadowImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkEmbossMaskFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkKernel33MaskFilter.cpp View 3 chunks +6 lines, -5 lines 0 comments Download
M src/effects/SkLayerDrawLooper.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkLayerRasterizer.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkLerpXfermode.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 17 chunks +28 lines, -27 lines 0 comments Download
M src/effects/SkLumaColorFilter.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkMergeImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkOffsetImageFilter.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkPerlinNoiseShader.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkPictureImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkPixelXorXfermode.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkRectShaderImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkResizeImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkTableColorFilter.cpp View 4 chunks +6 lines, -5 lines 0 comments Download
M src/effects/SkTableMaskFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkTestImageFilters.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkTileImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/SkXfermodeImageFilter.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 2 chunks +4 lines, -3 lines 0 comments Download
M src/effects/gradients/SkLinearGradient.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkLinearGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkRadialGradient.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkRadialGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkSweepGradient.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkSweepGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointRadialGradient.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointRadialGradient.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/images/SkImageRef.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M src/images/SkImageRef_GlobalPool.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkImageRef_ashmem.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/images/SkImageRef_ashmem.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M src/lazy/SkCachingPixelRef.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/opts/SkXfermode_opts_arm_neon.h View 1 chunk +1 line, -1 line 0 comments Download
M src/opts/SkXfermode_opts_arm_neon.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/pipe/SkGPipeRead.cpp View 1 2 3 4 7 chunks +7 lines, -7 lines 0 comments Download
M src/pipe/SkGPipeWrite.cpp View 5 chunks +6 lines, -6 lines 0 comments Download
M src/utils/SkUnitMappers.cpp View 3 chunks +5 lines, -4 lines 0 comments Download
M tests/AndroidPaintTest.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/BitmapHeapTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/ColorFilterTest.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M tests/DataRefTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/FlatDataTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/SerializationTest.cpp View 13 chunks +16 lines, -16 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
mtklein_C
Believe it or not, this is all in the name of improving picture recording speed.
6 years, 10 months ago (2014-01-29 19:31:13 UTC) #1
reed1
+scrogg : pipe implications (if any) +derek : didn't we make the writer virtual for ...
6 years, 10 months ago (2014-01-29 19:39:34 UTC) #2
mtklein
On 2014/01/29 19:39:34, reed1 wrote: > +scrogg : pipe implications (if any) > +derek : ...
6 years, 10 months ago (2014-01-29 19:47:00 UTC) #3
scroggo
The changes to pipe look fine to me. The overall CL lgtm also. https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h File ...
6 years, 10 months ago (2014-01-29 20:07:19 UTC) #4
mtklein
On 2014/01/29 20:07:19, scroggo wrote: > The changes to pipe look fine to me. > ...
6 years, 10 months ago (2014-01-29 20:13:45 UTC) #5
mtklein
On 2014/01/29 20:13:45, mtklein wrote: > On 2014/01/29 20:07:19, scroggo wrote: > > The changes ...
6 years, 10 months ago (2014-01-29 20:29:55 UTC) #6
mtklein
https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h File include/core/SkFlattenableBuffers.h (right): https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h#newcode8 include/core/SkFlattenableBuffers.h:8: typedef SkReadBuffer SkFlattenableReadBuffer; On 2014/01/29 20:07:21, scroggo wrote: > ...
6 years, 10 months ago (2014-01-29 20:38:28 UTC) #7
djsollen
lgtm
6 years, 10 months ago (2014-01-29 20:53:10 UTC) #8
scroggo
On 2014/01/29 20:38:28, mtklein wrote: > https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h > File include/core/SkFlattenableBuffers.h (right): > > https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h#newcode8 > ...
6 years, 10 months ago (2014-01-30 16:13:33 UTC) #9
mtklein
On 2014/01/30 16:13:33, scroggo wrote: > On 2014/01/29 20:38:28, mtklein wrote: > > > https://codereview.chromium.org/134163010/diff/60001/include/core/SkFlattenableBuffers.h ...
6 years, 10 months ago (2014-01-30 16:17:07 UTC) #10
reed1
lgtm
6 years, 10 months ago (2014-01-30 17:55:45 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/134163010/120001
6 years, 10 months ago (2014-01-30 18:09:18 UTC) #12
commit-bot: I haz the power
Change committed as 13245
6 years, 10 months ago (2014-01-30 18:59:21 UTC) #13
commit-bot: I haz the power
6 years, 10 months ago (2014-01-30 19:02:16 UTC) #14
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698