From 9d524f22bfde5dc3dc8f48e1be39bdebd3bb0304 Mon Sep 17 00:00:00 2001 From: halcanary Date: Tue, 29 Mar 2016 09:03:52 -0700 Subject: Style bikeshed - remove extraneous whitespace GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002 --- bench/BigPathBench.cpp | 1 - bench/BitmapRectBench.cpp | 1 - bench/BlurBench.cpp | 1 - bench/BlurImageFilterBench.cpp | 2 +- bench/BlurRectBench.cpp | 2 +- bench/DashBench.cpp | 1 - bench/FSRectBench.cpp | 1 - bench/GMBench.cpp | 1 - bench/GeometryBench.cpp | 5 +- bench/GrResourceCacheBench.cpp | 1 - bench/GradientBench.cpp | 1 - bench/MatrixBench.cpp | 2 - bench/MemoryBench.cpp | 1 - bench/MutexBench.cpp | 1 - bench/PatchBench.cpp | 8 +- bench/PatchGridBench.cpp | 52 +++---- bench/PathIterBench.cpp | 1 - bench/ReadPixBench.cpp | 1 - bench/RectBench.cpp | 1 - bench/RectanizerBench.cpp | 2 +- bench/RegionBench.cpp | 1 - bench/RepeatTileBench.cpp | 1 - bench/RotatedRectBench.cpp | 2 +- bench/ScalarBench.cpp | 1 - bench/ShapesBench.cpp | 1 - bench/SkLinearBitmapPipelineBench.cpp | 2 - bench/TextBench.cpp | 1 - bench/TextBlobBench.cpp | 1 - bench/TileBench.cpp | 1 - bench/TopoSortBench.cpp | 1 - bench/WriterBench.cpp | 1 - bench/Xfer4fBench.cpp | 4 +- bench/XferU64Bench.cpp | 2 +- bench/XfermodeBench.cpp | 1 - bench/nanobenchAndroid.cpp | 2 - gm/aaclip.cpp | 12 +- gm/aaxfermodes.cpp | 5 +- gm/addarc.cpp | 19 ++- gm/anisotropic.cpp | 2 +- gm/beziereffects.cpp | 1 - gm/bigrrectaaeffect.cpp | 2 +- gm/bitmapcopy.cpp | 3 +- gm/bitmapfilters.cpp | 11 +- gm/bitmaprect.cpp | 1 - gm/bitmapshader.cpp | 1 - gm/bleed.cpp | 2 +- gm/bmpfilterqualityrepeat.cpp | 2 +- gm/circles.cpp | 3 +- gm/circularclips.cpp | 2 +- gm/color4f.cpp | 2 +- gm/colormatrix.cpp | 3 +- gm/complexclip.cpp | 1 - gm/complexclip3.cpp | 3 +- gm/composeshader.cpp | 2 +- gm/conicpaths.cpp | 2 +- gm/convex_all_line_paths.cpp | 4 +- gm/convexpaths.cpp | 1 - gm/convexpolyclip.cpp | 1 - gm/convexpolyeffect.cpp | 1 - gm/dashing.cpp | 10 +- gm/dcshader.cpp | 1 - gm/distantclip.cpp | 5 +- gm/drawatlas.cpp | 13 +- gm/drawatlascolor.cpp | 21 ++- gm/drawbitmaprect.cpp | 4 +- gm/drawminibitmaprect.cpp | 1 - gm/dstreadshuffle.cpp | 1 - gm/emptypath.cpp | 3 +- gm/filterfastbounds.cpp | 4 +- gm/fontmgr.cpp | 2 +- gm/gammatext.cpp | 7 +- gm/gm.cpp | 1 - gm/gradientDirtyLaundry.cpp | 1 - gm/gradients.cpp | 6 +- gm/image.cpp | 2 +- gm/image_pict.cpp | 3 - gm/image_shader.cpp | 1 - gm/imagefiltersbase.cpp | 3 +- gm/imagefiltersscaled.cpp | 4 +- gm/imagefromyuvtextures.cpp | 3 +- gm/imagesource2.cpp | 2 +- gm/internal_links.cpp | 1 - gm/lcdblendmodes.cpp | 10 +- gm/lcdtext.cpp | 22 +-- gm/lightingshader.cpp | 2 +- gm/localmatriximagefilter.cpp | 1 - gm/mipmap.cpp | 1 - gm/multipicturedraw.cpp | 4 +- gm/ninepatchstretch.cpp | 1 - gm/offsetimagefilter.cpp | 20 +-- gm/ovals.cpp | 1 - gm/patch.cpp | 15 +- gm/patchgrid.cpp | 27 ++-- gm/path_stroke_with_zero_length.cpp | 1 - gm/pathcontourstart.cpp | 1 - gm/pathreverse.cpp | 2 +- gm/picture.cpp | 6 +- gm/pixelsnap.cpp | 2 +- gm/points.cpp | 1 - gm/recordopts.cpp | 1 - gm/rectangletexture.cpp | 3 +- gm/roundrects.cpp | 1 - gm/shadertext.cpp | 2 +- gm/shallowgradient.cpp | 2 +- gm/shapes.cpp | 1 - gm/showmiplevels.cpp | 4 +- gm/smallpaths.cpp | 33 +++-- gm/strokefill.cpp | 10 +- gm/strokerects.cpp | 1 - gm/strokes.cpp | 4 +- gm/surface.cpp | 3 +- gm/tablecolorfilter.cpp | 6 +- gm/texdata.cpp | 1 - gm/textblobblockreordering.cpp | 6 +- gm/texturedomaineffect.cpp | 1 - gm/tilemodes.cpp | 1 - gm/tilemodes_scaled.cpp | 1 - gm/tinybitmap.cpp | 1 - gm/verttext2.cpp | 1 - gm/verylargebitmap.cpp | 1 - gm/xfermodes.cpp | 4 +- gm/xfermodes2.cpp | 1 - gm/yuvtorgbeffect.cpp | 1 - .../sample_app/src/main/jni/AndroidKeyToSkKey.h | 1 - .../src/main/jni/com_skia_SkiaSampleRenderer.cpp | 1 - samplecode/ClockFaceView.cpp | 1 - samplecode/GMSampleView.cpp | 1 - samplecode/OverView.cpp | 1 - samplecode/PerlinPatch.cpp | 5 +- samplecode/Sample2PtRadial.cpp | 1 - samplecode/SampleAAClip.cpp | 1 - samplecode/SampleAARects.cpp | 1 - samplecode/SampleAll.cpp | 1 - samplecode/SampleAnimatedText.cpp | 2 +- samplecode/SampleAnimator.cpp | 1 - samplecode/SampleApp.cpp | 14 +- samplecode/SampleApp.h | 2 +- samplecode/SampleAtlas.cpp | 8 +- samplecode/SampleBigBlur.cpp | 1 - samplecode/SampleBitmapRect.cpp | 2 +- samplecode/SampleBlur.cpp | 1 - samplecode/SampleClamp.cpp | 1 - samplecode/SampleClipDrawMatch.cpp | 4 +- samplecode/SampleColorFilter.cpp | 1 - samplecode/SampleComplexClip.cpp | 1 - samplecode/SampleConcavePaths.cpp | 1 - samplecode/SampleDash.cpp | 1 - samplecode/SampleDither.cpp | 1 - samplecode/SampleDraw.cpp | 1 - samplecode/SampleEffects.cpp | 1 - samplecode/SampleFillType.cpp | 1 - samplecode/SampleFilter.cpp | 1 - samplecode/SampleFilterFuzz.cpp | 4 +- samplecode/SampleFilterQuality.cpp | 6 +- samplecode/SampleFontCache.cpp | 1 - samplecode/SampleFontScalerTest.cpp | 1 - samplecode/SampleFuzz.cpp | 1 - samplecode/SampleGradients.cpp | 1 - samplecode/SampleHT.cpp | 6 +- samplecode/SampleHairCurves.cpp | 1 - samplecode/SampleLCD.cpp | 1 - samplecode/SampleLayers.cpp | 1 - samplecode/SampleLighting.cpp | 3 +- samplecode/SampleManyRects.cpp | 1 - samplecode/SampleMeasure.cpp | 1 - samplecode/SamplePath.cpp | 2 - samplecode/SamplePathClip.cpp | 30 ++-- samplecode/SamplePathFill.cpp | 1 - samplecode/SamplePathFuzz.cpp | 2 - samplecode/SamplePolyToPoly.cpp | 1 - samplecode/SampleQuadStroker.cpp | 6 +- samplecode/SampleRectanizer.cpp | 2 +- samplecode/SampleRepeatTile.cpp | 1 - samplecode/SampleShip.cpp | 40 +++--- samplecode/SampleSkLayer.cpp | 1 - samplecode/SampleSlides.cpp | 1 - samplecode/SampleStrokePath.cpp | 1 - samplecode/SampleStrokeRect.cpp | 1 - samplecode/SampleTextAlpha.cpp | 1 - samplecode/SampleTextBox.cpp | 1 - samplecode/SampleTextOnPath.cpp | 1 - samplecode/SampleTiling.cpp | 1 - samplecode/SampleVertices.cpp | 1 - samplecode/SampleWritePixels.cpp | 1 - samplecode/SampleXfer.cpp | 8 +- samplecode/vertexdump.cpp | 1 - src/core/SkAAClip.cpp | 1 - src/core/SkAAClip.h | 1 - src/core/SkAdvancedTypefaceMetrics.cpp | 1 - src/core/SkAdvancedTypefaceMetrics.h | 1 - src/core/SkAlphaRuns.cpp | 1 - src/core/SkAntiRun.h | 1 - src/core/SkAutoKern.h | 1 - src/core/SkAutoPixmapStorage.cpp | 2 - src/core/SkAutoPixmapStorage.h | 1 - src/core/SkBitmapController.cpp | 21 ++- src/core/SkBitmapController.h | 6 +- src/core/SkBitmapHeap.cpp | 1 - src/core/SkBitmapProcState.cpp | 1 - src/core/SkBitmapProcState_filter.h | 1 - src/core/SkBitmapProcState_matrix.h | 1 - src/core/SkBitmapProvider.cpp | 1 - src/core/SkBitmapScaler.cpp | 1 - src/core/SkBlitBWMaskTemplate.h | 1 - src/core/SkBlitter.h | 6 +- src/core/SkBlitter_A8.cpp | 1 - src/core/SkBlitter_PM4f.cpp | 64 ++++----- src/core/SkBuffer.h | 1 - src/core/SkCachedData.cpp | 14 +- src/core/SkCanvas.cpp | 30 ++-- src/core/SkChunkAlloc.cpp | 3 +- src/core/SkColorFilter.cpp | 11 +- src/core/SkColorFilterShader.h | 16 +-- src/core/SkColorTable.cpp | 2 - src/core/SkComposeShader.h | 1 - src/core/SkConfig8888.cpp | 7 +- src/core/SkCoreBlitters.h | 6 +- src/core/SkCubicClipper.cpp | 1 - src/core/SkCubicClipper.h | 1 - src/core/SkData.cpp | 1 - src/core/SkDeque.cpp | 1 - src/core/SkDescriptor.h | 1 - src/core/SkDevice.cpp | 38 ++--- src/core/SkDeviceProfile.h | 2 +- src/core/SkDither.cpp | 1 - src/core/SkDither.h | 1 - src/core/SkEdge.cpp | 1 - src/core/SkEdge.h | 1 - src/core/SkEdgeBuilder.cpp | 1 - src/core/SkEdgeBuilder.h | 1 - src/core/SkEdgeClipper.cpp | 1 - src/core/SkEdgeClipper.h | 1 - src/core/SkError.cpp | 1 - src/core/SkErrorInternals.h | 1 - src/core/SkFDot6.h | 1 - src/core/SkFilterProc.cpp | 1 - src/core/SkFilterProc.h | 1 - src/core/SkGlyphCache.cpp | 4 +- src/core/SkGlyphCache.h | 2 +- src/core/SkGraphics.cpp | 1 - src/core/SkHalf.cpp | 16 +-- src/core/SkImageFilter.cpp | 1 - src/core/SkImageFilterCacheKey.h | 1 - src/core/SkImageInfo.cpp | 1 - src/core/SkLight.h | 5 +- src/core/SkLightingShader.cpp | 35 +++-- src/core/SkLightingShader.h | 2 +- src/core/SkLineClipper.h | 1 - src/core/SkLinearBitmapPipeline.cpp | 1 - src/core/SkMaskFilter.cpp | 1 - src/core/SkMaskGamma.h | 4 +- src/core/SkMetaData.cpp | 1 - src/core/SkModeColorFilter.cpp | 4 +- src/core/SkMultiPictureDraw.cpp | 1 - src/core/SkNinePatchIter.cpp | 8 +- src/core/SkNinePatchIter.h | 5 +- src/core/SkPaint.cpp | 2 +- src/core/SkPaintPriv.h | 2 +- src/core/SkPath.cpp | 2 +- src/core/SkPathMeasure.cpp | 9 +- src/core/SkPathPriv.h | 2 +- src/core/SkPerspIter.h | 1 - src/core/SkPictureData.cpp | 2 - src/core/SkPictureFlat.cpp | 1 - src/core/SkPictureFlat.h | 1 - src/core/SkPicturePlayback.cpp | 3 +- src/core/SkPictureRecord.cpp | 1 - src/core/SkPictureShader.h | 1 - src/core/SkPixmap.cpp | 17 ++- src/core/SkPoint.cpp | 1 - src/core/SkPtrRecorder.cpp | 1 - src/core/SkPtrRecorder.h | 5 +- src/core/SkQuadClipper.h | 1 - src/core/SkRTree.h | 1 - src/core/SkRasterClip.cpp | 10 +- src/core/SkRasterClip.h | 2 +- src/core/SkRasterizer.cpp | 1 - src/core/SkReadBuffer.cpp | 1 - src/core/SkRecordDraw.cpp | 1 - src/core/SkRecordOpts.cpp | 1 - src/core/SkRect.cpp | 1 - src/core/SkRefDict.cpp | 1 - src/core/SkRefDict.h | 1 - src/core/SkRegion.cpp | 1 - src/core/SkRegionPriv.h | 1 - src/core/SkScalar.cpp | 1 - src/core/SkScalerContext.cpp | 1 - src/core/SkScan.cpp | 1 - src/core/SkScan.h | 1 - src/core/SkScanPriv.h | 1 - src/core/SkScan_AntiPath.cpp | 1 - src/core/SkScan_Antihair.cpp | 1 - src/core/SkScan_Path.cpp | 2 +- src/core/SkSpecialImage.cpp | 16 +-- src/core/SkSpecialImage.h | 3 +- src/core/SkSpecialSurface.cpp | 4 +- src/core/SkSpecialSurface.h | 2 +- src/core/SkSpriteBlitter4f.cpp | 18 +-- src/core/SkSpriteBlitter_RGB16.cpp | 1 - src/core/SkStream.cpp | 1 - src/core/SkString.cpp | 1 - src/core/SkStroke.cpp | 4 +- src/core/SkStrokeRec.cpp | 2 +- src/core/SkStrokerPriv.cpp | 1 - src/core/SkStrokerPriv.h | 1 - src/core/SkSwizzle.cpp | 2 - src/core/SkTDPQueue.h | 6 +- src/core/SkTDynamicHash.h | 12 +- src/core/SkTMultiMap.h | 1 - src/core/SkTSearch.cpp | 1 - src/core/SkTSort.h | 1 - src/core/SkTaskGroup.cpp | 1 - src/core/SkTextBlob.cpp | 1 - src/core/SkTextFormatParams.h | 1 - src/core/SkTextMapStateProc.h | 1 - src/core/SkTypeface.cpp | 1 - src/core/SkTypefaceCache.cpp | 1 - src/core/SkTypefaceCache.h | 1 - src/core/SkUnPreMultiply.cpp | 1 - src/core/SkUtils.cpp | 1 - src/core/SkUtilsArm.cpp | 1 - src/core/SkUtilsArm.h | 1 - src/core/SkWriteBuffer.cpp | 1 - src/core/SkXfermode.cpp | 20 +-- src/core/SkXfermodeU64.cpp | 3 +- src/core/SkYUVPlanesCache.cpp | 2 +- src/effects/GrCircleBlurFragmentProcessor.cpp | 5 +- src/effects/GrCircleBlurFragmentProcessor.h | 2 +- src/effects/Sk1DPathEffect.cpp | 1 - src/effects/Sk2DPathEffect.cpp | 1 - src/effects/SkAlphaThresholdFilter.cpp | 1 - src/effects/SkArithmeticMode.cpp | 4 +- src/effects/SkArithmeticMode_gpu.h | 4 +- src/effects/SkAvoidXfermode.cpp | 4 +- src/effects/SkBlurImageFilter.cpp | 2 +- src/effects/SkBlurMask.cpp | 1 - src/effects/SkBlurMaskFilter.cpp | 12 +- src/effects/SkColorFilterImageFilter.cpp | 2 +- src/effects/SkColorMatrix.cpp | 1 - src/effects/SkCornerPathEffect.cpp | 1 - src/effects/SkDiscretePathEffect.cpp | 1 - src/effects/SkDisplacementMapEffect.cpp | 1 - src/effects/SkEmbossMask.cpp | 1 - src/effects/SkEmbossMask.h | 1 - src/effects/SkEmbossMask_Table.h | 1 - src/effects/SkGpuBlurUtils.cpp | 4 +- src/effects/SkLayerDrawLooper.cpp | 1 - src/effects/SkLayerRasterizer.cpp | 1 - src/effects/SkLightingImageFilter.cpp | 6 +- src/effects/SkMergeImageFilter.cpp | 4 +- src/effects/SkMorphologyImageFilter.cpp | 3 +- src/effects/SkPackBits.h | 1 - src/effects/SkPictureImageFilter.cpp | 10 +- src/effects/SkPixelXorXfermode.cpp | 2 +- src/effects/SkTableMaskFilter.cpp | 1 - src/effects/SkXfermodeImageFilter.cpp | 1 - src/effects/gradients/SkGradientBitmapCache.cpp | 1 - src/effects/gradients/SkGradientBitmapCache.h | 1 - src/effects/gradients/SkRadialGradient.cpp | 1 - src/effects/gradients/SkRadialGradient.h | 1 - src/effects/gradients/SkSweepGradient.cpp | 1 - src/effects/gradients/SkSweepGradient.h | 1 - src/effects/gradients/SkTwoPointConicalGradient.h | 1 - .../gradients/SkTwoPointConicalGradient_gpu.cpp | 3 +- src/gpu/GrAuditTrail.cpp | 10 +- src/gpu/GrAutoLocaleSetter.h | 3 +- src/gpu/GrBlurUtils.cpp | 7 +- src/gpu/GrBufferAllocPool.cpp | 1 - src/gpu/GrCaps.cpp | 1 - src/gpu/GrClipMaskManager.cpp | 10 +- src/gpu/GrClipMaskManager.h | 2 +- src/gpu/GrContextFactory.cpp | 1 - src/gpu/GrDrawContext.cpp | 21 ++- src/gpu/GrDrawContextPriv.h | 3 +- src/gpu/GrDrawTarget.cpp | 11 +- src/gpu/GrDrawingManager.cpp | 4 +- src/gpu/GrDrawingManager.h | 2 +- src/gpu/GrFragmentProcessor.cpp | 2 - src/gpu/GrGpu.cpp | 1 - src/gpu/GrGpu.h | 4 +- src/gpu/GrGpuFactory.cpp | 1 - src/gpu/GrGpuResource.cpp | 3 +- src/gpu/GrGpuResourceCacheAccess.h | 3 +- src/gpu/GrGpuResourcePriv.h | 1 - src/gpu/GrImageIDTextureAdjuster.h | 2 +- src/gpu/GrInvariantOutput.cpp | 1 - src/gpu/GrLayerAtlas.cpp | 2 - src/gpu/GrLayerAtlas.h | 21 ++- src/gpu/GrLayerCache.h | 2 +- src/gpu/GrLayerHoister.h | 4 +- src/gpu/GrMemoryPool.cpp | 2 +- src/gpu/GrOvalRenderer.cpp | 18 +-- src/gpu/GrPLSGeometryProcessor.h | 2 +- src/gpu/GrPaint.cpp | 3 +- src/gpu/GrPath.cpp | 1 - src/gpu/GrPathRange.h | 2 +- src/gpu/GrPathRenderer.cpp | 1 - src/gpu/GrPathRenderer.h | 3 +- src/gpu/GrPathRendererChain.cpp | 1 - src/gpu/GrPipeline.cpp | 13 +- src/gpu/GrPipelineBuilder.cpp | 2 +- src/gpu/GrPipelineBuilder.h | 6 +- src/gpu/GrPrimitiveProcessor.h | 6 +- src/gpu/GrProcOptInfo.h | 2 +- src/gpu/GrProgramElement.cpp | 1 - src/gpu/GrRectanizer_pow2.cpp | 1 - src/gpu/GrRectanizer_skyline.cpp | 1 - src/gpu/GrRectanizer_skyline.h | 2 +- src/gpu/GrRenderTarget.cpp | 3 +- src/gpu/GrRenderTargetPriv.h | 2 +- src/gpu/GrResourceCache.cpp | 1 - src/gpu/GrResourceCache.h | 5 +- src/gpu/GrResourceProvider.cpp | 1 - src/gpu/GrSWMaskHelper.cpp | 2 +- src/gpu/GrSWMaskHelper.h | 2 +- src/gpu/GrSoftwarePathRenderer.cpp | 1 - src/gpu/GrSoftwarePathRenderer.h | 3 +- src/gpu/GrStencil.cpp | 1 - src/gpu/GrStencil.h | 1 - src/gpu/GrStencilAttachment.cpp | 1 - src/gpu/GrStencilAttachment.h | 3 +- src/gpu/GrStrokeInfo.cpp | 1 - src/gpu/GrTessellator.cpp | 10 +- src/gpu/GrTessellator.h | 4 +- src/gpu/GrTest.h | 1 - src/gpu/GrTexture.cpp | 1 - src/gpu/GrTraceMarker.cpp | 2 - src/gpu/GrTraceMarker.h | 1 - src/gpu/GrXferProcessor.cpp | 4 +- src/gpu/GrYUVProvider.cpp | 1 - src/gpu/SkGpuDevice.h | 1 - src/gpu/SkGpuDevice_drawTexture.cpp | 2 +- src/gpu/SkGr.cpp | 2 +- src/gpu/SkGrPixelRef.cpp | 1 - src/gpu/SkGrTexturePixelRef.cpp | 1 - src/gpu/batches/GrAAConvexPathRenderer.cpp | 5 +- src/gpu/batches/GrAAConvexPathRenderer.h | 1 - src/gpu/batches/GrAAConvexTessellator.cpp | 57 ++++---- src/gpu/batches/GrAAConvexTessellator.h | 17 ++- src/gpu/batches/GrAADistanceFieldPathRenderer.cpp | 7 +- src/gpu/batches/GrAADistanceFieldPathRenderer.h | 15 +- src/gpu/batches/GrAAFillRectBatch.cpp | 4 +- src/gpu/batches/GrAAHairLinePathRenderer.cpp | 2 +- src/gpu/batches/GrAAHairLinePathRenderer.h | 1 - .../batches/GrAALinearizingConvexPathRenderer.cpp | 3 +- .../batches/GrAALinearizingConvexPathRenderer.h | 1 - src/gpu/batches/GrAAStrokeRectBatch.cpp | 2 +- src/gpu/batches/GrAtlasTextBatch.cpp | 2 +- src/gpu/batches/GrAtlasTextBatch.h | 2 +- src/gpu/batches/GrBatch.h | 4 +- src/gpu/batches/GrDashLinePathRenderer.h | 1 - src/gpu/batches/GrDefaultPathRenderer.cpp | 2 +- src/gpu/batches/GrDrawAtlasBatch.cpp | 54 +++---- src/gpu/batches/GrDrawAtlasBatch.h | 10 +- src/gpu/batches/GrDrawBatch.h | 2 +- src/gpu/batches/GrDrawPathBatch.h | 2 +- src/gpu/batches/GrDrawVerticesBatch.cpp | 2 +- src/gpu/batches/GrDrawVerticesBatch.h | 2 +- src/gpu/batches/GrNinePatch.cpp | 2 +- src/gpu/batches/GrNonAAStrokeRectBatch.cpp | 2 +- src/gpu/batches/GrPLSPathRenderer.cpp | 120 ++++++++-------- src/gpu/batches/GrPLSPathRenderer.h | 23 ++- src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 3 +- src/gpu/batches/GrStencilAndCoverPathRenderer.h | 1 - src/gpu/batches/GrTInstanceBatch.h | 4 +- src/gpu/batches/GrTessellatingPathRenderer.cpp | 4 +- src/gpu/batches/GrTestBatch.h | 2 +- src/gpu/effects/GrBezierEffect.cpp | 1 - src/gpu/effects/GrCoverageSetOpXP.cpp | 8 +- src/gpu/effects/GrDashingEffect.cpp | 2 +- src/gpu/effects/GrDashingEffect.h | 1 - src/gpu/effects/GrDisableColorXP.cpp | 1 - src/gpu/effects/GrDisableColorXP.h | 1 - src/gpu/effects/GrDistanceFieldGeoProc.cpp | 12 +- src/gpu/effects/GrDistanceFieldGeoProc.h | 2 +- src/gpu/effects/GrMatrixConvolutionEffect.cpp | 2 +- src/gpu/effects/GrPorterDuffXferProcessor.cpp | 13 +- src/gpu/effects/GrTextureDomain.cpp | 2 +- src/gpu/effects/GrTextureDomain.h | 2 +- src/gpu/gl/GrGLAssembleInterface.cpp | 1 - src/gpu/gl/GrGLAssembleInterface.h | 1 - src/gpu/gl/GrGLCaps.cpp | 18 +-- src/gpu/gl/GrGLCaps.h | 2 +- src/gpu/gl/GrGLCreateNullInterface.cpp | 2 +- src/gpu/gl/GrGLDefines.h | 4 +- src/gpu/gl/GrGLGLSL.cpp | 1 - src/gpu/gl/GrGLGpu.cpp | 24 ++-- src/gpu/gl/GrGLGpu.h | 4 +- src/gpu/gl/GrGLGpuProgramCache.cpp | 2 +- src/gpu/gl/GrGLInterface.cpp | 8 +- src/gpu/gl/GrGLPath.cpp | 1 - src/gpu/gl/GrGLPath.h | 1 - src/gpu/gl/GrGLPathRange.cpp | 1 - src/gpu/gl/GrGLPathRange.h | 1 - src/gpu/gl/GrGLProgram.cpp | 2 +- src/gpu/gl/GrGLTestInterface.h | 2 +- src/gpu/gl/GrGLUniformHandler.cpp | 2 - src/gpu/gl/GrGLUniformHandler.h | 2 +- src/gpu/gl/GrGLVaryingHandler.h | 3 +- src/gpu/gl/GrGLVertexArray.cpp | 2 +- src/gpu/gl/SkGLContext.cpp | 3 +- src/gpu/gl/SkNullGLContext.cpp | 1 - .../android/GrGLCreateNativeInterface_android.cpp | 1 - src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp | 1 - src/gpu/gl/angle/SkANGLEGLContext.cpp | 1 - src/gpu/gl/builders/GrGLProgramBuilder.cpp | 1 - src/gpu/gl/builders/GrGLProgramBuilder.h | 4 +- .../gl/command_buffer/SkCommandBufferGLContext.cpp | 1 - src/gpu/gl/debug/GrBufferObj.cpp | 1 - src/gpu/gl/debug/GrBufferObj.h | 1 - src/gpu/gl/debug/GrFBBindableObj.h | 1 - src/gpu/gl/debug/GrFrameBufferObj.cpp | 1 - src/gpu/gl/debug/GrFrameBufferObj.h | 1 - src/gpu/gl/debug/GrGLCreateDebugInterface.cpp | 1 - src/gpu/gl/debug/GrProgramObj.cpp | 1 - src/gpu/gl/debug/GrProgramObj.h | 1 - src/gpu/gl/debug/GrRenderBufferObj.h | 1 - src/gpu/gl/debug/GrShaderObj.cpp | 1 - src/gpu/gl/debug/GrShaderObj.h | 1 - src/gpu/gl/debug/GrTextureObj.cpp | 1 - src/gpu/gl/debug/GrTextureObj.h | 1 - src/gpu/gl/debug/GrTextureUnitObj.cpp | 1 - src/gpu/gl/debug/SkDebugGLContext.cpp | 1 - src/gpu/gl/debug/SkDebugGLContext.h | 1 - src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp | 1 - src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp | 2 - src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp | 1 - src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp | 3 +- src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp | 1 - src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp | 1 - src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp | 1 - src/gpu/gl/mesa/SkMesaGLContext.cpp | 1 - src/gpu/gl/mesa/SkMesaGLContext.h | 1 - src/gpu/gl/mesa/osmesa_wrapper.h | 1 - src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp | 3 - src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp | 1 - src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp | 2 - src/gpu/glsl/GrGLSLBlend.cpp | 1 - src/gpu/glsl/GrGLSLCaps.cpp | 1 - src/gpu/glsl/GrGLSLCaps.h | 6 +- src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | 7 +- src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp | 1 - src/gpu/glsl/GrGLSLPLSPathRendering.h | 1 - src/gpu/glsl/GrGLSLProgramBuilder.cpp | 4 +- src/gpu/glsl/GrGLSLProgramBuilder.h | 2 +- src/gpu/glsl/GrGLSLProgramDataManager.cpp | 2 - src/gpu/glsl/GrGLSLShaderBuilder.cpp | 1 - src/gpu/glsl/GrGLSLUniformHandler.h | 1 - src/gpu/glsl/GrGLSLVarying.cpp | 1 - src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp | 1 - src/gpu/glsl/GrGLSLVertexShaderBuilder.h | 2 +- src/gpu/text/GrAtlasTextContext.cpp | 2 +- src/gpu/text/GrFontScaler.cpp | 1 - src/gpu/text/GrFontScaler.h | 16 +-- src/gpu/vk/GrVkBackendContext.cpp | 4 +- src/gpu/vk/GrVkBuffer.cpp | 1 - src/gpu/vk/GrVkCaps.cpp | 1 - src/gpu/vk/GrVkCaps.h | 2 +- src/gpu/vk/GrVkCommandBuffer.cpp | 6 +- src/gpu/vk/GrVkCommandBuffer.h | 3 +- src/gpu/vk/GrVkDescriptorPool.cpp | 2 +- src/gpu/vk/GrVkDescriptorPool.h | 2 +- src/gpu/vk/GrVkExtensions.cpp | 4 +- src/gpu/vk/GrVkExtensions.h | 4 +- src/gpu/vk/GrVkFramebuffer.cpp | 8 +- src/gpu/vk/GrVkGpu.cpp | 29 ++-- src/gpu/vk/GrVkGpu.h | 4 +- src/gpu/vk/GrVkImage.cpp | 4 +- src/gpu/vk/GrVkImageView.cpp | 8 +- src/gpu/vk/GrVkImageView.h | 2 +- src/gpu/vk/GrVkIndexBuffer.cpp | 1 - src/gpu/vk/GrVkInterface.cpp | 3 +- src/gpu/vk/GrVkMemory.cpp | 1 - src/gpu/vk/GrVkPipeline.cpp | 8 +- src/gpu/vk/GrVkPipeline.h | 2 +- src/gpu/vk/GrVkPipelineState.cpp | 2 +- src/gpu/vk/GrVkPipelineStateBuilder.cpp | 4 +- src/gpu/vk/GrVkPipelineStateDataManager.cpp | 3 +- src/gpu/vk/GrVkRenderPass.cpp | 3 +- src/gpu/vk/GrVkRenderTarget.cpp | 5 +- src/gpu/vk/GrVkRenderTarget.h | 4 +- src/gpu/vk/GrVkResource.h | 10 +- src/gpu/vk/GrVkResourceProvider.cpp | 4 +- src/gpu/vk/GrVkSampler.cpp | 3 +- src/gpu/vk/GrVkSampler.h | 1 - src/gpu/vk/GrVkStencilAttachment.cpp | 2 +- src/gpu/vk/GrVkTexture.cpp | 3 +- src/gpu/vk/GrVkTexture.h | 4 +- src/gpu/vk/GrVkTextureRenderTarget.cpp | 5 +- src/gpu/vk/GrVkTextureRenderTarget.h | 2 +- src/gpu/vk/GrVkUniformHandler.cpp | 1 - src/gpu/vk/GrVkUtil.cpp | 1 - src/gpu/vk/GrVkUtil.h | 1 - src/gpu/vk/GrVkVertexBuffer.cpp | 1 - src/images/SkGIFMovie.cpp | 1 - src/images/SkImageEncoder_Factory.cpp | 1 - src/images/SkJPEGWriteUtility.h | 1 - src/images/SkKTXImageEncoder.cpp | 2 +- src/images/SkMovie.cpp | 1 - src/images/SkMovie_FactoryDefault.cpp | 1 - src/images/transform_scanline.h | 1 - src/pdf/SkDeflate.cpp | 1 - src/pdf/SkJpegInfo.cpp | 2 - src/pdf/SkJpegInfo.h | 2 +- src/pdf/SkPDFDevice.cpp | 2 +- src/pdf/SkPDFFont.h | 3 +- src/pdf/SkPDFFontImpl.h | 1 - src/pdf/SkPDFFormXObject.cpp | 1 - src/pdf/SkPDFFormXObject.h | 1 - src/pdf/SkPDFGraphicState.h | 3 +- src/pdf/SkPDFShader.cpp | 1 - src/pdf/SkPDFShader.h | 1 - src/pdf/SkPDFStream.cpp | 1 - src/pdf/SkPDFStream.h | 3 +- src/pdf/SkPDFUtils.h | 1 - src/ports/SkDebug_win.cpp | 1 - src/ports/SkFontHost_mac.cpp | 1 - src/ports/SkImageEncoder_WIC.cpp | 3 +- src/ports/SkImageEncoder_none.cpp | 1 - src/ports/SkImageGeneratorCG.cpp | 10 +- src/ports/SkImageGeneratorCG.h | 2 +- src/ports/SkImageGeneratorWIC.h | 2 +- src/ports/SkOSEnvironment.cpp | 2 - src/ports/SkOSEnvironment.h | 2 - src/ports/SkOSLibrary.h | 2 - src/ports/SkOSLibrary_posix.cpp | 1 - src/ports/SkOSLibrary_win.cpp | 1 - src/svg/parser/SkSVG.cpp | 1 - src/svg/parser/SkSVGCircle.cpp | 1 - src/svg/parser/SkSVGCircle.h | 1 - src/svg/parser/SkSVGClipPath.cpp | 1 - src/svg/parser/SkSVGClipPath.h | 1 - src/svg/parser/SkSVGDefs.cpp | 1 - src/svg/parser/SkSVGDefs.h | 1 - src/svg/parser/SkSVGElements.cpp | 1 - src/svg/parser/SkSVGElements.h | 1 - src/svg/parser/SkSVGEllipse.cpp | 1 - src/svg/parser/SkSVGEllipse.h | 1 - src/svg/parser/SkSVGFeColorMatrix.cpp | 1 - src/svg/parser/SkSVGFeColorMatrix.h | 1 - src/svg/parser/SkSVGFilter.cpp | 1 - src/svg/parser/SkSVGFilter.h | 1 - src/svg/parser/SkSVGG.cpp | 1 - src/svg/parser/SkSVGG.h | 1 - src/svg/parser/SkSVGGradient.cpp | 1 - src/svg/parser/SkSVGGradient.h | 1 - src/svg/parser/SkSVGGroup.cpp | 1 - src/svg/parser/SkSVGGroup.h | 1 - src/svg/parser/SkSVGImage.cpp | 1 - src/svg/parser/SkSVGImage.h | 1 - src/svg/parser/SkSVGLine.cpp | 1 - src/svg/parser/SkSVGLine.h | 1 - src/svg/parser/SkSVGLinearGradient.cpp | 1 - src/svg/parser/SkSVGLinearGradient.h | 1 - src/svg/parser/SkSVGMask.cpp | 1 - src/svg/parser/SkSVGMask.h | 1 - src/svg/parser/SkSVGMetadata.cpp | 1 - src/svg/parser/SkSVGMetadata.h | 1 - src/svg/parser/SkSVGPaintState.cpp | 1 - src/svg/parser/SkSVGParser.cpp | 1 - src/svg/parser/SkSVGPath.cpp | 1 - src/svg/parser/SkSVGPath.h | 1 - src/svg/parser/SkSVGPolygon.cpp | 1 - src/svg/parser/SkSVGPolygon.h | 1 - src/svg/parser/SkSVGPolyline.cpp | 1 - src/svg/parser/SkSVGPolyline.h | 1 - src/svg/parser/SkSVGRadialGradient.cpp | 1 - src/svg/parser/SkSVGRadialGradient.h | 1 - src/svg/parser/SkSVGRect.cpp | 1 - src/svg/parser/SkSVGRect.h | 1 - src/svg/parser/SkSVGSVG.cpp | 1 - src/svg/parser/SkSVGSVG.h | 1 - src/svg/parser/SkSVGStop.cpp | 1 - src/svg/parser/SkSVGStop.h | 1 - src/svg/parser/SkSVGSymbol.cpp | 1 - src/svg/parser/SkSVGSymbol.h | 1 - src/svg/parser/SkSVGText.cpp | 1 - src/svg/parser/SkSVGText.h | 1 - src/svg/parser/SkSVGUse.cpp | 1 - src/svg/parser/SkSVGUse.h | 1 - src/utils/SkBase64.cpp | 1 - src/utils/SkBitSet.cpp | 1 - src/utils/SkBitSet.h | 1 - src/utils/SkBoundaryPatch.cpp | 1 - src/utils/SkCanvasStack.cpp | 1 - src/utils/SkCanvasStack.h | 1 - src/utils/SkDumpCanvas.cpp | 3 +- src/utils/SkInterpolator.cpp | 1 - src/utils/SkLayer.cpp | 1 - src/utils/SkMeshUtils.cpp | 1 - src/utils/SkNWayCanvas.cpp | 1 - src/utils/SkNinePatch.cpp | 1 - src/utils/SkParse.cpp | 1 - src/utils/SkParseColor.cpp | 1 - src/utils/SkParsePath.cpp | 1 - src/utils/SkPatchGrid.cpp | 32 ++--- src/utils/SkPatchGrid.h | 40 +++--- src/utils/SkPatchUtils.cpp | 50 +++---- src/utils/SkPatchUtils.h | 34 ++--- src/utils/SkTextBox.cpp | 1 - src/utils/SkTextureCompressor_ASTC.cpp | 18 +-- src/utils/SkTextureCompressor_Blitter.h | 12 +- src/utils/SkTextureCompressor_LATC.cpp | 8 +- src/utils/SkTextureCompressor_R11EAC.cpp | 12 +- src/utils/mac/SkCreateCGImageRef.cpp | 1 - src/utils/win/SkAutoCoInitialize.cpp | 1 - src/utils/win/SkIStream.cpp | 1 - src/utils/win/SkWGL.h | 1 - src/utils/win/SkWGL_win.cpp | 1 - src/views/SkEvent.cpp | 1 - src/views/SkEventSink.cpp | 1 - src/views/SkTagList.cpp | 1 - src/views/SkTagList.h | 1 - src/views/SkTouchGesture.cpp | 1 - src/views/SkViewPriv.cpp | 1 - src/views/SkViewPriv.h | 1 - src/views/mac/SkNSView.h | 1 - src/views/mac/SkOptionsTableView.h | 1 - src/views/mac/SkSampleNSView.h | 1 - src/views/mac/SkTextFieldCell.h | 1 - src/views/unix/SkOSWindow_Unix.cpp | 1 - src/views/unix/XkeysToSkKeys.h | 1 - src/views/unix/keysym2ucs.h | 1 - src/views/win/SkOSWindow_win.cpp | 5 +- src/views/win/skia_win.cpp | 2 - src/xml/SkBML_Verbs.h | 1 - src/xml/SkBML_XMLParser.cpp | 1 - src/xml/SkDOM.cpp | 1 - src/xml/SkXMLParser.cpp | 1 - src/xml/SkXMLPullParser.cpp | 1 - tests/AAClipTest.cpp | 2 +- tests/AnnotationTest.cpp | 1 - tests/BitmapCopyTest.cpp | 4 +- tests/BlurTest.cpp | 2 +- tests/CachedDataTest.cpp | 11 +- tests/CanvasTest.cpp | 2 +- tests/ClipBoundsTest.cpp | 1 - tests/CodexTest.cpp | 2 +- tests/ColorFilterTest.cpp | 6 +- tests/DataRefTest.cpp | 2 +- tests/FloatingPointTextureTest.cpp | 2 +- tests/FontMgrAndroidParserTest.cpp | 1 - tests/GLProgramsTest.cpp | 1 - tests/GeometryTest.cpp | 2 +- tests/GpuColorFilterTest.cpp | 1 - tests/GrDrawTargetTest.cpp | 1 - tests/GrPorterDuffTest.cpp | 19 ++- tests/GrTRecorderTest.cpp | 2 +- tests/GradientTest.cpp | 2 +- tests/ImageCacheTest.cpp | 2 +- tests/ImageFilterCacheTest.cpp | 1 - tests/ImageFilterTest.cpp | 3 +- tests/MatrixTest.cpp | 4 +- tests/MemsetTest.cpp | 2 +- tests/PaintTest.cpp | 1 - tests/PathOpsBattles.cpp | 2 +- tests/PathOpsBuilderConicTest.cpp | 4 +- tests/PathOpsConicIntersectionTest.cpp | 22 +-- tests/PathOpsConicLineIntersectionTest.cpp | 4 +- tests/PathOpsOpTest.cpp | 2 +- tests/PathOpsTSectDebug.h | 2 +- tests/PathOpsTestCommon.cpp | 2 +- tests/Point3Test.cpp | 4 +- tests/PointTest.cpp | 1 - tests/PremulAlphaRoundTripTest.cpp | 1 - tests/PrimitiveProcessorTest.cpp | 1 - tests/ReadPixelsTest.cpp | 2 +- tests/RecordReplaceDrawTest.cpp | 2 +- tests/RecordTest.cpp | 1 - tests/RectangleTextureTest.cpp | 2 +- tests/RefDictTest.cpp | 2 +- tests/RoundRectTest.cpp | 6 +- tests/SerializationTest.cpp | 13 +- tests/SpecialImageTest.cpp | 4 +- tests/StreamTest.cpp | 7 +- tests/SubsetPath.h | 6 +- tests/Test.h | 1 - tests/TestTest.cpp | 1 - tests/TextureCompressionTest.cpp | 2 +- tests/TopoSortTest.cpp | 3 +- tests/UtilsTest.cpp | 2 +- tests/VkClearTests.cpp | 1 - tests/VkUploadPixelsTests.cpp | 1 - tests/VkWrapTests.cpp | 1 - tests/Writer32Test.cpp | 6 +- third_party/ktx/ktx.cpp | 7 +- third_party/ktx/ktx.h | 1 - third_party/libsdl/linux/SDL_config.h | 2 +- third_party/libsdl/mac/SDL_config.h | 2 +- third_party/lua/src/lauxlib.h | 2 - third_party/lua/src/lctype.h | 1 - third_party/lua/src/ldo.h | 1 - third_party/lua/src/lmem.h | 1 - third_party/lua/src/lobject.h | 1 - third_party/lua/src/lstate.h | 1 - third_party/lua/src/luaconf.h | 1 - tools/VisualBench/VisualBench.cpp | 1 - tools/VisualBench/VisualInteractiveModule.cpp | 4 +- tools/android/SkAndroidSDKCanvas.cpp | 4 +- tools/android/SkAndroidSDKCanvas.h | 1 - tools/chrome_fuzz.cpp | 1 - tools/create_test_font.cpp | 6 +- tools/debugger/SkDebugCanvas.cpp | 8 +- tools/debugger/SkDebugCanvas.h | 7 +- tools/debugger/SkDrawCommand.cpp | 155 ++++++++++----------- tools/debugger/SkDrawCommand.h | 2 +- tools/debugger/SkObjectParser.cpp | 5 +- tools/gpuveto.cpp | 4 +- tools/imgblur.cpp | 4 +- tools/imgslice.cpp | 8 +- tools/lua/lua_pictures.cpp | 2 +- tools/pinspect.cpp | 2 +- tools/sk_tool_utils.cpp | 16 +-- tools/sk_tool_utils.h | 6 +- tools/skiaserve/Request.cpp | 7 +- tools/skiaserve/Request.h | 5 +- tools/skiaserve/skiaserve.cpp | 4 +- tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp | 1 - tools/skiaserve/urlhandlers/BatchesHandler.cpp | 3 +- tools/skiaserve/urlhandlers/BreakHandler.cpp | 1 - tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp | 1 - tools/skiaserve/urlhandlers/CmdHandler.cpp | 3 +- tools/skiaserve/urlhandlers/DataHandler.cpp | 1 - tools/skiaserve/urlhandlers/DownloadHandler.cpp | 1 - tools/skiaserve/urlhandlers/EnableGPUHandler.cpp | 1 - tools/skiaserve/urlhandlers/ImgHandler.cpp | 1 - tools/skiaserve/urlhandlers/InfoHandler.cpp | 1 - tools/skiaserve/urlhandlers/PostHandler.cpp | 3 +- tools/skiaserve/urlhandlers/RootHandler.cpp | 1 - tools/skiaserve/urlhandlers/UrlHandler.h | 3 +- tools/skpmaker.cpp | 6 +- tools/test_font_monospace.cpp | 1 - tools/test_font_sans_serif.cpp | 1 - tools/test_font_serif.cpp | 1 - 834 files changed, 1285 insertions(+), 1899 deletions(-) diff --git a/bench/BigPathBench.cpp b/bench/BigPathBench.cpp index f39fd73693..a2f3ae0133 100644 --- a/bench/BigPathBench.cpp +++ b/bench/BigPathBench.cpp @@ -84,4 +84,3 @@ DEF_BENCH( return new BigPathBench(kRight_Align, false); ) DEF_BENCH( return new BigPathBench(kLeft_Align, true); ) DEF_BENCH( return new BigPathBench(kMiddle_Align, true); ) DEF_BENCH( return new BigPathBench(kRight_Align, true); ) - diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp index 7211ae256a..789a725e11 100644 --- a/bench/BitmapRectBench.cpp +++ b/bench/BitmapRectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp index 29f0dfd1f3..58f9e89ffa 100644 --- a/bench/BlurBench.cpp +++ b/bench/BlurBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/BlurImageFilterBench.cpp b/bench/BlurImageFilterBench.cpp index f0a7a8eea0..2407a44d14 100644 --- a/bench/BlurImageFilterBench.cpp +++ b/bench/BlurImageFilterBench.cpp @@ -23,7 +23,7 @@ #define BLUR_SIGMA_LARGE 10.0f #define BLUR_SIGMA_HUGE 80.0f - + // When 'cropped' is set we apply a cropRect to the blurImageFilter. The crop rect is an inset of // the source's natural dimensions. This is intended to exercise blurring a larger source bitmap // to a smaller destination bitmap. diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp index 53cf2da1b5..774bafaf27 100644 --- a/bench/BlurRectBench.cpp +++ b/bench/BlurRectBench.cpp @@ -92,7 +92,7 @@ protected: SkMask mask; if (!SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()), &mask, r, kNormal_SkBlurStyle)) { - return; + return; } SkMask::FreeImage(mask.fImage); } diff --git a/bench/DashBench.cpp b/bench/DashBench.cpp index 43db54c092..ba1d66a42e 100644 --- a/bench/DashBench.cpp +++ b/bench/DashBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/FSRectBench.cpp b/bench/FSRectBench.cpp index cd9a36bab9..2d5abc21cd 100644 --- a/bench/FSRectBench.cpp +++ b/bench/FSRectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/GMBench.cpp b/bench/GMBench.cpp index 57f0d3c519..57b2316530 100644 --- a/bench/GMBench.cpp +++ b/bench/GMBench.cpp @@ -34,4 +34,3 @@ SkIPoint GMBench::onGetSize() { SkISize size = fGM->getISize(); return SkIPoint::Make(size.fWidth, size.fHeight); } - diff --git a/bench/GeometryBench.cpp b/bench/GeometryBench.cpp index d93578e45f..50985de764 100644 --- a/bench/GeometryBench.cpp +++ b/bench/GeometryBench.cpp @@ -97,7 +97,7 @@ protected: class GeoRectBench_Intersects : public GeoRectBench { public: GeoRectBench_Intersects() : GeoRectBench("rect_Intersects") {} - + protected: void onDraw(int loops, SkCanvas* canvas) override { for (int outer = 0; outer < loops; ++outer) { @@ -113,7 +113,7 @@ protected: class GeoRectBench_sort : public GeoRectBench { public: GeoRectBench_sort() : GeoRectBench("rect_sort") {} - + protected: void onDraw(int loops, SkCanvas* canvas) override { for (int outer = 0; outer < loops; ++outer) { @@ -243,4 +243,3 @@ protected: } }; DEF_BENCH( return new ChopCubicAt; ) - diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp index bc38035183..890bc96004 100644 --- a/bench/GrResourceCacheBench.cpp +++ b/bench/GrResourceCacheBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/GradientBench.cpp b/bench/GradientBench.cpp index 21ebdce7ab..1685c52089 100644 --- a/bench/GradientBench.cpp +++ b/bench/GradientBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp index 5e62eac660..a185fec589 100644 --- a/bench/MatrixBench.cpp +++ b/bench/MatrixBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -298,4 +297,3 @@ DEF_BENCH( return new MapPointsMatrixBench("mappoints_identity", SkMatrix::I()); DEF_BENCH( return new MapPointsMatrixBench("mappoints_trans", make_trans()); ) DEF_BENCH( return new MapPointsMatrixBench("mappoints_scale", make_scale()); ) DEF_BENCH( return new MapPointsMatrixBench("mappoints_affine", make_afine()); ) - diff --git a/bench/MemoryBench.cpp b/bench/MemoryBench.cpp index cd9afe4634..b775793ead 100644 --- a/bench/MemoryBench.cpp +++ b/bench/MemoryBench.cpp @@ -55,4 +55,3 @@ private: DEF_BENCH( return new ChunkAllocBench(64); ) DEF_BENCH( return new ChunkAllocBench(8*1024); ) - diff --git a/bench/MutexBench.cpp b/bench/MutexBench.cpp index d1d014d939..27ebee5a77 100644 --- a/bench/MutexBench.cpp +++ b/bench/MutexBench.cpp @@ -65,4 +65,3 @@ DEF_BENCH( return new MutexBench(SkString("SkSharedMutex")); ) DEF_BENCH( return new MutexBench(SkString("SkMutex")); ) DEF_BENCH( return new MutexBench(SkString("SkSpinlock")); ) DEF_BENCH( return new SharedBench; ) - diff --git a/bench/PatchBench.cpp b/bench/PatchBench.cpp index 5d7451a0c4..80d5ce0db1 100644 --- a/bench/PatchBench.cpp +++ b/bench/PatchBench.cpp @@ -12,11 +12,11 @@ #include "SkString.h" /** - * This bench measures the rendering time of the call SkCanvas::drawPatch with different types of - * input patches (regular case, with loops, a square, with a big difference between "parallel" - * sides). This bench also tests the different combination of optional parameters for the function + * This bench measures the rendering time of the call SkCanvas::drawPatch with different types of + * input patches (regular case, with loops, a square, with a big difference between "parallel" + * sides). This bench also tests the different combination of optional parameters for the function * (passing texture coordinates and colors, only textures coordinates, only colors or none). - * Finally, it applies a scale to test if the size affects the rendering time. + * Finally, it applies a scale to test if the size affects the rendering time. */ class PatchBench : public Benchmark { diff --git a/bench/PatchGridBench.cpp b/bench/PatchGridBench.cpp index 83e2932edc..db7865bb3b 100644 --- a/bench/PatchGridBench.cpp +++ b/bench/PatchGridBench.cpp @@ -13,34 +13,34 @@ #include "SkString.h" /** - * This bench measures the rendering time of a gridof patches. - * This bench also tests the different combination of optional parameters for the function + * This bench measures the rendering time of a gridof patches. + * This bench also tests the different combination of optional parameters for the function * (passing texture coordinates and colors, only textures coordinates, only colors or none). * Finally, it also has 3 possible sizes small, medium and big to test if the size of the patches - * in the grid affects time. + * in the grid affects time. */ class PatchGridBench : public Benchmark { - + public: - + enum Size { kSmall_Size, kMedium_Size, kBig_Size }; - + enum VertexMode { kNone_VertexMode, kColors_VertexMode, kTexCoords_VertexMode, kBoth_VertexMode }; - + PatchGridBench(Size size, VertexMode vertexMode) : fVertexMode(vertexMode) , fSize(size) { } - + void setScale(SkCanvas* canvas){ switch (fSize) { case kSmall_Size: @@ -54,7 +54,7 @@ public: break; } } - + void setGrid() { SkPoint vertices[4][5] = { {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, @@ -62,28 +62,28 @@ public: {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, {{100,300}, {150,350}, {250,350},{350,350},{450,350}} }; - + SkColor cornerColors[4][5] = { {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, }; - + SkPoint texCoords[4][5] = { {{0.0f,0.0f}, {1.0f,0.0f}, {2.0f,0.0f}, {3.0f,0.0f}, {4.0f,0.0f}}, {{0.0f,1.0f}, {1.0f,1.0f}, {2.0f,1.0f}, {3.0f,1.0f}, {4.0f,1.0f}}, {{0.0f,2.0f}, {1.0f,2.0f}, {2.0f,2.0f}, {3.0f,2.0f}, {4.0f,2.0f}}, {{0.0f,3.0f}, {1.0f,3.0f}, {2.0f,3.0f}, {3.0f,3.0f}, {4.0f,3.0f}}, }; - + SkPoint hrzCtrl[4][8] = { {{75,30},{125,45},{175,70},{225,20},{275,50},{325,50},{375,5},{425,90}}, {{75,150},{125,150},{175,150},{225,150},{275,150},{325,150},{375,150},{425,150}}, {{75,250},{125,250},{175,250},{225,250},{275,200},{325,150},{375,250},{425,250}}, {{75,350},{125,350},{175,350},{225,350},{275,350},{325,350},{375,350},{425,350}} }; - + SkPoint vrtCtrl[6][5] = { {{50,75},{150,75},{250,75},{350,75},{450,75}}, {{50,125},{150,125},{250,125},{350,125},{450,125}}, @@ -92,43 +92,43 @@ public: {{50,275},{150,275},{250,275},{350,275},{400,305}}, {{50,325},{150,325},{250,325},{350,325},{450,325}} }; - + static const int kRows = 3; static const int kCols = 4; - + fGrid.reset(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr); for (int i = 0; i < kRows; i++) { for (int j = 0; j < kCols; j++) { SkPoint points[12]; - + //set corners points[SkPatchUtils::kTopP0_CubicCtrlPts] = vertices[i][j]; points[SkPatchUtils::kTopP3_CubicCtrlPts] = vertices[i][j + 1]; points[SkPatchUtils::kBottomP0_CubicCtrlPts] = vertices[i + 1][j]; points[SkPatchUtils::kBottomP3_CubicCtrlPts] = vertices[i + 1][j + 1]; - + points[SkPatchUtils::kTopP1_CubicCtrlPts] = hrzCtrl[i][j * 2]; points[SkPatchUtils::kTopP2_CubicCtrlPts] = hrzCtrl[i][j * 2 + 1]; points[SkPatchUtils::kBottomP1_CubicCtrlPts] = hrzCtrl[i + 1][j * 2]; points[SkPatchUtils::kBottomP2_CubicCtrlPts] = hrzCtrl[i + 1][j * 2 + 1]; - + points[SkPatchUtils::kLeftP1_CubicCtrlPts] = vrtCtrl[i * 2][j]; points[SkPatchUtils::kLeftP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j]; points[SkPatchUtils::kRightP1_CubicCtrlPts] = vrtCtrl[i * 2][j + 1]; points[SkPatchUtils::kRightP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j + 1]; - + SkColor colors[4]; colors[0] = cornerColors[i][j]; colors[1] = cornerColors[i][j + 1]; colors[3] = cornerColors[i + 1][j]; colors[2] = cornerColors[i + 1][j + 1]; - + SkPoint texs[4]; texs[0] = texCoords[i][j]; texs[1] = texCoords[i][j + 1]; texs[3] = texCoords[i + 1][j]; texs[2] = texCoords[i + 1][j + 1]; - + switch (fVertexMode) { case kNone_VertexMode: fGrid.setPatch(j, i, points, nullptr, nullptr); @@ -148,7 +148,7 @@ public: } } } - + // override this method to change the shader sk_sp createShader() { const SkColor colors[] = { @@ -156,7 +156,7 @@ public: SK_ColorMAGENTA, SK_ColorBLUE, SK_ColorYELLOW, }; const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } }; - + return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); } @@ -180,7 +180,7 @@ protected: default: break; } - + SkString size; switch (fSize) { case kSmall_Size: @@ -198,7 +198,7 @@ protected: fName.printf("patch_grid_%s_%s", vertexMode.c_str(), size.c_str()); return fName.c_str(); } - + void onDelayedSetup() override { this->setGrid(); switch (fVertexMode) { @@ -225,7 +225,7 @@ protected: SkPatchGrid fGrid; VertexMode fVertexMode; Size fSize; - + typedef Benchmark INHERITED; }; diff --git a/bench/PathIterBench.cpp b/bench/PathIterBench.cpp index 5a8727feb5..cf93b5d503 100644 --- a/bench/PathIterBench.cpp +++ b/bench/PathIterBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/ReadPixBench.cpp b/bench/ReadPixBench.cpp index 7df5260dcc..b1061a1cde 100644 --- a/bench/ReadPixBench.cpp +++ b/bench/ReadPixBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp index 5bd5640eea..edd5ac7de2 100644 --- a/bench/RectBench.cpp +++ b/bench/RectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RectanizerBench.cpp b/bench/RectanizerBench.cpp index 9b7e3ae4e6..5bc6f11b6f 100644 --- a/bench/RectanizerBench.cpp +++ b/bench/RectanizerBench.cpp @@ -41,7 +41,7 @@ public: kSmallPow2_RectType }; - RectanizerBench(RectanizerType rectanizerType, RectType rectType) + RectanizerBench(RectanizerType rectanizerType, RectType rectType) : fName("rectanizer_") , fRectanizerType(rectanizerType) , fRectType(rectType) { diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp index 8554569e3d..f73a88889f 100644 --- a/bench/RegionBench.cpp +++ b/bench/RegionBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RepeatTileBench.cpp b/bench/RepeatTileBench.cpp index 452c2c0079..33e91780d9 100644 --- a/bench/RepeatTileBench.cpp +++ b/bench/RepeatTileBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RotatedRectBench.cpp b/bench/RotatedRectBench.cpp index 5ae0b1b97e..23e044330c 100644 --- a/bench/RotatedRectBench.cpp +++ b/bench/RotatedRectBench.cpp @@ -13,7 +13,7 @@ /** This benchmark tests rendering rotated rectangles. It can optionally apply AA and/or change the paint color between each rect in different ways using the ColorType enum. The xfermode used can - be specified as well. + be specified as well. */ enum ColorType { diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp index 0048c6e771..9d3b0ec277 100644 --- a/bench/ScalarBench.cpp +++ b/bench/ScalarBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/ShapesBench.cpp b/bench/ShapesBench.cpp index 2266cc381b..a658c453d1 100644 --- a/bench/ShapesBench.cpp +++ b/bench/ShapesBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/bench/SkLinearBitmapPipelineBench.cpp b/bench/SkLinearBitmapPipelineBench.cpp index 7ab29f699e..f111aeea9e 100644 --- a/bench/SkLinearBitmapPipelineBench.cpp +++ b/bench/SkLinearBitmapPipelineBench.cpp @@ -342,5 +342,3 @@ DEF_BENCH(return new SkBitmapFPGeneral( DEF_BENCH(return new SkBitmapFPOrigShader( srcSize, kLinear_SkColorProfileType, mR, true, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);) - - diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp index f2d7bd3968..04f824c700 100644 --- a/bench/TextBench.cpp +++ b/bench/TextBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp index 6d5a88f318..a350e7b4c4 100644 --- a/bench/TextBlobBench.cpp +++ b/bench/TextBlobBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/bench/TileBench.cpp b/bench/TileBench.cpp index 47e79c78d4..3093016f72 100644 --- a/bench/TileBench.cpp +++ b/bench/TileBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/TopoSortBench.cpp b/bench/TopoSortBench.cpp index 3fa1c0ff97..8a8ec66a61 100644 --- a/bench/TopoSortBench.cpp +++ b/bench/TopoSortBench.cpp @@ -76,4 +76,3 @@ private: /////////////////////////////////////////////////////////////////////////////// DEF_BENCH( return new TopoSortBench(); ) - diff --git a/bench/WriterBench.cpp b/bench/WriterBench.cpp index 115ffc1d42..78c5d8b485 100644 --- a/bench/WriterBench.cpp +++ b/bench/WriterBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/bench/Xfer4fBench.cpp b/bench/Xfer4fBench.cpp index bc234a7edb..ab04476cf2 100644 --- a/bench/Xfer4fBench.cpp +++ b/bench/Xfer4fBench.cpp @@ -22,7 +22,7 @@ public: , fFlags(flags & ~USE_AA) { fXfer.reset(SkXfermode::Create(mode)); - + fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle_D32Flag); fProcN = SkXfermode::GetD32Proc(fXfer, fFlags); fName.printf("xfer4f_%s_%s_%c_%s_%s", @@ -37,7 +37,7 @@ public: fDst[i] = 0; fAAStorage[i] = i * 255 / (N - 1); } - + if (flags & USE_AA) { fAA = fAAStorage; } else { diff --git a/bench/XferU64Bench.cpp b/bench/XferU64Bench.cpp index a57ba60ec1..90aa328b40 100644 --- a/bench/XferU64Bench.cpp +++ b/bench/XferU64Bench.cpp @@ -37,7 +37,7 @@ public: fDst[i] = 0; fAAStorage[i] = i * 255 / (N - 1); } - + if (flags & USE_AA) { fAA = fAAStorage; } else { diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp index f407c594a9..9eae7cef6c 100644 --- a/bench/XfermodeBench.cpp +++ b/bench/XfermodeBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/nanobenchAndroid.cpp b/bench/nanobenchAndroid.cpp index 7a166d45a0..cb6f09d654 100644 --- a/bench/nanobenchAndroid.cpp +++ b/bench/nanobenchAndroid.cpp @@ -49,5 +49,3 @@ bool HWUITarget::init(SkImageInfo info, Benchmark* bench) { bool HWUITarget::capturePixels(SkBitmap* bmp) { return this->renderer.capturePixels(bmp); } - - diff --git a/gm/aaclip.cpp b/gm/aaclip.cpp index fae6109378..1cb7157799 100644 --- a/gm/aaclip.cpp +++ b/gm/aaclip.cpp @@ -206,7 +206,7 @@ public: ClipCubicGM() { fVPath.moveTo(W, 0); fVPath.cubicTo(W, H-10, 0, 10, 0, H); - + SkMatrix pivot; pivot.setRotate(90, W/2, H/2); fVPath.transform(pivot, &fHPath); @@ -216,7 +216,7 @@ protected: SkString onShortName() override { return SkString("clipcubic"); } - + SkISize onISize() override { return SkISize::Make(400, 410); } @@ -224,10 +224,10 @@ protected: void doDraw(SkCanvas* canvas, const SkPath& path) { SkPaint paint; paint.setAntiAlias(true); - + paint.setColor(sk_tool_utils::color_to_565(0xFFCCCCCC)); canvas->drawPath(path, paint); - + paint.setColor(SK_ColorRED); paint.setStyle(SkPaint::kStroke_Style); canvas->drawPath(path, paint); @@ -242,7 +242,7 @@ protected: canvas->drawRect(r, paint); this->doDraw(canvas, path); - + canvas->translate(dx, dy); canvas->drawRect(r, paint); @@ -256,7 +256,7 @@ protected: canvas->translate(0, 200); this->drawAndClip(canvas, fHPath, 200, 0); } - + private: typedef skiagm::GM INHERITED; }; diff --git a/gm/aaxfermodes.cpp b/gm/aaxfermodes.cpp index 14073df538..f1264db964 100644 --- a/gm/aaxfermodes.cpp +++ b/gm/aaxfermodes.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -113,8 +112,8 @@ protected: kLabelSpacing + kShapeTypeSpacing * 1.5f + kShapeSpacing / 2, kSubtitleSpacing / 2 + fLabelPaint.getTextSize() / 3, fLabelPaint); canvas->drawText("Src Opaque", sizeof("Src Opaque") - 1, - kLabelSpacing + kShapeTypeSpacing * 1.5f + kShapeSpacing / 2 + - kPaintSpacing, kSubtitleSpacing / 2 + fLabelPaint.getTextSize() / 3, + kLabelSpacing + kShapeTypeSpacing * 1.5f + kShapeSpacing / 2 + + kPaintSpacing, kSubtitleSpacing / 2 + fLabelPaint.getTextSize() / 3, fLabelPaint); } diff --git a/gm/addarc.cpp b/gm/addarc.cpp index 0d1ea93133..9280140794 100644 --- a/gm/addarc.cpp +++ b/gm/addarc.cpp @@ -120,12 +120,12 @@ DEF_GM( return new AddArcMeasGM; ) class StrokeCircleGM : public skiagm::GM { public: StrokeCircleGM() : fRotate(0) {} - + protected: SkString onShortName() override { return SkString("strokecircle"); } - + SkISize onISize() override { return SkISize::Make(520, 520); } - + void onDraw(SkCanvas* canvas) override { canvas->scale(20, 20); canvas->translate(13, 13); @@ -176,12 +176,12 @@ static void html_canvas_arc(SkPath* path, SkScalar x, SkScalar y, SkScalar r, Sk class ManyArcsGM : public skiagm::GM { public: ManyArcsGM() {} - + protected: SkString onShortName() override { return SkString("manyarcs"); } - + SkISize onISize() override { return SkISize::Make(620, 330); } - + void onDraw(SkCanvas* canvas) override { SkPaint paint; paint.setAntiAlias(true); @@ -197,12 +197,12 @@ protected: for (size_t i = 0; i < SK_ARRAY_COUNT(sweepAngles); ++i) { sweepAngles[i] *= 180; } - + SkScalar startAngles[] = { -1, -0.5f, 0, 0.5f }; for (size_t i = 0; i < SK_ARRAY_COUNT(startAngles); ++i) { startAngles[i] *= 180; } - + bool anticlockwise = false; SkScalar sign = 1; for (size_t i = 0; i < SK_ARRAY_COUNT(startAngles) * 2; ++i) { @@ -225,9 +225,8 @@ protected: canvas->translate(0, 40); } } - + private: typedef skiagm::GM INHERITED; }; DEF_GM( return new ManyArcsGM; ) - diff --git a/gm/anisotropic.cpp b/gm/anisotropic.cpp index 66109267ea..3e573c4d36 100644 --- a/gm/anisotropic.cpp +++ b/gm/anisotropic.cpp @@ -60,7 +60,7 @@ protected: void onDraw(SkCanvas* canvas) override { SkScalar gScales[] = { 0.9f, 0.8f, 0.75f, 0.6f, 0.5f, 0.4f, 0.25f, 0.2f, 0.1f }; - + SkASSERT(kNumVertImages-1 == (int)SK_ARRAY_COUNT(gScales)/2); // Minimize vertically diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp index 5d26be8060..f609ba8aef 100644 --- a/gm/beziereffects.cpp +++ b/gm/beziereffects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp index 3a7a155b25..f24d072dfd 100644 --- a/gm/bigrrectaaeffect.cpp +++ b/gm/bigrrectaaeffect.cpp @@ -74,7 +74,7 @@ protected: for (size_t et = 0; et < SK_ARRAY_COUNT(kEdgeTypes); ++et) { GrPrimitiveEdgeType edgeType = kEdgeTypes[et]; canvas->save(); - canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); + canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); // Draw a background for the test case SkPaint paint; diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp index ac43db53a7..b52337b4bf 100644 --- a/gm/bitmapcopy.cpp +++ b/gm/bitmapcopy.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -78,7 +77,7 @@ protected: canvas->clear(sk_tool_utils::color_to_565(0xFFDDDDDD)); paint.setAntiAlias(true); sk_tool_utils::set_portable_typeface(&paint); - + SkScalar width = SkIntToScalar(40); SkScalar height = SkIntToScalar(40); if (paint.getFontSpacing() > height) { diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp index b7273288ac..2cded98236 100644 --- a/gm/bitmapfilters.cpp +++ b/gm/bitmapfilters.cpp @@ -131,19 +131,19 @@ class TestExtractAlphaGM : public skiagm::GM { fBitmap.extractAlpha(&fAlpha); } - + public: SkBitmap fBitmap, fAlpha; - + protected: SkString onShortName() override { return SkString("extractalpha"); } - + SkISize onISize() override { return SkISize::Make(540, 330); } - + void onDraw(SkCanvas* canvas) override { SkPaint paint; paint.setAntiAlias(true); @@ -153,9 +153,8 @@ protected: canvas->drawBitmap(fBitmap, 10, 10, &paint); // should stay blue (ignore paint's color) canvas->drawBitmap(fAlpha, 120, 10, &paint); // should draw red } - + private: typedef skiagm::GM INHERITED; }; DEF_GM( return new TestExtractAlphaGM; ) - diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp index bf06adbe1d..4853d03a52 100644 --- a/gm/bitmaprect.cpp +++ b/gm/bitmaprect.cpp @@ -281,4 +281,3 @@ DEF_GM( return new DrawBitmapRect3(); ) DEF_GM( return new DrawBitmapRect4(false); ) DEF_GM( return new DrawBitmapRect4(true); ) #endif - diff --git a/gm/bitmapshader.cpp b/gm/bitmapshader.cpp index 491905afb3..84d0b55445 100644 --- a/gm/bitmapshader.cpp +++ b/gm/bitmapshader.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/bleed.cpp b/gm/bleed.cpp index c3d026a6e8..bd1a282227 100644 --- a/gm/bleed.cpp +++ b/gm/bleed.cpp @@ -156,7 +156,7 @@ bool make_ringed_alpha_image(GrContext* ctx, TestPixels* result, int width, int /** Similar to make_ringed_bitmap with these modifications: - The backing store is a texture. - - The texture is larger than the bitmap dimensions (it is surrounded by non-content + - The texture is larger than the bitmap dimensions (it is surrounded by non-content padding on the right/bottom of the contents.) - The right/bottom sides of the rings are omitted so that the rect to draw is adjacent to the texture padding. diff --git a/gm/bmpfilterqualityrepeat.cpp b/gm/bmpfilterqualityrepeat.cpp index b32a99a454..6264d74df2 100644 --- a/gm/bmpfilterqualityrepeat.cpp +++ b/gm/bmpfilterqualityrepeat.cpp @@ -39,7 +39,7 @@ protected: void onDraw(SkCanvas* canvas) override { - static const struct { + static const struct { SkFilterQuality fQuality; const char* fName; } kQualities[] = { diff --git a/gm/circles.cpp b/gm/circles.cpp index d9b25c0df3..dd37a61d5d 100644 --- a/gm/circles.cpp +++ b/gm/circles.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Intel Inc. * @@ -155,7 +154,7 @@ protected: giantPaint.setAntiAlias(true); giantPaint.setColor(0x80808080); canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPaint); - + SkRandom rand; canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); int i; diff --git a/gm/circularclips.cpp b/gm/circularclips.cpp index 15f583f67d..2691971398 100644 --- a/gm/circularclips.cpp +++ b/gm/circularclips.cpp @@ -60,7 +60,7 @@ protected: canvas->drawRect(rect, fillPaint); canvas->restore(); - + fillPaint.setColor(0xFF000000); for (size_t i = 0; i < 4; i++) { diff --git a/gm/color4f.cpp b/gm/color4f.cpp index 7704dee458..2585ad87c1 100644 --- a/gm/color4f.cpp +++ b/gm/color4f.cpp @@ -53,7 +53,7 @@ static void draw_into_canvas(SkCanvas* canvas) { const SkRect r = SkRect::MakeWH(50, 100); sk_sp (*shaders[])() { make_opaque_color, make_alpha_color }; sk_sp (*filters[])() { make_cf_null, make_cf0, make_cf1, make_cf2 }; - + SkPaint paint; for (auto shProc : shaders) { paint.setShader(shProc()); diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp index 8ac15dba8e..202f72ab12 100644 --- a/gm/colormatrix.cpp +++ b/gm/colormatrix.cpp @@ -35,7 +35,7 @@ protected: SkISize onISize() override { return SkISize::Make(WIDTH, HEIGHT); } - + void onOnceBeforeDraw() override { fSolidImg = CreateSolidBitmap(64, 64); fTransparentImg = CreateTransparentBitmap(64, 64); @@ -145,4 +145,3 @@ private: typedef skiagm::GM INHERITED; }; DEF_GM( return new ColorMatrixGM; ) - diff --git a/gm/complexclip.cpp b/gm/complexclip.cpp index bcbd7fd17a..7708efe554 100644 --- a/gm/complexclip.cpp +++ b/gm/complexclip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/complexclip3.cpp b/gm/complexclip3.cpp index ae07d8e274..67916caf76 100644 --- a/gm/complexclip3.cpp +++ b/gm/complexclip3.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -26,7 +25,7 @@ protected: SkString str; str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex"); return str; - } + } SkISize onISize() { return SkISize::Make(1000, 950); } diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp index c43b443a07..421641c356 100644 --- a/gm/composeshader.cpp +++ b/gm/composeshader.cpp @@ -204,7 +204,7 @@ protected: canvas->translate(0, r.height() + 5); } } - + private: /** This determines the length and width of the bitmaps used in the ComposeShaders. Values * above 20 may cause an SkASSERT to fail in SkSmallAllocator. However, larger values will diff --git a/gm/conicpaths.cpp b/gm/conicpaths.cpp index 91c337f926..9e4e9cea9d 100644 --- a/gm/conicpaths.cpp +++ b/gm/conicpaths.cpp @@ -120,7 +120,7 @@ protected: } canvas->restore(); - this->drawGiantCircle(canvas); + this->drawGiantCircle(canvas); } private: diff --git a/gm/convex_all_line_paths.cpp b/gm/convex_all_line_paths.cpp index 3eae959a65..eb4bdcfd05 100644 --- a/gm/convex_all_line_paths.cpp +++ b/gm/convex_all_line_paths.cpp @@ -28,7 +28,7 @@ namespace skiagm { // paths class ConvexLineOnlyPathsGM : public GM { public: - ConvexLineOnlyPathsGM() { + ConvexLineOnlyPathsGM() { this->setBGColor(0xFFFFFFFF); } @@ -284,7 +284,7 @@ protected: void onDraw(SkCanvas* canvas) override { // the right edge of the last drawn path - SkPoint offset = { 0, SkScalarHalf(kMaxPathHeight) }; + SkPoint offset = { 0, SkScalarHalf(kMaxPathHeight) }; for (int i = 0; i < kNumPaths; ++i) { this->drawPath(canvas, i, &offset); diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp index 4180884e66..50939f9183 100644 --- a/gm/convexpaths.cpp +++ b/gm/convexpaths.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp index ff83a26225..0c8e291c31 100644 --- a/gm/convexpolyclip.cpp +++ b/gm/convexpolyclip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp index 412e47893d..aec571bcd6 100644 --- a/gm/convexpolyeffect.cpp +++ b/gm/convexpolyeffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/gm/dashing.cpp b/gm/dashing.cpp index 6cb1dea66c..95fc15a9fc 100644 --- a/gm/dashing.cpp +++ b/gm/dashing.cpp @@ -12,7 +12,7 @@ static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint, SkScalar finalX = SkIntToScalar(600), SkScalar finalY = SkIntToScalar(0), - SkScalar phase = SkIntToScalar(0), + SkScalar phase = SkIntToScalar(0), SkScalar startX = SkIntToScalar(0), SkScalar startY = SkIntToScalar(0)) { SkPaint p(paint); @@ -453,8 +453,8 @@ protected: paint.setStrokeWidth(SkIntToScalar(phase+1)); paint.setColor(gColors[phase]); sign = (x % 20) ? 1 : -1; - drawline(canvas, kOn, kOff, paint, - SkIntToScalar(x), -sign * SkIntToScalar(10003), + drawline(canvas, kOn, kOff, paint, + SkIntToScalar(x), -sign * SkIntToScalar(10003), SkIntToScalar(phase), SkIntToScalar(x), sign * SkIntToScalar(10003)); phase = (phase + 1) % kIntervalLength; @@ -464,8 +464,8 @@ protected: paint.setStrokeWidth(SkIntToScalar(phase+1)); paint.setColor(gColors[phase]); sign = (y % 20) ? 1 : -1; - drawline(canvas, kOn, kOff, paint, - -sign * SkIntToScalar(10003), SkIntToScalar(y), + drawline(canvas, kOn, kOff, paint, + -sign * SkIntToScalar(10003), SkIntToScalar(y), SkIntToScalar(phase), sign * SkIntToScalar(10003), SkIntToScalar(y)); phase = (phase + 1) % kIntervalLength; diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp index ed2b058e51..487f7671ee 100644 --- a/gm/dcshader.cpp +++ b/gm/dcshader.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/gm/distantclip.cpp b/gm/distantclip.cpp index fd96564057..9276dadc53 100644 --- a/gm/distantclip.cpp +++ b/gm/distantclip.cpp @@ -1,5 +1,4 @@ - /* * Copyright 2012 Google Inc. * @@ -46,8 +45,8 @@ protected: sk_sp pict(recorder.finishRecordingAsPicture()); // Next we play that picture into another picture of the same size. - pict->playback(recorder.beginRecording(pict->cullRect().width(), - pict->cullRect().height(), + pict->playback(recorder.beginRecording(pict->cullRect().width(), + pict->cullRect().height(), nullptr, 0)); sk_sp pict2(recorder.finishRecordingAsPicture()); diff --git a/gm/drawatlas.cpp b/gm/drawatlas.cpp index 334aba7af1..a906cbedeb 100644 --- a/gm/drawatlas.cpp +++ b/gm/drawatlas.cpp @@ -39,17 +39,17 @@ class DrawAtlasGM : public skiagm::GM { public: DrawAtlasGM() {} - + protected: - + SkString onShortName() override { return SkString("draw-atlas"); } - + SkISize onISize() override { return SkISize::Make(640, 480); } - + void onDraw(SkCanvas* canvas) override { const SkRect target = { 50, 50, 80, 90 }; if (nullptr == fAtlas) { @@ -61,7 +61,7 @@ protected: SkScalar fDegrees; SkScalar fTx; SkScalar fTy; - + void apply(SkRSXform* xform) const { const SkScalar rad = SkDegreesToRadians(fDegrees); xform->fSCos = fScale * SkScalarCos(rad); @@ -95,9 +95,8 @@ protected: canvas->translate(0, 100); canvas->drawAtlas(fAtlas.get(), xform, tex, colors, N, SkXfermode::kSrcIn_Mode, nullptr, &paint); } - + private: typedef GM INHERITED; }; DEF_GM( return new DrawAtlasGM; ) - diff --git a/gm/drawatlascolor.cpp b/gm/drawatlascolor.cpp index e8fd23608c..0e85055402 100644 --- a/gm/drawatlascolor.cpp +++ b/gm/drawatlascolor.cpp @@ -29,22 +29,22 @@ static sk_sp make_atlas(SkCanvas* caller, int atlasSize) { paint.setXfermode(SkXfermode::Create(SkXfermode::kSrc_Mode)); paint.setColor(SK_ColorWHITE); - SkRect r = SkRect::MakeXYWH(0, 0, + SkRect r = SkRect::MakeXYWH(0, 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize)); canvas->drawRect(r, paint); paint.setColor(SK_ColorRED); - r = SkRect::MakeXYWH(SkIntToScalar(kBlockSize), 0, + r = SkRect::MakeXYWH(SkIntToScalar(kBlockSize), 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize)); canvas->drawRect(r, paint); paint.setColor(SK_ColorGREEN); - r = SkRect::MakeXYWH(0, SkIntToScalar(kBlockSize), + r = SkRect::MakeXYWH(0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize)); canvas->drawRect(r, paint); paint.setColor(SK_ColorTRANSPARENT); - r = SkRect::MakeXYWH(SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize), + r = SkRect::MakeXYWH(SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize)); canvas->drawRect(r, paint); @@ -58,17 +58,17 @@ public: DrawAtlasColorsGM() { this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC)); } - + protected: SkString onShortName() override { return SkString("draw-atlas-colors"); } - + SkISize onISize() override { return SkISize::Make(kNumXferModes * (kAtlasSize + kPad) + kPad, 2 * kNumColors * (kAtlasSize + kPad) + kTextPad + kPad); } - + void onDraw(SkCanvas* canvas) override { const SkRect target = SkRect::MakeWH(SkIntToScalar(kAtlasSize), SkIntToScalar(kAtlasSize)); @@ -147,7 +147,7 @@ protected: } for (int i = 0; i < numModes; ++i) { - canvas->save(); + canvas->save(); canvas->translate(SkIntToScalar(i*(target.height()+kPad)), SkIntToScalar(kTextPad+kPad)); // w/o a paint @@ -157,10 +157,10 @@ protected: // w a paint canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors, gModes[i].fMode, nullptr, &paint); - canvas->restore(); + canvas->restore(); } } - + private: static const int kNumXferModes = 29; static const int kNumColors = 4; @@ -174,4 +174,3 @@ private: typedef GM INHERITED; }; DEF_GM( return new DrawAtlasColorsGM; ) - diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp index 883e81b417..7d830475fa 100644 --- a/gm/drawbitmaprect.cpp +++ b/gm/drawbitmaprect.cpp @@ -35,7 +35,7 @@ static SkBitmap make_chessbm(int w, int h) { static sk_sp makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, int h) { SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); - + auto surface(origCanvas->makeSurface(info)); if (nullptr == surface) { // picture canvas will return null, so fall-back to raster @@ -88,7 +88,7 @@ static sk_sp makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, in #if SK_SUPPORT_GPU if (GrTexture* texture = as_IB(image)->peekTexture()) { GrWrapTextureInBitmap(texture, image->width(), image->height(), image->isOpaque(), &tempBM); - } else + } else #endif { image->asLegacyBitmap(&tempBM, SkImage::kRO_LegacyBitmapMode); diff --git a/gm/drawminibitmaprect.cpp b/gm/drawminibitmaprect.cpp index f5164f78de..073d5a1ce3 100644 --- a/gm/drawminibitmaprect.cpp +++ b/gm/drawminibitmaprect.cpp @@ -140,4 +140,3 @@ private: DEF_GM( return new DrawMiniBitmapRectGM(true); ) DEF_GM( return new DrawMiniBitmapRectGM(false); ) - diff --git a/gm/dstreadshuffle.cpp b/gm/dstreadshuffle.cpp index 8ff40a8bec..4f0f071b0a 100644 --- a/gm/dstreadshuffle.cpp +++ b/gm/dstreadshuffle.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/emptypath.cpp b/gm/emptypath.cpp index 5afb3d5f63..aadb94dfce 100644 --- a/gm/emptypath.cpp +++ b/gm/emptypath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -201,7 +200,7 @@ protected: canvas->translate(0, 40); } } - + private: typedef GM INHERITED; }; diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp index 9e84024897..bcecff9379 100644 --- a/gm/filterfastbounds.cpp +++ b/gm/filterfastbounds.cpp @@ -298,14 +298,14 @@ protected: for (int i = 0; i < (int)SK_ARRAY_COUNT(gDrawMthds) + kNumXtraCols; ++i) { canvas->drawLine(SkIntToScalar(i * kTileWidth), 0, - SkIntToScalar(i * kTileWidth), + SkIntToScalar(i * kTileWidth), SkIntToScalar(paints.count() * kTileWidth), blackFill); } // A column of saveLayers with PictureImageFilters for (int i = 0; i < pifPaints.count(); ++i) { - draw_savelayer_with_paint(SkIPoint::Make(0, i*kTileHeight), + draw_savelayer_with_paint(SkIPoint::Make(0, i*kTileHeight), canvas, pifPaints[i]); } diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp index 67be00d0ac..dd8b14d278 100644 --- a/gm/fontmgr.cpp +++ b/gm/fontmgr.cpp @@ -262,7 +262,7 @@ protected: paint.setTextSkewX(fSkewX); const SkColor boundsColors[2] = { SK_ColorRED, SK_ColorBLUE }; - + SkFontMgr* fm = fFM; int count = SkMin32(fm->countFamilies(), 32); diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp index e978b6bc05..bc5feb3375 100644 --- a/gm/gammatext.cpp +++ b/gm/gammatext.cpp @@ -115,7 +115,7 @@ static void set_face(SkPaint* paint) { static void draw_pair(SkCanvas* canvas, SkPaint* paint, const sk_sp& shader) { const char text[] = "Now is the time for all good"; const size_t len = strlen(text); - + paint->setShader(nullptr); canvas->drawText(text, len, 10, 20, *paint); paint->setShader(SkShader::MakeColorShader(paint->getColor())); @@ -140,7 +140,7 @@ protected: SkString onShortName() override { return SkString("gammagradienttext"); } - + SkISize onISize() override { return SkISize::Make(300, 300); } @@ -164,10 +164,9 @@ protected: canvas->translate(0, 80); } } - + private: typedef skiagm::GM INHERITED; }; DEF_GM( return new GammaShaderTextGM; ) - diff --git a/gm/gm.cpp b/gm/gm.cpp index ebdc4f183c..e0cb8b8772 100644 --- a/gm/gm.cpp +++ b/gm/gm.cpp @@ -107,4 +107,3 @@ SkISize skiagm::SimpleGM::onISize() { SkString skiagm::SimpleGM::onShortName() { return fName; } - diff --git a/gm/gradientDirtyLaundry.cpp b/gm/gradientDirtyLaundry.cpp index 3fca7f276c..6b16be9f01 100644 --- a/gm/gradientDirtyLaundry.cpp +++ b/gm/gradientDirtyLaundry.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/gradients.cpp b/gm/gradients.cpp index 29d0f31e96..11c27baeca 100644 --- a/gm/gradients.cpp +++ b/gm/gradients.cpp @@ -510,7 +510,7 @@ protected: paint.setDither(fDither); canvas->drawRect(SkRect::MakeWH(500, 500), paint); } - + private: sk_sp fShader; bool fDither; @@ -548,7 +548,7 @@ protected: paint.setShader(fShader); canvas->drawRect(SkRect::MakeWH(500, 500), paint); } - + private: sk_sp fShader; bool fDither; @@ -600,7 +600,7 @@ protected: (index + 1) * kHeight), paint); } } - + private: sk_sp fShader[100]; bool fDither; diff --git a/gm/image.cpp b/gm/image.cpp index c86be079d9..5333b1725d 100644 --- a/gm/image.cpp +++ b/gm/image.cpp @@ -291,7 +291,7 @@ protected: canvas->translate(0, 120); } } - + private: typedef skiagm::GM INHERITED; }; diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp index 32092213dc..fd7ac2adb1 100644 --- a/gm/image_pict.cpp +++ b/gm/image_pict.cpp @@ -373,6 +373,3 @@ DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); ) #if SK_SUPPORT_GPU DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); ) #endif - - - diff --git a/gm/image_shader.cpp b/gm/image_shader.cpp index 5fed7d1344..214b05d80c 100644 --- a/gm/image_shader.cpp +++ b/gm/image_shader.cpp @@ -124,4 +124,3 @@ private: typedef skiagm::GM INHERITED; }; DEF_GM( return new ImageShaderGM; ) - diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp index ca8a2d421a..d580243453 100644 --- a/gm/imagefiltersbase.cpp +++ b/gm/imagefiltersbase.cpp @@ -298,7 +298,7 @@ protected: canvas->translate(0, 200); } } - + private: typedef GM INHERITED; }; @@ -322,4 +322,3 @@ public: } }; DEF_GM( return new ImageFiltersText_CF; ) - diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp index 21d070456b..b0c55dca73 100644 --- a/gm/imagefiltersscaled.cpp +++ b/gm/imagefiltersscaled.cpp @@ -60,8 +60,8 @@ protected: noisePaint.setShader(noise); SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10)); - SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10), - SkIntToScalar(-10), + SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10), + SkIntToScalar(-10), SkIntToScalar(20)); SkPoint3 spotTarget = SkPoint3::Make(SkIntToScalar(40), SkIntToScalar(40), 0); SkScalar spotExponent = SK_Scalar1; diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp index 0d2637cabe..c3184be1dd 100644 --- a/gm/imagefromyuvtextures.cpp +++ b/gm/imagefromyuvtextures.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -102,7 +101,7 @@ protected: for (int i = 0; i < 3; ++i) { SkASSERT(fYUVBmps[i].width() == SkToInt(fYUVBmps[i].rowBytes())); yuvHandles[i] = gpu->createTestingOnlyBackendTexture(fYUVBmps[i].getPixels(), - fYUVBmps[i].width(), + fYUVBmps[i].width(), fYUVBmps[i].height(), kAlpha_8_GrPixelConfig); } diff --git a/gm/imagesource2.cpp b/gm/imagesource2.cpp index db8a9f69c4..3a3d27360d 100644 --- a/gm/imagesource2.cpp +++ b/gm/imagesource2.cpp @@ -47,7 +47,7 @@ protected: int curColor = 0; for (int x = 0; x < kImageSize; x += 3) { - SkRect r = SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(0), + SkRect r = SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(0), SkIntToScalar(3), SkIntToScalar(kImageSize)); SkPaint p; p.setColor(gColors[curColor]); diff --git a/gm/internal_links.cpp b/gm/internal_links.cpp index bc1dc24462..995cd69d42 100644 --- a/gm/internal_links.cpp +++ b/gm/internal_links.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/lcdblendmodes.cpp b/gm/lcdblendmodes.cpp index 874714b7fc..8ac944980a 100644 --- a/gm/lcdblendmodes.cpp +++ b/gm/lcdblendmodes.cpp @@ -6,7 +6,7 @@ */ -/* +/* * Tests text rendering with LCD and the various blend modes. */ @@ -40,7 +40,7 @@ public: const int kPointSize = 25; fTextHeight = SkIntToScalar(kPointSize); } - + protected: SkString onShortName() override { return SkString("lcdblendmodes"); @@ -49,9 +49,9 @@ protected: void onOnceBeforeDraw() override { fCheckerboard = sk_tool_utils::create_checkerboard_shader(SK_ColorBLACK, SK_ColorWHITE, 4); } - + SkISize onISize() override { return SkISize::Make(kWidth, kHeight); } - + void onDraw(SkCanvas* canvas) override { SkPaint p; p.setAntiAlias(false); @@ -142,7 +142,7 @@ protected: y+=fTextHeight; } } - + private: SkScalar fTextHeight; sk_sp fCheckerboard; diff --git a/gm/lcdtext.cpp b/gm/lcdtext.cpp index a2bfa01d38..978bfd641e 100644 --- a/gm/lcdtext.cpp +++ b/gm/lcdtext.cpp @@ -23,19 +23,19 @@ public: const int pointSize = 36; textHeight = SkIntToScalar(pointSize); } - + protected: - + SkString onShortName() { SkString name("lcdtext"); name.append(sk_tool_utils::major_platform_os_name()); return name; } - + SkISize onISize() { return SkISize::Make(640, 480); } - + virtual void onDraw(SkCanvas* canvas) { - + y = textHeight; drawText(canvas, SkString("TEXT: SubpixelTrue LCDRenderTrue"), true, true); @@ -46,7 +46,7 @@ protected: drawText(canvas, SkString("TEXT: SubpixelFalse LCDRenderFalse"), false, false); } - + void drawText(SkCanvas* canvas, const SkString& string, bool subpixelTextEnabled, bool lcdRenderTextEnabled) { SkPaint paint; @@ -56,11 +56,11 @@ protected: paint.setSubpixelText(subpixelTextEnabled); paint.setLCDRenderText(lcdRenderTextEnabled); paint.setTextSize(textHeight); - + canvas->drawText(string.c_str(), string.size(), 0, y, paint); y += textHeight; } - + private: typedef skiagm::GM INHERITED; SkScalar y, textHeight; @@ -85,14 +85,14 @@ class LcdTextSizeGM : public skiagm::GM { public: LcdTextSizeGM() {} - + protected: SkString onShortName() { return SkString("lcdtextsize"); } - + SkISize onISize() { return SkISize::Make(320, 120); } - + virtual void onDraw(SkCanvas* canvas) { const char* lcd_text = "LCD"; const char* gray_text = "GRAY"; diff --git a/gm/lightingshader.cpp b/gm/lightingshader.cpp index 6d25671ac2..54f698a753 100644 --- a/gm/lightingshader.cpp +++ b/gm/lightingshader.cpp @@ -92,7 +92,7 @@ protected: SkMatrix matrix; matrix.setRectToRect(bitmapBounds, r, SkMatrix::kFill_ScaleToFit); - + const SkMatrix& ctm = canvas->getTotalMatrix(); // TODO: correctly pull out the pure rotation diff --git a/gm/localmatriximagefilter.cpp b/gm/localmatriximagefilter.cpp index dd86c967f9..d53380b858 100644 --- a/gm/localmatriximagefilter.cpp +++ b/gm/localmatriximagefilter.cpp @@ -99,4 +99,3 @@ private: typedef GM INHERITED; }; DEF_GM( return new LocalMatrixImageFilterGM; ) - diff --git a/gm/mipmap.cpp b/gm/mipmap.cpp index 9a0f060162..ae73a8de9d 100644 --- a/gm/mipmap.cpp +++ b/gm/mipmap.cpp @@ -47,4 +47,3 @@ DEF_SIMPLE_GM(mipmap, canvas, 400, 200) { } canvas->drawImage(img.get(), 20, 20, nullptr); } - diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp index 03934a601d..787646f6d8 100644 --- a/gm/multipicturedraw.cpp +++ b/gm/multipicturedraw.cpp @@ -424,7 +424,7 @@ static void tiled(SkCanvas* finalCanvas, SkMultiPictureDraw* mpd, SkCanvas* subCanvas = step.fSurf->getCanvas(); - const SkMatrix trans = SkMatrix::MakeTrans(-SkIntToScalar(x*kTileWidth), + const SkMatrix trans = SkMatrix::MakeTrans(-SkIntToScalar(x*kTileWidth), -SkIntToScalar(y*kTileHeight)); create_content(mpd, pfGen, pictures, subCanvas, trans); @@ -518,7 +518,7 @@ namespace skiagm { SkString onShortName() override { static const char* gContentNames[] = { - "noclip", "rectclip", "rrectclip", "pathclip", + "noclip", "rectclip", "rrectclip", "pathclip", "invpathclip", "sierpinski", "biglayer" }; static const char* gLayoutNames[] = { "simple", "tiled" }; diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp index 9b0b94ec27..4c6e7d2742 100644 --- a/gm/ninepatchstretch.cpp +++ b/gm/ninepatchstretch.cpp @@ -110,4 +110,3 @@ private: typedef skiagm::GM INHERITED; }; DEF_GM( return new NinePatchStretchGM; ) - diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp index dd33d9db7c..11da041fd7 100644 --- a/gm/offsetimagefilter.cpp +++ b/gm/offsetimagefilter.cpp @@ -34,7 +34,7 @@ protected: void onOnceBeforeDraw() override { fBitmap = SkImage::MakeFromBitmap( sk_tool_utils::create_string_bitmap(80, 80, 0xD000D000, 15, 65, 96, "e")); - + fCheckerboard = SkImage::MakeFromBitmap( sk_tool_utils::create_checkerboard_bitmap(80, 80, sk_tool_utils::color_to_565(0xFFA0A0A0), @@ -103,14 +103,14 @@ DEF_GM( return new OffsetImageFilterGM; ) class SimpleOffsetImageFilterGM : public skiagm::GM { public: SimpleOffsetImageFilterGM() {} - + protected: SkString onShortName() override { return SkString("simple-offsetimagefilter"); } - + SkISize onISize() override { return SkISize::Make(640, 200); } - + void doDraw(SkCanvas* canvas, const SkRect& r, SkImageFilter* imgf, const SkRect* clipR = nullptr) { SkPaint p; @@ -157,22 +157,22 @@ protected: SkImageFilter::CropRect cr2(r2); canvas->translate(40, 40); - + canvas->save(); this->doDraw(canvas, r, nullptr); - + canvas->translate(100, 0); this->doDraw(canvas, r, SkOffsetImageFilter::Create(20, 20)); - + canvas->translate(100, 0); this->doDraw(canvas, r, SkOffsetImageFilter::Create(20, 20, nullptr, &cr0)); - + canvas->translate(100, 0); this->doDraw(canvas, r, SkOffsetImageFilter::Create(20, 20), &r); - + canvas->translate(100, 0); this->doDraw(canvas, r, SkOffsetImageFilter::Create(20, 20, nullptr, &cr1)); - + SkRect clipR = SkRect::MakeXYWH(40, 40, 40, 40); canvas->translate(100, 0); this->doDraw(canvas, r, SkOffsetImageFilter::Create(20, 20, nullptr, nullptr), &clipR); diff --git a/gm/ovals.cpp b/gm/ovals.cpp index 580426b244..1374b7d35d 100755 --- a/gm/ovals.cpp +++ b/gm/ovals.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/patch.cpp b/gm/patch.cpp index 5b661f4b7c..d27c4e1a85 100644 --- a/gm/patch.cpp +++ b/gm/patch.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -16,7 +15,7 @@ static sk_sp make_shader() { SK_ColorYELLOW, }; const SkPoint pts[] = { { 100.f / 4.f, 0.f }, { 3.f * 100.f / 4.f, 100.f } }; - + return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); } @@ -66,7 +65,7 @@ static void draw_control_points(SkCanvas* canvas, const SkPoint cubics[12]) { DEF_SIMPLE_GM(patch_primitive, canvas, 800, 800) { SkPaint paint; - + // The order of the colors and points is clockwise starting at upper-left corner. const SkPoint cubics[SkPatchUtils::kNumCtrlPts] = { //top points @@ -78,22 +77,22 @@ DEF_SIMPLE_GM(patch_primitive, canvas, 800, 800) { //left points {50,250},{150,150} }; - + const SkColor colors[SkPatchUtils::kNumCorners] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN }; const SkPoint texCoords[SkPatchUtils::kNumCorners] = { {0.0f, 0.0f}, {100.0f, 0.0f}, {100.0f,100.0f}, {0.0f, 100.0f}} ; - + const SkXfermode::Mode modes[] = { SkXfermode::kSrc_Mode, SkXfermode::kDst_Mode, SkXfermode::kModulate_Mode, }; - + sk_sp shader(make_shader()); - + canvas->save(); for (int y = 0; y < 3; y++) { SkAutoTUnref xfer(SkXfermode::Create(modes[y])); @@ -121,7 +120,7 @@ DEF_SIMPLE_GM(patch_primitive, canvas, 800, 800) { default: break; } - + draw_control_points(canvas, cubics); canvas->restore(); } diff --git a/gm/patchgrid.cpp b/gm/patchgrid.cpp index 6f77d48a88..962c1a9dff 100644 --- a/gm/patchgrid.cpp +++ b/gm/patchgrid.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -57,7 +56,7 @@ namespace skiagm { * This GM draws a grid of patches, it only uses colors so it could be considered a mesh gradient. */ class SkPatchGridGM : public GM { - + public: SkPatchGridGM() { this->setBGColor(0xFFFFFFFF); @@ -75,28 +74,28 @@ protected: void onDraw(SkCanvas* canvas) override { SkPaint paint; - + SkPoint vertices[4][5] = { {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, {{50,150}, {120,120}, {250,150},{350,150},{450,150}}, {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, {{100,300}, {150,350}, {250,350},{350,350},{450,350}} }; - + SkColor cornerColors[4][5] = { {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, }; - + SkPoint hrzCtrl[4][8] = { {{75,30},{125,45},{175,70},{225,20},{275,50},{325,50},{375,5},{425,90}}, {{75,150},{125,150},{175,150},{225,150},{275,150},{325,150},{375,150},{425,150}}, {{75,250},{125,250},{175,250},{225,250},{275,200},{325,150},{375,250},{425,250}}, {{75,350},{125,350},{175,350},{225,350},{275,350},{325,350},{375,350},{425,350}} }; - + SkPoint vrtCtrl[6][5] = { {{50,75},{150,75},{250,75},{350,75},{450,75}}, {{50,125},{150,125},{250,125},{350,125},{450,125}}, @@ -105,42 +104,42 @@ protected: {{50,275},{150,275},{250,275},{350,275},{400,305}}, {{50,325},{150,325},{250,325},{350,325},{450,325}} }; - + static const int kRows = 3; static const int kCols = 4; - + canvas->scale(3, 3); SkPatchGrid grid(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr); for (int i = 0; i < kRows; i++) { for (int j = 0; j < kCols; j++) { SkPoint points[12]; - + //set corners points[SkPatchUtils::kTopP0_CubicCtrlPts] = vertices[i][j]; points[SkPatchUtils::kTopP3_CubicCtrlPts] = vertices[i][j + 1]; points[SkPatchUtils::kBottomP0_CubicCtrlPts] = vertices[i + 1][j]; points[SkPatchUtils::kBottomP3_CubicCtrlPts] = vertices[i + 1][j + 1]; - + points[SkPatchUtils::kTopP1_CubicCtrlPts] = hrzCtrl[i][j * 2]; points[SkPatchUtils::kTopP2_CubicCtrlPts] = hrzCtrl[i][j * 2 + 1]; points[SkPatchUtils::kBottomP1_CubicCtrlPts] = hrzCtrl[i + 1][j * 2]; points[SkPatchUtils::kBottomP2_CubicCtrlPts] = hrzCtrl[i + 1][j * 2 + 1]; - + points[SkPatchUtils::kLeftP1_CubicCtrlPts] = vrtCtrl[i * 2][j]; points[SkPatchUtils::kLeftP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j]; points[SkPatchUtils::kRightP1_CubicCtrlPts] = vrtCtrl[i * 2][j + 1]; points[SkPatchUtils::kRightP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j + 1]; - + SkColor colors[4]; colors[0] = cornerColors[i][j]; colors[1] = cornerColors[i][j + 1]; colors[3] = cornerColors[i + 1][j]; colors[2] = cornerColors[i + 1][j + 1]; - + grid.setPatch(j, i, points, colors, nullptr); } } - + grid.draw(canvas, paint); SkISize dims = grid.getDimensions(); for (int y = 0; y < dims.height(); y++) { diff --git a/gm/path_stroke_with_zero_length.cpp b/gm/path_stroke_with_zero_length.cpp index f69b5f9294..ab9273626c 100644 --- a/gm/path_stroke_with_zero_length.cpp +++ b/gm/path_stroke_with_zero_length.cpp @@ -193,4 +193,3 @@ private: /////////////////////////////////////////////////////////////////////////////// DEF_GM( return new StrokeZeroGM(); ) - diff --git a/gm/pathcontourstart.cpp b/gm/pathcontourstart.cpp index dbda7c3cae..56f6492eb1 100644 --- a/gm/pathcontourstart.cpp +++ b/gm/pathcontourstart.cpp @@ -127,4 +127,3 @@ private: DEF_GM( return new ContourStartGM(); ) } // namespace skiagm - diff --git a/gm/pathreverse.cpp b/gm/pathreverse.cpp index 33507650a2..f0ce0516c8 100644 --- a/gm/pathreverse.cpp +++ b/gm/pathreverse.cpp @@ -15,7 +15,7 @@ * paint.setTextSize(SkIntToScalar(100)); * paint.setTypeface(SkTypeface::CreateFromName("Hiragino Maru Gothic Pro")); * paint.getTextPath("e", 1, 50, 50, &path); - * + * * The path data is duplicated here to allow the test to * run on all platforms and to remove the bug dependency * should future Macs edit or delete the font. diff --git a/gm/picture.cpp b/gm/picture.cpp index 904046deb7..1ea8adaa76 100644 --- a/gm/picture.cpp +++ b/gm/picture.cpp @@ -23,7 +23,7 @@ static sk_sp make_picture() { paint.setColor(0x80FF0000); path.moveTo(0, 0); path.lineTo(100, 0); path.lineTo(100, 100); canvas->drawPath(path, paint); - + paint.setColor(0x8000FF00); path.reset(); path.moveTo(0, 0); path.lineTo(100, 0); path.lineTo(0, 100); canvas->drawPath(path, paint); @@ -63,10 +63,10 @@ protected: SkPaint paint; canvas->drawPicture(fPicture); - + matrix.setTranslate(110, 0); canvas->drawPicture(fPicture, &matrix, nullptr); - + matrix.postTranslate(110, 0); canvas->drawPicture(fPicture, &matrix, &paint); diff --git a/gm/pixelsnap.cpp b/gm/pixelsnap.cpp index 7791acb0d0..1711f5e36d 100644 --- a/gm/pixelsnap.cpp +++ b/gm/pixelsnap.cpp @@ -36,7 +36,7 @@ protected: SkPaint bgPaint; bgPaint.setShader( sk_tool_utils::create_checkerboard_shader( - sk_tool_utils::color_to_565(0xFFAAAAAA), + sk_tool_utils::color_to_565(0xFFAAAAAA), sk_tool_utils::color_to_565(0xFF777777), 1)); canvas->drawPaint(bgPaint); diff --git a/gm/points.cpp b/gm/points.cpp index eda31210a3..0aa6fd86de 100644 --- a/gm/points.cpp +++ b/gm/points.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/recordopts.cpp b/gm/recordopts.cpp index 3c44f4ac27..d920a1785b 100644 --- a/gm/recordopts.cpp +++ b/gm/recordopts.cpp @@ -213,4 +213,3 @@ DEF_SIMPLE_GM(recordopts, canvas, (kTestRectSize+1)*2, (kTestRectSize+1)*15) { } } } - diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp index 43d008aaaa..47390e2e19 100644 --- a/gm/rectangletexture.cpp +++ b/gm/rectangletexture.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * @@ -95,7 +94,7 @@ protected: GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MIN_FILTER, GR_GL_NEAREST)); GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_S, - GR_GL_CLAMP_TO_EDGE)); + GR_GL_CLAMP_TO_EDGE)); GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_T, GR_GL_CLAMP_TO_EDGE)); GR_GL_CALL(gl, TexImage2D(TARGET, 0, GR_GL_RGBA, width, height, 0, diff --git a/gm/roundrects.cpp b/gm/roundrects.cpp index d0401f0595..514e43acbf 100644 --- a/gm/roundrects.cpp +++ b/gm/roundrects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/shadertext.cpp b/gm/shadertext.cpp index 13fa28325b..f794481399 100644 --- a/gm/shadertext.cpp +++ b/gm/shadertext.cpp @@ -133,7 +133,7 @@ protected: SkShader::kClamp_TileMode); } } - + SkBitmap bm; makebm(&bm, w/16, h/4); for (size_t tx = 0; tx < SK_ARRAY_COUNT(tileModes); ++tx) { diff --git a/gm/shallowgradient.cpp b/gm/shallowgradient.cpp index 6990ba7c93..ad1de63b53 100644 --- a/gm/shallowgradient.cpp +++ b/gm/shallowgradient.cpp @@ -50,7 +50,7 @@ protected: } void onDraw(SkCanvas* canvas) override { - const SkColor colors[] = { sk_tool_utils::color_to_565(0xFF555555), + const SkColor colors[] = { sk_tool_utils::color_to_565(0xFF555555), sk_tool_utils::color_to_565(0xFF444444) }; const int colorCount = SK_ARRAY_COUNT(colors); diff --git a/gm/shapes.cpp b/gm/shapes.cpp index 02b6a9827b..ee0920e378 100644 --- a/gm/shapes.cpp +++ b/gm/shapes.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/gm/showmiplevels.cpp b/gm/showmiplevels.cpp index fd1254f9bc..717d629ade 100644 --- a/gm/showmiplevels.cpp +++ b/gm/showmiplevels.cpp @@ -204,7 +204,7 @@ protected: canvas->translate(0, bm.height() * 0.85f); } } - + private: typedef skiagm::GM INHERITED; }; @@ -300,7 +300,7 @@ protected: canvas->translate(0, SkScalarRoundToScalar(bm.height() * 0.85f)); } } - + private: typedef skiagm::GM INHERITED; }; diff --git a/gm/smallpaths.cpp b/gm/smallpaths.cpp index fd89f70193..926b2a2273 100644 --- a/gm/smallpaths.cpp +++ b/gm/smallpaths.cpp @@ -63,16 +63,16 @@ static SkScalar make_three_line(SkPath* path) { static SkScalar yOffset = 50.f; path->moveTo(-32.5f + xOffset, 0.0f + yOffset); path->lineTo(32.5f + xOffset, 0.0f + yOffset); - + path->moveTo(-32.5f + xOffset, 19 + yOffset); path->lineTo(32.5f + xOffset, 19 + yOffset); - + path->moveTo(-32.5f + xOffset, -19 + yOffset); path->lineTo(32.5f + xOffset, -19 + yOffset); path->lineTo(-32.5f + xOffset, -19 + yOffset); - + path->close(); - + return SkIntToScalar(70); } @@ -81,16 +81,16 @@ static SkScalar make_arrow(SkPath* path) { static SkScalar yOffset = 40.f; path->moveTo(-26.f + xOffset, 0.0f + yOffset); path->lineTo(26.f + xOffset, 0.0f + yOffset); - + path->moveTo(-28.f + xOffset, -2.4748745f + yOffset); path->lineTo(0 + xOffset, 25.525126f + yOffset); - + path->moveTo(-28.f + xOffset, 2.4748745f + yOffset); path->lineTo(0 + xOffset, -25.525126f + yOffset); path->lineTo(-28.f + xOffset, 2.4748745f + yOffset); path->close(); - + return SkIntToScalar(70); } @@ -101,7 +101,7 @@ static SkScalar make_curve(SkPath* path) { path->conicTo(435.93292f + xOffset, 56.000031f + yOffset, 382.61078f + xOffset, 69.752716f + yOffset, 0.9920463f); - + return SkIntToScalar(40); } @@ -118,7 +118,7 @@ static SkScalar make_battery(SkPath* path) { path->lineTo(24.67f + xOffset, 5.3299999f); path->lineTo(24.67f + xOffset, 0.33000004f); path->close(); - + path->moveTo(25.727224f + xOffset, 12.886665f); path->lineTo(10.907918f + xOffset, 12.886665f); path->lineTo(7.5166659f + xOffset, 28.683645f); @@ -133,14 +133,14 @@ static SkScalar make_battery(SkPath* path) { static SkScalar make_battery2(SkPath* path) { static SkScalar xOffset = 5.f; - + path->moveTo(32.669998f + xOffset, 9.8640003f); path->lineTo(0.33000004f + xOffset, 9.8640003f); path->lineTo(0.33000004f + xOffset, 50.669998f); path->lineTo(32.669998f + xOffset, 50.669998f); path->lineTo(32.669998f + xOffset, 9.8640003f); path->close(); - + path->moveTo(10.907918f + xOffset, 12.886665f); path->lineTo(25.727224f + xOffset, 12.886665f); path->lineTo(16.854223f + xOffset, 25.136419f); @@ -150,7 +150,7 @@ static SkScalar make_battery2(SkPath* path) { path->lineTo(7.5166659f + xOffset, 28.683645f); path->lineTo(10.907918f + xOffset, 12.886665f); path->close(); - + return SkIntToScalar(70); } @@ -229,7 +229,7 @@ protected: } canvas->restore(); canvas->translate(SkIntToScalar(120), SkIntToScalar(0)); - + // second column: stroked paths canvas->save(); paint.setStyle(SkPaint::kStroke_Style); @@ -242,7 +242,7 @@ protected: } canvas->restore(); canvas->translate(SkIntToScalar(120), SkIntToScalar(0)); - + // third column: stroked paths with different widths canvas->save(); paint.setStyle(SkPaint::kStroke_Style); @@ -255,7 +255,7 @@ protected: } canvas->restore(); canvas->translate(SkIntToScalar(120), SkIntToScalar(0)); - + // fourth column: stroked and filled paths paint.setStyle(SkPaint::kStrokeAndFill_Style); paint.setStrokeCap(SkPaint::kButt_Cap); @@ -265,7 +265,7 @@ protected: canvas->drawPath(fPath[i], paint); canvas->translate(SkIntToScalar(0), fDY[i]); } - + } private: @@ -273,4 +273,3 @@ private: }; DEF_GM(return new SmallPathsGM;) - diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp index fc1a281f00..98e9bbb868 100644 --- a/gm/strokefill.cpp +++ b/gm/strokefill.cpp @@ -258,12 +258,12 @@ DEF_SIMPLE_GM_BG_NAME(strokefill, canvas, 640, 480, SK_ColorWHITE, paint.setAntiAlias(true); paint.setTextSize(SkIntToScalar(100)); paint.setStrokeWidth(SkIntToScalar(5)); - + // use paths instead of text to test the path data on all platforms, since the // Mac-specific font may change or is not available everywhere path_bold(canvas, papyrus_hello(), paint); path_bold(canvas, hiragino_maru_gothic_pro_dash(), paint); - + // use the portable typeface to generically test the fake bold code everywhere // (as long as the freetype option to do the bolding itself isn't enabled) sk_tool_utils::set_portable_typeface(&paint, "serif"); @@ -304,7 +304,7 @@ DEF_SIMPLE_GM_BG_NAME(strokefill, canvas, 640, 480, SK_ColorWHITE, path3.addRect(r, SkPath::kCCW_Direction); canvas->drawPath(path3, paint); - r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280), + r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); SkPath path4; path4.setFillType(SkPath::kWinding_FillType); @@ -313,7 +313,7 @@ DEF_SIMPLE_GM_BG_NAME(strokefill, canvas, 640, 480, SK_ColorWHITE, path4.addRect(r, SkPath::kCW_Direction); canvas->drawPath(path4, paint); - r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280), + r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); path4.reset(); SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr)); @@ -322,7 +322,7 @@ DEF_SIMPLE_GM_BG_NAME(strokefill, canvas, 640, 480, SK_ColorWHITE, path4.moveTo(0, 0); // test for crbug.com/247770 canvas->drawPath(path4, paint); - r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), + r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); path4.reset(); SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr)); diff --git a/gm/strokerects.cpp b/gm/strokerects.cpp index f5167bbedc..afd41b2206 100644 --- a/gm/strokerects.cpp +++ b/gm/strokerects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/strokes.cpp b/gm/strokes.cpp index f64a87640c..61f5a8af6a 100644 --- a/gm/strokes.cpp +++ b/gm/strokes.cpp @@ -243,7 +243,7 @@ DEF_SIMPLE_GM(quadcap, canvas, 200, 200) { p.setStrokeWidth(0); SkPath path; SkPoint pts[] = {{105.738571f,13.126318f}, - {105.738571f,13.126318f}, + {105.738571f,13.126318f}, {123.753784f,1.f}}; SkVector tangent = pts[1] - pts[2]; tangent.normalize(); @@ -449,7 +449,7 @@ protected: SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeWidth(0.055f); - + canvas->scale(1000, 1000); canvas->drawCircle(0, 2, 1.97f, paint); } diff --git a/gm/surface.cpp b/gm/surface.cpp index 436ea95286..901e324397 100644 --- a/gm/surface.cpp +++ b/gm/surface.cpp @@ -86,7 +86,7 @@ protected: { kRGB_V_SkPixelGeometry, "RGB_V" }, { kBGR_V_SkPixelGeometry, "BGR_V" }, }; - + SkScalar x = 0; for (int disallowAA = 0; disallowAA <= 1; ++disallowAA) { for (int disallowDither = 0; disallowDither <= 1; ++disallowDither) { @@ -156,4 +156,3 @@ private: typedef GM INHERITED; }; DEF_GM( return new NewSurfaceGM ) - diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp index c9ca474e76..a644bd1053 100644 --- a/gm/tablecolorfilter.cpp +++ b/gm/tablecolorfilter.cpp @@ -209,12 +209,12 @@ public: { fName.printf("colorcomposefilter_%s", suffix); } - + protected: virtual SkString onShortName() { return fName; } - + virtual SkISize onISize() { return SkISize::Make(790, 790); } @@ -270,7 +270,7 @@ protected: canvas->translate(0, r.height() + spacer); } } - + private: typedef GM INHERITED; }; diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 4b484cc034..8e29b2389f 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/textblobblockreordering.cpp b/gm/textblobblockreordering.cpp index 6542825fe1..31ba3c72de 100644 --- a/gm/textblobblockreordering.cpp +++ b/gm/textblobblockreordering.cpp @@ -58,9 +58,9 @@ protected: SkRect bounds = fBlob->bounds(); const int yDelta = SkScalarFloorToInt(bounds.height()) + 20; const int xDelta = SkScalarFloorToInt(bounds.width()); - + canvas->drawTextBlob(fBlob, 0, 0, paint); - + canvas->translate(SkIntToScalar(xDelta), SkIntToScalar(yDelta)); // draw a rect where the text should be, and then twiddle the xfermode @@ -84,7 +84,7 @@ private: typedef GM INHERITED; }; - + ////////////////////////////////////////////////////////////////////////////// DEF_GM(return new TextBlobBlockReordering;) diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 6bd6490c66..89d3b44b7f 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp index d774939648..b7f0d45096 100644 --- a/gm/tilemodes.cpp +++ b/gm/tilemodes.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp index 21224b44e8..3bcb0fab39 100644 --- a/gm/tilemodes_scaled.cpp +++ b/gm/tilemodes_scaled.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/tinybitmap.cpp b/gm/tinybitmap.cpp index 1162b2d2d1..fc226c11f4 100644 --- a/gm/tinybitmap.cpp +++ b/gm/tinybitmap.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/verttext2.cpp b/gm/verttext2.cpp index 4896cc992a..12576c2699 100644 --- a/gm/verttext2.cpp +++ b/gm/verttext2.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/gm/verylargebitmap.cpp b/gm/verylargebitmap.cpp index 78f8f59c8a..f257bf973a 100644 --- a/gm/verylargebitmap.cpp +++ b/gm/verylargebitmap.cpp @@ -120,4 +120,3 @@ private: }; DEF_GM( return new VeryLargeBitmapGM(make_raster_image, "bitmap"); ) DEF_GM( return new VeryLargeBitmapGM(make_picture_image, "_picture_image"); ) - diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp index a1427cf212..821bb8cc75 100644 --- a/gm/xfermodes.cpp +++ b/gm/xfermodes.cpp @@ -61,7 +61,7 @@ enum SrcType { kSmallTransparentImage_SrcType = 0x40, //! kRectangleImage_SrcType drawn directly with a mask. kRectangleWithMask_SrcType = 0x80, - + kAll_SrcType = 0xFF, //!< All the source types. kBasic_SrcType = 0x03, //!< Just basic source types. }; @@ -87,7 +87,7 @@ const struct { { SkXfermode::kDstOut_Mode, "DstOut", kAll_SrcType }, { SkXfermode::kSrcATop_Mode, "SrcATop", kAll_SrcType }, { SkXfermode::kDstATop_Mode, "DstATop", kAll_SrcType }, - + { SkXfermode::kXor_Mode, "Xor", kBasic_SrcType }, { SkXfermode::kPlus_Mode, "Plus", kBasic_SrcType }, { SkXfermode::kModulate_Mode, "Modulate", kAll_SrcType }, diff --git a/gm/xfermodes2.cpp b/gm/xfermodes2.cpp index 397f4e1e29..0956af66df 100644 --- a/gm/xfermodes2.cpp +++ b/gm/xfermodes2.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index 4aafb7a0bc..996e473e44 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/platform_tools/android/apps/sample_app/src/main/jni/AndroidKeyToSkKey.h b/platform_tools/android/apps/sample_app/src/main/jni/AndroidKeyToSkKey.h index 6bcb148b46..00fd5d078d 100644 --- a/platform_tools/android/apps/sample_app/src/main/jni/AndroidKeyToSkKey.h +++ b/platform_tools/android/apps/sample_app/src/main/jni/AndroidKeyToSkKey.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Skia * diff --git a/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp b/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp index 2ae72230a8..e5c6660921 100644 --- a/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp +++ b/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Skia * diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp index 80debebcf9..a282c317c0 100644 --- a/samplecode/ClockFaceView.cpp +++ b/samplecode/ClockFaceView.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/GMSampleView.cpp b/samplecode/GMSampleView.cpp index 24c94cb585..76d0c59738 100644 --- a/samplecode/GMSampleView.cpp +++ b/samplecode/GMSampleView.cpp @@ -59,4 +59,3 @@ void GMSampleView::onDrawBackground(SkCanvas* canvas) { bool GMSampleView::onAnimate(const SkAnimTimer& timer) { return fGM->animate(timer); } - diff --git a/samplecode/OverView.cpp b/samplecode/OverView.cpp index 8520f57000..0cd129e573 100644 --- a/samplecode/OverView.cpp +++ b/samplecode/OverView.cpp @@ -172,4 +172,3 @@ void OverView::onDraw(SkCanvas* canvas) { } } } - diff --git a/samplecode/PerlinPatch.cpp b/samplecode/PerlinPatch.cpp index ad2d6bede0..c5a0db8b6b 100644 --- a/samplecode/PerlinPatch.cpp +++ b/samplecode/PerlinPatch.cpp @@ -129,7 +129,7 @@ protected: } SkPaint paint; - + SkScalar texWidth = fTexScale * TexWidth; SkScalar texHeight = fTexScale * TexHeight; const SkPoint texCoords[SkPatchUtils::kNumCorners] = { @@ -138,7 +138,7 @@ protected: { fTexX + texWidth, fTexY + texHeight}, { fTexX - texWidth, fTexY + texHeight}} ; - + SkAutoTUnref xfer(SkXfermode::Create(SkXfermode::kSrc_Mode)); SkScalar scaleFreq = 2.0; @@ -204,4 +204,3 @@ private: }; DEF_SAMPLE( return new PerlinPatchView(); ) - diff --git a/samplecode/Sample2PtRadial.cpp b/samplecode/Sample2PtRadial.cpp index c32025e9cb..db3b24fbf5 100644 --- a/samplecode/Sample2PtRadial.cpp +++ b/samplecode/Sample2PtRadial.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleAAClip.cpp b/samplecode/SampleAAClip.cpp index 78baf3d554..4c79560531 100644 --- a/samplecode/SampleAAClip.cpp +++ b/samplecode/SampleAAClip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleAARects.cpp b/samplecode/SampleAARects.cpp index d0c1115a1e..41507d973a 100644 --- a/samplecode/SampleAARects.cpp +++ b/samplecode/SampleAARects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp index 70ecd9fe7e..d3be968ee7 100644 --- a/samplecode/SampleAll.cpp +++ b/samplecode/SampleAll.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleAnimatedText.cpp b/samplecode/SampleAnimatedText.cpp index 8ca9d87526..89ea6923d7 100755 --- a/samplecode/SampleAnimatedText.cpp +++ b/samplecode/SampleAnimatedText.cpp @@ -133,7 +133,7 @@ protected: } bool onAnimate(const SkAnimTimer& timer) override { - // We add noise to the scale and rotation animations to + // We add noise to the scale and rotation animations to // keep the font atlas from falling into a steady state fRotation += (1.0f + gRand.nextRangeF(-0.1f, 0.1f)); fScale += (fScaleInc + gRand.nextRangeF(-0.025f, 0.025f)); diff --git a/samplecode/SampleAnimator.cpp b/samplecode/SampleAnimator.cpp index 8b7af68cb3..d4a4cdd288 100644 --- a/samplecode/SampleAnimator.cpp +++ b/samplecode/SampleAnimator.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 3149711d86..e0d152d97b 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -852,7 +852,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev fDeviceType = kGPU_DeviceType; } #endif - + #if DEFAULT_TO_GPU fDeviceType = kGPU_DeviceType; #endif @@ -1792,13 +1792,13 @@ bool SampleWindow::onHandleChar(SkUnichar uni) { void SampleWindow::setDeviceType(DeviceType type) { if (type == fDeviceType) return; - + fDevManager->tearDownBackend(this); - + fDeviceType = type; - + fDevManager->setUpBackend(this, fMSAASampleCount); - + this->updateTitle(); this->inval(nullptr); } @@ -1807,9 +1807,9 @@ void SampleWindow::setDeviceColorType(SkColorType ct, SkColorProfileType pt) { this->setColorType(ct, pt); fDevManager->tearDownBackend(this); - + fDevManager->setUpBackend(this, fMSAASampleCount); - + this->updateTitle(); this->inval(nullptr); } diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h index 7ee07d86dd..082208cd5a 100644 --- a/samplecode/SampleApp.h +++ b/samplecode/SampleApp.h @@ -72,7 +72,7 @@ public: */ class DeviceManager : public SkRefCnt { public: - + virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) = 0; diff --git a/samplecode/SampleAtlas.cpp b/samplecode/SampleAtlas.cpp index 3061b14281..7cf1bb3761 100644 --- a/samplecode/SampleAtlas.cpp +++ b/samplecode/SampleAtlas.cpp @@ -30,7 +30,7 @@ static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xfo for (int i = 0; i < count; ++i) { SkMatrix matrix; matrix.setRSXform(xform[i]); - + canvas->save(); canvas->concat(matrix); canvas->drawImageRect(atlas, tex[i], tex[i].makeOffset(-tex[i].x(), -tex[i].y()), paint, @@ -118,7 +118,7 @@ class DrawAtlasDrawable : public SkDrawable { fDAlpha = -fDAlpha; } } - + SkRSXform asRSXform() const { return SkRSXform::MakeFromRadians(fScale, fRadian, fCenter.x(), fCenter.y(), SkScalarHalf(kCellSize), SkScalarHalf(kCellSize)); @@ -151,7 +151,7 @@ public: const SkScalar sx = SkIntToScalar(x); const SkScalar sy = SkIntToScalar(y); fTex[i].setXYWH(sx, sy, cell, cell); - + fRec[i].fCenter.set(sx + cell/2, sy + 3*cell/4); fRec[i].fVelocity.fX = rand.nextSScalar1() * kMaxSpeed; fRec[i].fVelocity.fY = rand.nextSScalar1() * kMaxSpeed; @@ -189,7 +189,7 @@ protected: const SkColor* colorsPtr = fUseColors ? colors : nullptr; fProc(canvas, fAtlas.get(), xform, fTex, colorsPtr, N, &cull, &paint); } - + SkRect onGetBounds() override { const SkScalar border = kMaxScale * kCellSize; SkRect r = fBounds; diff --git a/samplecode/SampleBigBlur.cpp b/samplecode/SampleBigBlur.cpp index fcbd6ac4f9..800ae24fbd 100644 --- a/samplecode/SampleBigBlur.cpp +++ b/samplecode/SampleBigBlur.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp index 0576234576..24c3efff79 100644 --- a/samplecode/SampleBitmapRect.cpp +++ b/samplecode/SampleBitmapRect.cpp @@ -78,7 +78,7 @@ class BitmapRectView : public SampleView { void resetBounce() { fSrcPts[0].set(0, 0); fSrcPts[1].set(SCALAR_SIZE, SCALAR_SIZE); - + fSrcVec[0] = unit_vec(30); fSrcVec[1] = unit_vec(107); } diff --git a/samplecode/SampleBlur.cpp b/samplecode/SampleBlur.cpp index bd5ff475d7..b617691b65 100644 --- a/samplecode/SampleBlur.cpp +++ b/samplecode/SampleBlur.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleClamp.cpp b/samplecode/SampleClamp.cpp index 9739053522..3046cde58f 100644 --- a/samplecode/SampleClamp.cpp +++ b/samplecode/SampleClamp.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleClipDrawMatch.cpp b/samplecode/SampleClipDrawMatch.cpp index 45663b5018..b010ad09a1 100644 --- a/samplecode/SampleClipDrawMatch.cpp +++ b/samplecode/SampleClipDrawMatch.cpp @@ -111,7 +111,7 @@ static void draw_normal_geom(SkCanvas* canvas, const SkPoint& offset, int geom, case kRectAndConcave_Geometry: canvas->drawPath(create_concave_path(offset), p); break; - } + } } class ClipDrawMatchView : public SampleView { @@ -202,7 +202,7 @@ protected: canvas->clipRect(r, SkRegion::kReplace_Op, true); // AA here forces shader clips canvas->clipPath(create_concave_path(offset), SkRegion::kIntersect_Op, useAA); } break; - } + } SkISize size = canvas->getDeviceSize(); SkRect bigR = SkRect::MakeWH(SkIntToScalar(size.width()), SkIntToScalar(size.height())); diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp index 0b8acc32d7..8a8eef699b 100644 --- a/samplecode/SampleColorFilter.cpp +++ b/samplecode/SampleColorFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleComplexClip.cpp b/samplecode/SampleComplexClip.cpp index 0d613ec161..aab759c65a 100644 --- a/samplecode/SampleComplexClip.cpp +++ b/samplecode/SampleComplexClip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleConcavePaths.cpp b/samplecode/SampleConcavePaths.cpp index abdf707523..d75ec4c4be 100644 --- a/samplecode/SampleConcavePaths.cpp +++ b/samplecode/SampleConcavePaths.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleDash.cpp b/samplecode/SampleDash.cpp index a01c079c70..f2c6b8bd9b 100644 --- a/samplecode/SampleDash.cpp +++ b/samplecode/SampleDash.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleDither.cpp b/samplecode/SampleDither.cpp index a599418723..99b33f0f0e 100644 --- a/samplecode/SampleDither.cpp +++ b/samplecode/SampleDither.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleDraw.cpp b/samplecode/SampleDraw.cpp index 5e239c61f2..29ad07d200 100644 --- a/samplecode/SampleDraw.cpp +++ b/samplecode/SampleDraw.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleEffects.cpp b/samplecode/SampleEffects.cpp index 12ea4e2392..a8f793c160 100644 --- a/samplecode/SampleEffects.cpp +++ b/samplecode/SampleEffects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleFillType.cpp b/samplecode/SampleFillType.cpp index af94c9f4f1..582dd96398 100644 --- a/samplecode/SampleFillType.cpp +++ b/samplecode/SampleFillType.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleFilter.cpp b/samplecode/SampleFilter.cpp index acf358a857..66de8f317f 100644 --- a/samplecode/SampleFilter.cpp +++ b/samplecode/SampleFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp index 0602e2bcbb..18806c9950 100644 --- a/samplecode/SampleFilterFuzz.cpp +++ b/samplecode/SampleFilterFuzz.cpp @@ -696,8 +696,8 @@ static SkImageFilter* make_image_filter(bool canBeNull) { { SkRTreeFactory factory; SkPictureRecorder recorder; - SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitmapSize), - SkIntToScalar(kBitmapSize), + SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitmapSize), + SkIntToScalar(kBitmapSize), &factory, 0); drawSomething(recordingCanvas); sk_sp pict(recorder.finishRecordingAsPicture()); diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp index ee998456c1..2c3eb4c11e 100644 --- a/samplecode/SampleFilterQuality.cpp +++ b/samplecode/SampleFilterQuality.cpp @@ -54,7 +54,7 @@ static sk_sp make_image() { SkPaint paint; paint.setShader(make_shader(SkRect::MakeWH(N, N))); - + canvas->drawPath(path, paint); return surface->makeImageSnapshot(); } @@ -63,7 +63,7 @@ static sk_sp zoom_up(SkSurface* origSurf, SkImage* orig) { const SkScalar S = 16; // amount to scale up const int D = 2; // dimension scaling for the offscreen // since we only view the center, don't need to produce the entire thing - + SkImageInfo info = SkImageInfo::MakeN32(orig->width() * D, orig->height() * D, kOpaque_SkAlphaType); auto surface(origSurf->makeSurface(info)); @@ -73,7 +73,7 @@ static sk_sp zoom_up(SkSurface* origSurf, SkImage* orig) { canvas->translate(-SkScalarHalf(orig->width()) * (S - D) / S, -SkScalarHalf(orig->height()) * (S - D) / S); canvas->drawImage(orig, 0, 0, nullptr); - + if (S > 3) { SkPaint paint; paint.setColor(SK_ColorWHITE); diff --git a/samplecode/SampleFontCache.cpp b/samplecode/SampleFontCache.cpp index 5391d2449b..97c9565504 100644 --- a/samplecode/SampleFontCache.cpp +++ b/samplecode/SampleFontCache.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp index 0105a47346..ce3b81ee8a 100644 --- a/samplecode/SampleFontScalerTest.cpp +++ b/samplecode/SampleFontScalerTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleFuzz.cpp b/samplecode/SampleFuzz.cpp index d1a696f8c1..b8c800ab16 100644 --- a/samplecode/SampleFuzz.cpp +++ b/samplecode/SampleFuzz.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleGradients.cpp b/samplecode/SampleGradients.cpp index 5e9450e84d..19ba74b821 100644 --- a/samplecode/SampleGradients.cpp +++ b/samplecode/SampleGradients.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleHT.cpp b/samplecode/SampleHT.cpp index 1989c3a7c6..d0cd3a5499 100644 --- a/samplecode/SampleHT.cpp +++ b/samplecode/SampleHT.cpp @@ -57,7 +57,7 @@ public: fInterp = nullptr; fTime = 0; } - + void spawnAnimation(SkMSec now) { this->setTime(now); @@ -122,14 +122,14 @@ public: W = 640, H = 480, }; - + struct Rec { HTDrawable* fDrawable; }; Rec fArray[N]; sk_sp fRoot; SkMSec fTime; - + HTView() { SkRandom rand; diff --git a/samplecode/SampleHairCurves.cpp b/samplecode/SampleHairCurves.cpp index 2cf0b3c900..967c4f25cb 100644 --- a/samplecode/SampleHairCurves.cpp +++ b/samplecode/SampleHairCurves.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleLCD.cpp b/samplecode/SampleLCD.cpp index 130a28c5e5..862d935b2e 100644 --- a/samplecode/SampleLCD.cpp +++ b/samplecode/SampleLCD.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp index b31c839fac..8c2724ce95 100644 --- a/samplecode/SampleLayers.cpp +++ b/samplecode/SampleLayers.cpp @@ -306,4 +306,3 @@ private: typedef SampleView INHERITED; }; DEF_SAMPLE( return new BackdropView; ) - diff --git a/samplecode/SampleLighting.cpp b/samplecode/SampleLighting.cpp index 1da888f5bd..5171579f64 100755 --- a/samplecode/SampleLighting.cpp +++ b/samplecode/SampleLighting.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -71,7 +70,7 @@ protected: nullptr, nullptr)); paint.setColor(SK_ColorBLACK); - SkRect r = SkRect::MakeWH((SkScalar)fDiffuseBitmap.width(), + SkRect r = SkRect::MakeWH((SkScalar)fDiffuseBitmap.width(), (SkScalar)fDiffuseBitmap.height()); canvas->drawRect(r, paint); diff --git a/samplecode/SampleManyRects.cpp b/samplecode/SampleManyRects.cpp index 0290af2ce6..950b9833b0 100644 --- a/samplecode/SampleManyRects.cpp +++ b/samplecode/SampleManyRects.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/samplecode/SampleMeasure.cpp b/samplecode/SampleMeasure.cpp index 20335f203f..dc771db7d6 100644 --- a/samplecode/SampleMeasure.cpp +++ b/samplecode/SampleMeasure.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp index fec3b5e226..12cc40245f 100644 --- a/samplecode/SamplePath.cpp +++ b/samplecode/SamplePath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -345,4 +344,3 @@ private: typedef SampleView INHERITED; }; DEF_SAMPLE( return new ArcToView; ) - diff --git a/samplecode/SamplePathClip.cpp b/samplecode/SamplePathClip.cpp index 02a613a72f..a53fe7186b 100644 --- a/samplecode/SamplePathClip.cpp +++ b/samplecode/SamplePathClip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -80,7 +79,7 @@ static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges if (p0.fY == p1.fY) { return 0; } - + if (p0.fY > p1.fY) { SkTSwap(p0, p1); } @@ -88,7 +87,7 @@ static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges if (p1.fY <= bounds.top() || p0.fY >= bounds.bottom()) { return 0; } - + double dxdy = (double)(p1.fX - p0.fX) / (p1.fY - p0.fY); if (p0.fY < bounds.top()) { p0.fX = SkDoubleToScalar(p0.fX + dxdy * (bounds.top() - p0.fY)); @@ -98,14 +97,14 @@ static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges p1.fX = SkDoubleToScalar(p1.fX + dxdy * (bounds.bottom() - p1.fY)); p1.fY = bounds.bottom(); } - + // Now p0...p1 is strictly inside bounds vertically, so we just need to clip horizontally - + if (p0.fX > p1.fX) { SkTSwap(p0, p1); } // now we're left-to-right: p0 .. p1 - + if (p1.fX <= bounds.left()) { // entirely to the left p0.fX = p1.fX = bounds.left(); *edges++ = p0; @@ -118,7 +117,7 @@ static int clip_line(const SkRect& bounds, SkPoint p0, SkPoint p1, SkPoint edges *edges++ = p1; return 2; } - + if (p0.fX < bounds.left()) { float y = SkDoubleToScalar(p0.fY + (bounds.left() - p0.fX) / dxdy); *edges++ = SkPoint::Make(bounds.left(), p0.fY); @@ -157,7 +156,7 @@ public: SkPoint fPoly[N]; SkRect fClip; SkColor fEdgeColor[N]; - + EdgeClipView() : fClip(SkRect::MakeLTRB(150, 150, 550, 450)) { fPoly[0].set(300, 40); fPoly[1].set(550, 250); @@ -167,7 +166,7 @@ public: fEdgeColor[1] = 0xFF00FF00; fEdgeColor[2] = 0xFF0000FF; } - + protected: bool onQuery(SkEvent* evt) override { if (SampleCode::TitleQ(*evt)) { @@ -240,21 +239,21 @@ protected: MyClick(SkView* view) : Click(view) {} virtual void handleMove() = 0; }; - + class VertClick : public MyClick { SkPoint* fPt; public: VertClick(SkView* view, SkPoint* pt) : MyClick(view), fPt(pt) {} void handleMove() override { *fPt = snap(fCurr); } }; - + class DragRectClick : public MyClick { SkRect* fRect; public: DragRectClick(SkView* view, SkRect* rect) : MyClick(view), fRect(rect) {} void handleMove() override { fRect->offset(fCurr.x() - fPrev.x(), fCurr.y() - fPrev.y()); } }; - + class DragPolyClick : public MyClick { SkPoint fSrc[100]; SkPoint* fPoly; @@ -294,7 +293,7 @@ protected: return new VertClick(this, &fPoly[i]); } } - + SkPath path; path.addPoly(fPoly, N, true); if (path.contains(x, y)) { @@ -306,15 +305,14 @@ protected: } return new DoNothingClick(this); } - + bool onClick(Click* click) override { ((MyClick*)click)->handleMove(); this->inval(nullptr); return false; } - + private: typedef SampleView INHERITED; }; DEF_SAMPLE( return new EdgeClipView; ) - diff --git a/samplecode/SamplePathFill.cpp b/samplecode/SamplePathFill.cpp index 1a79d7ffe9..2f0dc6ff25 100644 --- a/samplecode/SamplePathFill.cpp +++ b/samplecode/SamplePathFill.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SamplePathFuzz.cpp b/samplecode/SamplePathFuzz.cpp index d719826752..05eb76fe21 100644 --- a/samplecode/SamplePathFuzz.cpp +++ b/samplecode/SamplePathFuzz.cpp @@ -698,5 +698,3 @@ private: static SkView* MyFactory() { return new PathFuzzView; } static SkViewRegister reg(MyFactory); - - diff --git a/samplecode/SamplePolyToPoly.cpp b/samplecode/SamplePolyToPoly.cpp index 1283a23bc5..6cb818a165 100644 --- a/samplecode/SamplePolyToPoly.cpp +++ b/samplecode/SamplePolyToPoly.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleQuadStroker.cpp b/samplecode/SampleQuadStroker.cpp index 40f01fd105..ab65ff6d87 100644 --- a/samplecode/SampleQuadStroker.cpp +++ b/samplecode/SampleQuadStroker.cpp @@ -393,7 +393,7 @@ protected: return; } SkRect bounds = path.getBounds(); - this->setWHZ(SkScalarCeilToInt(bounds.right()), drawText + this->setWHZ(SkScalarCeilToInt(bounds.right()), drawText ? SkScalarRoundToInt(scale * 3 / 2) : SkScalarRoundToInt(scale), SkScalarRoundToInt(950.0f / scale)); erase(fMinSurface); @@ -474,7 +474,7 @@ protected: path.reset(); path.setFillType(SkPath::kEvenOdd_FillType); path.addCircle(center.fX, center.fY, maxSide + width / 2); - SkRect outside = SkRect::MakeXYWH(center.fX - maxSide - width, center.fY - maxSide - width, + SkRect outside = SkRect::MakeXYWH(center.fX - maxSide - width, center.fY - maxSide - width, (maxSide + width) * 2, (maxSide + width) * 2); path.addRect(outside); canvas->drawPath(path, paint); @@ -648,7 +648,7 @@ protected: if (fArcButton.fEnabled) { SkPoint center; if (arcCenter(¢er)) { - r.set(center.fX - fRadius, center.fY - fRadius, center.fX + fRadius, + r.set(center.fX - fRadius, center.fY - fRadius, center.fX + fRadius, center.fY + fRadius); } } diff --git a/samplecode/SampleRectanizer.cpp b/samplecode/SampleRectanizer.cpp index 55e70a29d2..4ff28b2a6c 100644 --- a/samplecode/SampleRectanizer.cpp +++ b/samplecode/SampleRectanizer.cpp @@ -100,7 +100,7 @@ protected: long totArea = 0; for (int i = 0; i < fCurRandRect; ++i) { - r = SkRect::MakeXYWH(SkIntToScalar(fRectLocations[i].fX), + r = SkRect::MakeXYWH(SkIntToScalar(fRectLocations[i].fX), SkIntToScalar(fRectLocations[i].fY), SkIntToScalar((*fCurRects)[i].fWidth), SkIntToScalar((*fCurRects)[i].fHeight)); diff --git a/samplecode/SampleRepeatTile.cpp b/samplecode/SampleRepeatTile.cpp index 598a088373..f56492dc0f 100644 --- a/samplecode/SampleRepeatTile.cpp +++ b/samplecode/SampleRepeatTile.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp index daaf5e3551..1335c31076 100644 --- a/samplecode/SampleShip.cpp +++ b/samplecode/SampleShip.cpp @@ -35,7 +35,7 @@ static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xfo for (int i = 0; i < count; ++i) { SkMatrix matrix; matrix.setRSXform(xform[i]); - + canvas->save(); canvas->concat(matrix); canvas->drawImageRect(atlas, tex[i], tex[i].makeOffset(-tex[i].x(), -tex[i].y()), paint, @@ -58,7 +58,7 @@ public: return; } } - + SkScalar anchorX = fAtlas->width()*0.5f; SkScalar anchorY = fAtlas->height()*0.5f; int currIndex = 0; @@ -66,7 +66,7 @@ public: for (int y = 0; y < kGrid; y++) { float xPos = (x / (kGrid - 1.0f)) * kWidth; float yPos = (y / (kGrid - 1.0f)) * kWidth; - + fTex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f, SkIntToScalar(fAtlas->width()), SkIntToScalar(fAtlas->height())); @@ -80,13 +80,13 @@ public: SkIntToScalar(fAtlas->height())); fXform[currIndex] = SkRSXform::MakeFromRadians(0.5f, SK_ScalarPI*0.5f, kWidth*0.5f, kHeight*0.5f, anchorX, anchorY); - + fCurrentTime = 0; fTimer.start(); } ~DrawShipView() override {} - + protected: // overrides from SkEventSink bool onQuery(SkEvent* evt) override { @@ -96,25 +96,25 @@ protected: } return this->INHERITED::onQuery(evt); } - + void onDrawContent(SkCanvas* canvas) override { const float kCosDiff = 0.99984769515f; const float kSinDiff = 0.01745240643f; - + if (!fAtlas) { return; } - + SkPaint paint; paint.setFilterQuality(kLow_SkFilterQuality); paint.setColor(SK_ColorWHITE); paint.setTextSize(15.0f); - + fTimer.end(); - + fTimes[fCurrentTime] = (float)(fTimer.fWall); fCurrentTime = (fCurrentTime + 1) & 0x1f; - + float meanTime = 0.0f; for (int i = 0; i < 32; ++i) { meanTime += fTimes[i]; @@ -125,27 +125,27 @@ protected: outString.appendScalar(fps); outString.append(" ms: "); outString.appendScalar(meanTime); - + fTimer.start(); - + SkScalar anchorX = fAtlas->width()*0.5f; SkScalar anchorY = fAtlas->height()*0.5f; for (int i = 0; i < kGrid*kGrid+1; ++i) { SkScalar c = fXform[i].fSCos; SkScalar s = fXform[i].fSSin; - + SkScalar dx = c*anchorX - s*anchorY; SkScalar dy = s*anchorX + c*anchorY; - + fXform[i].fSCos = kCosDiff*c - kSinDiff*s; fXform[i].fSSin = kSinDiff*c + kCosDiff*s; - + dx -= fXform[i].fSCos*anchorX - fXform[i].fSSin*anchorY; dy -= fXform[i].fSSin*anchorX + fXform[i].fSCos*anchorY; fXform[i].fTx += dx; fXform[i].fTy += dy; } - + fProc(canvas, fAtlas.get(), fXform, fTex, nullptr, kGrid*kGrid+1, nullptr, &paint); paint.setColor(SK_ColorBLACK); canvas->drawRect(SkRect::MakeXYWH(0, 0, 200, 24), paint); @@ -167,15 +167,15 @@ protected: private: const char* fName; DrawAtlasProc fProc; - + sk_sp fAtlas; SkRSXform fXform[kGrid*kGrid+1]; SkRect fTex[kGrid*kGrid+1]; WallTimer fTimer; float fTimes[32]; int fCurrentTime; - - + + typedef SampleView INHERITED; }; diff --git a/samplecode/SampleSkLayer.cpp b/samplecode/SampleSkLayer.cpp index c57a281d6c..0422561617 100644 --- a/samplecode/SampleSkLayer.cpp +++ b/samplecode/SampleSkLayer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp index 9b054adc2c..b4ebb3c30d 100644 --- a/samplecode/SampleSlides.cpp +++ b/samplecode/SampleSlides.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp index 9bcfcd96f9..f3cdee33a6 100644 --- a/samplecode/SampleStrokePath.cpp +++ b/samplecode/SampleStrokePath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleStrokeRect.cpp b/samplecode/SampleStrokeRect.cpp index 59e0a46cc2..a0cc5b288b 100644 --- a/samplecode/SampleStrokeRect.cpp +++ b/samplecode/SampleStrokeRect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleTextAlpha.cpp b/samplecode/SampleTextAlpha.cpp index 6e2e950669..a57c01632a 100644 --- a/samplecode/SampleTextAlpha.cpp +++ b/samplecode/SampleTextAlpha.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleTextBox.cpp b/samplecode/SampleTextBox.cpp index aedeaf6ce8..8540ca456f 100644 --- a/samplecode/SampleTextBox.cpp +++ b/samplecode/SampleTextBox.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleTextOnPath.cpp b/samplecode/SampleTextOnPath.cpp index 7c71084dbb..63b7ef26cc 100644 --- a/samplecode/SampleTextOnPath.cpp +++ b/samplecode/SampleTextOnPath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp index dbc7d09145..84346b0f72 100644 --- a/samplecode/SampleTiling.cpp +++ b/samplecode/SampleTiling.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp index 985ef608ec..0d43962986 100644 --- a/samplecode/SampleVertices.cpp +++ b/samplecode/SampleVertices.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleWritePixels.cpp b/samplecode/SampleWritePixels.cpp index bce79800c2..912567d06b 100644 --- a/samplecode/SampleWritePixels.cpp +++ b/samplecode/SampleWritePixels.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/samplecode/SampleXfer.cpp b/samplecode/SampleXfer.cpp index 58546e19cd..6aaffe59c9 100644 --- a/samplecode/SampleXfer.cpp +++ b/samplecode/SampleXfer.cpp @@ -57,7 +57,7 @@ public: fColor = (gRand.nextU() & 0x7F7F7F7F) | SkColorSetARGB(0xFF, 0, 0, 0x80); fFast32 = fast; } - + protected: void onPrepareWidEvent(SkEvent* evt) override { evt->setType("push-button"); @@ -101,7 +101,7 @@ protected: } return true; } - + private: typedef HasEventWig INHERITED; }; @@ -151,7 +151,7 @@ class XferDemo : public SampleView { enum { N = 4 }; - + SkRect fModeRect[N_Modes]; SkAutoTUnref fDrs[N]; CircDrawable* fSelected; @@ -234,7 +234,7 @@ protected: this->inval(nullptr); return fSelected ? new Click(this) : nullptr; } - + bool onClick(Click* click) override { fSelected->fLoc.fX += click->fCurr.fX - click->fPrev.fX; fSelected->fLoc.fY += click->fCurr.fY - click->fPrev.fY; diff --git a/samplecode/vertexdump.cpp b/samplecode/vertexdump.cpp index 9bfb0ce40a..69fd967d5f 100644 --- a/samplecode/vertexdump.cpp +++ b/samplecode/vertexdump.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp index 71d212a292..f71d7b61d2 100644 --- a/src/core/SkAAClip.cpp +++ b/src/core/SkAAClip.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkAAClip.h b/src/core/SkAAClip.h index 0207233386..7b29ef142a 100644 --- a/src/core/SkAAClip.h +++ b/src/core/SkAAClip.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp index 48b2cd73f7..ce2c15b345 100644 --- a/src/core/SkAdvancedTypefaceMetrics.cpp +++ b/src/core/SkAdvancedTypefaceMetrics.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkAdvancedTypefaceMetrics.h b/src/core/SkAdvancedTypefaceMetrics.h index 424e5f3f51..329b7d13c1 100644 --- a/src/core/SkAdvancedTypefaceMetrics.h +++ b/src/core/SkAdvancedTypefaceMetrics.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkAlphaRuns.cpp b/src/core/SkAlphaRuns.cpp index 37b1a5705c..37f57c1fa8 100644 --- a/src/core/SkAlphaRuns.cpp +++ b/src/core/SkAlphaRuns.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkAntiRun.h b/src/core/SkAntiRun.h index d49a723b20..8214e28d5b 100644 --- a/src/core/SkAntiRun.h +++ b/src/core/SkAntiRun.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkAutoKern.h b/src/core/SkAutoKern.h index 27df6da22b..8b032519b3 100644 --- a/src/core/SkAutoKern.h +++ b/src/core/SkAutoKern.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkAutoPixmapStorage.cpp b/src/core/SkAutoPixmapStorage.cpp index c0e9c3c8c4..865b3a6029 100644 --- a/src/core/SkAutoPixmapStorage.cpp +++ b/src/core/SkAutoPixmapStorage.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * @@ -57,4 +56,3 @@ const SkData* SkAutoPixmapStorage::detachPixelsAsData() { return data.release(); } - diff --git a/src/core/SkAutoPixmapStorage.h b/src/core/SkAutoPixmapStorage.h index 1a07a9773a..379bf420b0 100644 --- a/src/core/SkAutoPixmapStorage.h +++ b/src/core/SkAutoPixmapStorage.h @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp index eabf1356bb..ac1029db81 100644 --- a/src/core/SkBitmapController.cpp +++ b/src/core/SkBitmapController.cpp @@ -49,7 +49,7 @@ public: private: SkBitmap fResultBitmap; SkAutoTUnref fCurrMip; - + bool processHQRequest(const SkBitmapProvider&); bool processMediumRequest(const SkBitmapProvider&); }; @@ -77,17 +77,17 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmapProvider& pr if (fQuality != kHigh_SkFilterQuality) { return false; } - + // Our default return state is to downgrade the request to Medium, w/ or w/o setting fBitmap // to a valid bitmap. If we succeed, we will set this to Low instead. fQuality = kMedium_SkFilterQuality; - + if (kN32_SkColorType != provider.info().colorType() || !cache_size_okay(provider, fInvMatrix) || fInvMatrix.hasPerspective()) { return false; // can't handle the reqeust } - + SkScalar invScaleX = fInvMatrix.getScaleX(); SkScalar invScaleY = fInvMatrix.getScaleY(); if (fInvMatrix.getType() & SkMatrix::kAffine_Mask) { @@ -126,7 +126,7 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmapProvider& pr dstW, dstH, SkResourceCache::GetAllocator())) { return false; // we failed to create fScaledBitmap } - + SkASSERT(fResultBitmap.getPixels()); fResultBitmap.setImmutable(); if (!provider.isVolatile()) { @@ -135,9 +135,9 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmapProvider& pr } } } - + SkASSERT(fResultBitmap.getPixels()); - + fInvMatrix.postScale(SkIntToScalar(dstW) / provider.width(), SkIntToScalar(dstH) / provider.height()); fQuality = kLow_SkFilterQuality; @@ -153,11 +153,11 @@ bool SkDefaultBitmapControllerState::processMediumRequest(const SkBitmapProvider if (fQuality != kMedium_SkFilterQuality) { return false; } - + // Our default return state is to downgrade the request to Low, w/ or w/o setting fBitmap // to a valid bitmap. fQuality = kLow_SkFilterQuality; - + SkSize invScaleSize; if (!fInvMatrix.decomposeScale(&invScaleSize, nullptr)) { return false; @@ -179,7 +179,7 @@ bool SkDefaultBitmapControllerState::processMediumRequest(const SkBitmapProvider if (nullptr == fCurrMip->data()) { sk_throw(); } - + const SkSize scale = SkSize::Make(SkScalarInvert(invScaleSize.width()), SkScalarInvert(invScaleSize.height())); SkMipMap::Level level; @@ -225,4 +225,3 @@ SkBitmapController::State* SkDefaultBitmapController::onRequestBitmap(const SkBi void* storage, size_t size) { return SkInPlaceNewCheck(storage, size, bm, inverse, quality); } - diff --git a/src/core/SkBitmapController.h b/src/core/SkBitmapController.h index 32e73e813d..86b8755ec1 100644 --- a/src/core/SkBitmapController.h +++ b/src/core/SkBitmapController.h @@ -27,12 +27,12 @@ public: const SkPixmap& pixmap() const { return fPixmap; } const SkMatrix& invMatrix() const { return fInvMatrix; } SkFilterQuality quality() const { return fQuality; } - + protected: SkPixmap fPixmap; SkMatrix fInvMatrix; SkFilterQuality fQuality; - + private: friend class SkBitmapController; }; @@ -56,7 +56,7 @@ protected: class SkDefaultBitmapController : public SkBitmapController { public: SkDefaultBitmapController() {} - + protected: State* onRequestBitmap(const SkBitmapProvider&, const SkMatrix& inverse, SkFilterQuality, void* storage, size_t storageSize) override; diff --git a/src/core/SkBitmapHeap.cpp b/src/core/SkBitmapHeap.cpp index c65a704b5a..071647e13e 100644 --- a/src/core/SkBitmapHeap.cpp +++ b/src/core/SkBitmapHeap.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp index ab2321254b..fc749116df 100644 --- a/src/core/SkBitmapProcState.cpp +++ b/src/core/SkBitmapProcState.cpp @@ -824,4 +824,3 @@ void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const void* sIn, int x, int y, } } } - diff --git a/src/core/SkBitmapProcState_filter.h b/src/core/SkBitmapProcState_filter.h index 99f40eca56..dfc18d8a2b 100644 --- a/src/core/SkBitmapProcState_filter.h +++ b/src/core/SkBitmapProcState_filter.h @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h index 860e27ac7d..7e2e44bcee 100644 --- a/src/core/SkBitmapProcState_matrix.h +++ b/src/core/SkBitmapProcState_matrix.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkBitmapProvider.cpp b/src/core/SkBitmapProvider.cpp index 9cf2e9ae6b..9f6eb94310 100644 --- a/src/core/SkBitmapProvider.cpp +++ b/src/core/SkBitmapProvider.cpp @@ -84,4 +84,3 @@ bool SkBitmapProvider::asBitmap(SkBitmap* bm) const { return true; } } - diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp index e3face8c75..398e20c246 100644 --- a/src/core/SkBitmapScaler.cpp +++ b/src/core/SkBitmapScaler.cpp @@ -263,4 +263,3 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr, const SkPixmap& source, ResizeM SkASSERT(resultPtr->getPixels()); return true; } - diff --git a/src/core/SkBlitBWMaskTemplate.h b/src/core/SkBlitBWMaskTemplate.h index accf498aba..b0b9358b49 100644 --- a/src/core/SkBlitBWMaskTemplate.h +++ b/src/core/SkBlitBWMaskTemplate.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h index 8711f1a10f..0095826248 100644 --- a/src/core/SkBlitter.h +++ b/src/core/SkBlitter.h @@ -59,7 +59,7 @@ public: virtual void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { int16_t runs[3]; uint8_t aa[2]; - + runs[0] = 1; runs[1] = 1; runs[2] = 0; @@ -72,7 +72,7 @@ public: virtual void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { int16_t runs[2]; uint8_t aa[1]; - + runs[0] = 1; runs[1] = 0; aa[0] = SkToU8(a0); @@ -83,7 +83,7 @@ public: aa[0] = SkToU8(a1); this->blitAntiH(x, y + 1, aa, runs); } - + /** * Special method just to identify the null blitter, which is returned * from Choose() if the request cannot be fulfilled. Default impl diff --git a/src/core/SkBlitter_A8.cpp b/src/core/SkBlitter_A8.cpp index 51748b00e9..57587c675a 100644 --- a/src/core/SkBlitter_A8.cpp +++ b/src/core/SkBlitter_A8.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkBlitter_PM4f.cpp b/src/core/SkBlitter_PM4f.cpp index b7d8e7f8d3..820d72cc2e 100644 --- a/src/core/SkBlitter_PM4f.cpp +++ b/src/core/SkBlitter_PM4f.cpp @@ -26,17 +26,17 @@ public: void blitH(int x, int y, int width) override { SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width()); - + fState.fProc1(fState.fXfer, State::WritableAddr(fDevice, x, y), &fState.fPM4f, width, nullptr); } void blitV(int x, int y, int height, SkAlpha alpha) override { SkASSERT(x >= 0 && y >= 0 && y + height <= fDevice.height()); - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); size_t deviceRB = fDevice.rowBytes(); - + for (int i = 0; i < height; ++i) { fState.fProc1(fState.fXfer, device, &fState.fPM4f, 1, &alpha); device = (typename State::DstType*)((char*)device + deviceRB); @@ -46,10 +46,10 @@ public: void blitRect(int x, int y, int width, int height) override { SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width() && y + height <= fDevice.height()); - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); size_t deviceRB = fDevice.rowBytes(); - + do { fState.fProc1(fState.fXfer, device, &fState.fPM4f, width, nullptr); y += 1; @@ -59,7 +59,7 @@ public: void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override { typename State::DstType* device = State::WritableAddr(fDevice, x, y); - + for (;;) { int count = *runs; if (count <= 0) { @@ -84,24 +84,24 @@ public: void blitLCDMask(const SkMask& mask, const SkIRect& clip) { auto proc = fState.getLCDProc(SkXfermode::kSrcIsSingle_LCDFlag); - + const int x = clip.fLeft; const int width = clip.width(); const int y = clip.fTop; const int height = clip.height(); - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); const size_t dstRB = fDevice.rowBytes(); const uint16_t* maskRow = (const uint16_t*)mask.getAddr(x, y); const size_t maskRB = mask.fRowBytes; - + for (int i = 0; i < height; ++i) { proc(device, &fState.fPM4f, width, maskRow); device = (typename State::DstType*)((char*)device + dstRB); maskRow = (const uint16_t*)((const char*)maskRow + maskRB); } } - + void blitMask(const SkMask& mask, const SkIRect& clip) override { if (SkMask::kLCD16_Format == mask.fFormat) { this->blitLCDMask(mask, clip); @@ -111,19 +111,19 @@ public: this->INHERITED::blitMask(mask, clip); return; } - + SkASSERT(mask.fBounds.contains(clip)); - + const int x = clip.fLeft; const int width = clip.width(); const int y = clip.fTop; const int height = clip.height(); - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); const size_t dstRB = fDevice.rowBytes(); const uint8_t* maskRow = (const uint8_t*)mask.getAddr(x, y); const size_t maskRB = mask.fRowBytes; - + for (int i = 0; i < height; ++i) { fState.fProc1(fState.fXfer, device, &fState.fPM4f, width, maskRow); device = (typename State::DstType*)((char*)device + dstRB); @@ -144,10 +144,10 @@ public: , fBlitBW(bstate.fBlitBW) , fBlitAA(bstate.fBlitAA) {} - + void blitH(int x, int y, int width) override { SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width()); - + if (fBlitBW) { fBlitBW(&fBState, x, y, fDevice, width); return; @@ -170,7 +170,7 @@ public: typename State::DstType* device = State::WritableAddr(fDevice, x, y); size_t deviceRB = fDevice.rowBytes(); - + if (fConstInY) { fShaderContext->shadeSpan4f(x, y, fState.fBuffer, 1); } @@ -186,17 +186,17 @@ public: void blitRect(int x, int y, int width, int height) override { SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width() && y + height <= fDevice.height()); - + if (fBlitBW) { for (const int bottom = y + height; y < bottom; ++y) { fBlitBW(&fBState, x, y, fDevice, width); } return; } - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); size_t deviceRB = fDevice.rowBytes(); - + if (fConstInY) { fShaderContext->shadeSpan4f(x, y, fState.fBuffer, width); } @@ -211,7 +211,7 @@ public: void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override { typename State::DstType* device = State::WritableAddr(fDevice, x, y); - + for (;;) { int count = *runs; if (count <= 0) { @@ -241,16 +241,16 @@ public: void blitLCDMask(const SkMask& mask, const SkIRect& clip) { auto proc = fState.getLCDProc(0); - + const int x = clip.fLeft; const int width = clip.width(); int y = clip.fTop; - + typename State::DstType* device = State::WritableAddr(fDevice, x, y); const size_t deviceRB = fDevice.rowBytes(); const uint16_t* maskRow = (const uint16_t*)mask.getAddr(x, y); const size_t maskRB = mask.fRowBytes; - + if (fConstInY) { fShaderContext->shadeSpan4f(x, y, fState.fBuffer, width); } @@ -292,7 +292,7 @@ public: typename State::DstType* device = State::WritableAddr(fDevice, x, y); const size_t deviceRB = fDevice.rowBytes(); - + if (fConstInY) { fShaderContext->shadeSpan4f(x, y, fState.fBuffer, width); } @@ -305,7 +305,7 @@ public: maskRow += maskRB; } } - + protected: State fState; SkShader::Context::BlitState fBState; @@ -344,10 +344,10 @@ struct State4f { struct State32 : State4f { typedef uint32_t DstType; - + SkXfermode::D32Proc fProc1; SkXfermode::D32Proc fProcN; - + State32(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext) : State4f(info, paint, shaderContext) { @@ -360,7 +360,7 @@ struct State32 : State4f { fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle_D32Flag); fProcN = SkXfermode::GetD32Proc(fXfer, fFlags); } - + SkXfermode::LCD32Proc getLCDProc(uint32_t oneOrManyFlag) const { uint32_t flags = fFlags & 1; if (!(fFlags & SkXfermode::kDstIsSRGB_D32Flag)) { @@ -376,10 +376,10 @@ struct State32 : State4f { struct State64 : State4f { typedef uint64_t DstType; - + SkXfermode::D64Proc fProc1; SkXfermode::D64Proc fProcN; - + State64(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext) : State4f(info, paint, shaderContext) { @@ -400,7 +400,7 @@ struct State64 : State4f { } return SkXfermode::GetLCD64Proc(flags | oneOrManyFlag); } - + static DstType* WritableAddr(const SkPixmap& device, int x, int y) { return device.writable_addr64(x, y); } diff --git a/src/core/SkBuffer.h b/src/core/SkBuffer.h index 92ed7059db..c466fb65ea 100644 --- a/src/core/SkBuffer.h +++ b/src/core/SkBuffer.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkCachedData.cpp b/src/core/SkCachedData.cpp index cfa4c6165f..1ea232b2c5 100644 --- a/src/core/SkCachedData.cpp +++ b/src/core/SkCachedData.cpp @@ -98,7 +98,7 @@ void SkCachedData::inMutexRef(bool fromCache) { if ((1 == fRefCnt) && fInCache) { this->inMutexLock(); } - + fRefCnt += 1; if (fromCache) { SkASSERT(!fInCache); @@ -125,22 +125,22 @@ bool SkCachedData::inMutexUnref(bool fromCache) { default: break; } - + if (fromCache) { SkASSERT(fInCache); fInCache = false; } - + // return true when we need to be deleted return 0 == fRefCnt; } void SkCachedData::inMutexLock() { fMutex.assertHeld(); - + SkASSERT(!fIsLocked); fIsLocked = true; - + switch (fStorageType) { case kMalloc_StorageType: this->setData(fStorage.fMalloc); @@ -159,10 +159,10 @@ void SkCachedData::inMutexLock() { void SkCachedData::inMutexUnlock() { fMutex.assertHeld(); - + SkASSERT(fIsLocked); fIsLocked = false; - + switch (fStorageType) { case kMalloc_StorageType: // nothing to do/check diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 6a11db5ee5..258343a92f 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2235,7 +2235,7 @@ void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const S return; } } - + SkLazyPaint lazy; if (nullptr == paint) { paint = lazy.init(); @@ -2272,7 +2272,7 @@ void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const S iter.fDevice->drawImage(iter, image, x, y, pnt); } } - + LOOPER_END } @@ -2292,14 +2292,14 @@ void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const Sk if (nullptr == paint) { paint = lazy.init(); } - + LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(*paint, SkDrawFilter::kBitmap_Type, &dst, image->isOpaque()) - + while (iter.next()) { iter.fDevice->drawImageRect(iter, image, src, dst, looper.paint(), constraint); } - + LOOPER_END } @@ -2397,25 +2397,25 @@ void SkCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const void SkCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageNine()"); - + if (nullptr == paint || paint->canComputeFastBounds()) { SkRect storage; if (this->quickReject(paint ? paint->computeFastBounds(dst, &storage) : dst)) { return; } } - + SkLazyPaint lazy; if (nullptr == paint) { paint = lazy.init(); } - + LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, &dst) - + while (iter.next()) { iter.fDevice->drawImageNine(iter, image, center, dst, looper.paint()); } - + LOOPER_END } @@ -2430,18 +2430,18 @@ void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, c return; } } - + SkLazyPaint lazy; if (nullptr == paint) { paint = lazy.init(); } - + LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, &dst) - + while (iter.next()) { iter.fDevice->drawBitmapNine(iter, bitmap, center, dst, looper.paint()); } - + LOOPER_END } @@ -2740,7 +2740,7 @@ void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const if (paint) { pnt = *paint; } - + LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, nullptr) while (iter.next()) { iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, mode, pnt); diff --git a/src/core/SkChunkAlloc.cpp b/src/core/SkChunkAlloc.cpp index 3f30276f1b..8c5b8fb6a4 100644 --- a/src/core/SkChunkAlloc.cpp +++ b/src/core/SkChunkAlloc.cpp @@ -23,7 +23,7 @@ struct SkChunkAlloc::Block { char* fFreePtr; // data[] follows - size_t blockSize() { + size_t blockSize() { char* start = this->startOfData(); size_t bytes = fFreePtr - start; return fFreeSize + bytes; @@ -232,4 +232,3 @@ void SkChunkAlloc::validate() { SkASSERT(totCapacity == totUsed + totLost + totAvailable); } #endif - diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp index 59a625d0b6..3e0a2ec46f 100644 --- a/src/core/SkColorFilter.cpp +++ b/src/core/SkColorFilter.cpp @@ -78,17 +78,17 @@ public: // Can only claim alphaunchanged and SkPM4f support if both our proxys do. return fOuter->getFlags() & fInner->getFlags(); } - + void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const override { fInner->filterSpan(shader, count, result); fOuter->filterSpan(result, count, result); } - + void filterSpan4f(const SkPM4f shader[], int count, SkPM4f result[]) const override { fInner->filterSpan4f(shader, count, result); fOuter->filterSpan4f(result, count, result); } - + #ifndef SK_IGNORE_TO_STRING void toString(SkString* str) const override { SkString outerS, innerS; @@ -111,13 +111,13 @@ public: #endif SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeColorFilter) - + protected: void flatten(SkWriteBuffer& buffer) const override { buffer.writeFlattenable(fOuter.get()); buffer.writeFlattenable(fInner.get()); } - + private: SkComposeColorFilter(sk_sp outer, sk_sp inner, int composedFilterCount) @@ -178,4 +178,3 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeColorFilter) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END - diff --git a/src/core/SkColorFilterShader.h b/src/core/SkColorFilterShader.h index 167a272fa4..e42d06c667 100644 --- a/src/core/SkColorFilterShader.h +++ b/src/core/SkColorFilterShader.h @@ -27,9 +27,9 @@ public: // Takes ownership of shaderContext and calls its destructor. FilterShaderContext(const SkColorFilterShader&, SkShader::Context*, const ContextRec&); virtual ~FilterShaderContext(); - + uint32_t getFlags() const override; - + void shadeSpan(int x, int y, SkPMColor[], int count) override; void shadeSpan4f(int x, int y, SkPM4f[], int count) override; @@ -37,25 +37,25 @@ public: // forward to our proxy fShaderContext->set3DMask(mask); } - + private: SkShader::Context* fShaderContext; - + typedef SkShader::Context INHERITED; }; - + SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterShader) - + protected: void flatten(SkWriteBuffer&) const override; size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void* storage) const override; - + private: sk_sp fShader; sk_sp fFilter; - + typedef SkShader INHERITED; }; diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp index d11ef78b1a..d7253e1d8c 100644 --- a/src/core/SkColorTable.cpp +++ b/src/core/SkColorTable.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * @@ -109,4 +108,3 @@ SkColorTable* SkColorTable::Create(SkReadBuffer& buffer) { return new SkColorTable(colors.release(), count, kAllocatedWithMalloc); } - diff --git a/src/core/SkComposeShader.h b/src/core/SkComposeShader.h index ee6e36a222..8ea7c67ae7 100644 --- a/src/core/SkComposeShader.h +++ b/src/core/SkComposeShader.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkConfig8888.cpp b/src/core/SkConfig8888.cpp index e2dd1020de..5bac16a272 100644 --- a/src/core/SkConfig8888.cpp +++ b/src/core/SkConfig8888.cpp @@ -129,7 +129,7 @@ bool SkSrcPixelInfo::convertPixelsTo(SkDstPixelInfo* dst, int width, int height) static void copy_g8_to_32(void* dst, size_t dstRB, const void* src, size_t srcRB, int w, int h) { uint32_t* dst32 = (uint32_t*)dst; const uint8_t* src8 = (const uint8_t*)src; - + for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { dst32[x] = SkPackARGB32(0xFF, src8[x], src8[x], src8[x]); @@ -173,10 +173,10 @@ bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t if (srcInfo.dimensions() != dstInfo.dimensions()) { return false; } - + const int width = srcInfo.width(); const int height = srcInfo.height(); - + // Do the easiest one first : both configs are equal if ((srcInfo == dstInfo) && !ctable) { size_t bytes = width * srcInfo.bytesPerPixel(); @@ -303,4 +303,3 @@ bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t return true; } } - diff --git a/src/core/SkCoreBlitters.h b/src/core/SkCoreBlitters.h index 06e106dd8e..ec9ee203ef 100644 --- a/src/core/SkCoreBlitters.h +++ b/src/core/SkCoreBlitters.h @@ -171,17 +171,17 @@ public: void blitRect(int x, int y, int width, int height) override; void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) override; void blitMask(const SkMask&, const SkIRect&) override; - + private: SkXfermode* fXfermode; SkPMColor* fBuffer; SkBlitRow::Proc32 fProc32; SkBlitRow::Proc32 fProc32Blend; bool fShadeDirectlyIntoDevice; - + // illegal SkARGB32_Shader_Blitter& operator=(const SkARGB32_Shader_Blitter&); - + typedef SkShaderBlitter INHERITED; }; diff --git a/src/core/SkCubicClipper.cpp b/src/core/SkCubicClipper.cpp index 469fc222e3..b5b7dceabe 100644 --- a/src/core/SkCubicClipper.cpp +++ b/src/core/SkCubicClipper.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkCubicClipper.h b/src/core/SkCubicClipper.h index d7dc381233..617086edb9 100644 --- a/src/core/SkCubicClipper.h +++ b/src/core/SkCubicClipper.h @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp index 4b2194973b..995a30a542 100644 --- a/src/core/SkData.cpp +++ b/src/core/SkData.cpp @@ -192,4 +192,3 @@ sk_sp SkData::MakeFromStream(SkStream* stream, size_t size) { } return data; } - diff --git a/src/core/SkDeque.cpp b/src/core/SkDeque.cpp index 2e469d1faf..f9ab4af531 100644 --- a/src/core/SkDeque.cpp +++ b/src/core/SkDeque.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkDescriptor.h b/src/core/SkDescriptor.h index 1f6f4a8657..0f13acde97 100644 --- a/src/core/SkDescriptor.h +++ b/src/core/SkDescriptor.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 0ff094d73b..3a4090e2d3 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -88,11 +88,11 @@ void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { SkPatchUtils::VertexData data; - + SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, draw.fMatrix); // It automatically adjusts lodX and lodY in case it exceeds the number of indices. - // If it fails to generate the vertices, then we do not draw. + // If it fails to generate the vertices, then we do not draw. if (SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), lod.height())) { this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints, data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount, @@ -176,7 +176,7 @@ void SkBaseDevice::drawImageNine(const SkDraw& draw, const SkImage* image, const void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint& paint) { SkNinePatchIter iter(bitmap.width(), bitmap.height(), center, dst); - + SkRect srcR, dstR; while (iter.next(&srcR, &dstR)) { this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict_SrcRectConstraint); @@ -192,7 +192,7 @@ void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR for (int i = 0; i < count; ++i) { SkPoint quad[4]; xform[i].toQuad(tex[i].width(), tex[i].height(), quad); - + SkMatrix localM; localM.setRSXform(xform[i]); localM.preTranslate(-tex[i].left(), -tex[i].top()); @@ -209,7 +209,7 @@ void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR if (colors) { pnt.setColorFilter(SkColorFilter::MakeModeFilter(colors[i], mode)); } - + path.rewind(); path.addPoly(quad, 4, true); path.setConvexity(SkPath::kConvex_Convexity); @@ -283,24 +283,24 @@ bool SkBaseDevice::peekPixels(SkPixmap* pmap) { static void morphpoints(SkPoint dst[], const SkPoint src[], int count, SkPathMeasure& meas, const SkMatrix& matrix) { SkMatrix::MapXYProc proc = matrix.getMapXYProc(); - + for (int i = 0; i < count; i++) { SkPoint pos; SkVector tangent; - + proc(matrix, src[i].fX, src[i].fY, &pos); SkScalar sx = pos.fX; SkScalar sy = pos.fY; - + if (!meas.getPosTan(sx, &pos, &tangent)) { // set to 0 if the measure failed, so that we just set dst == pos tangent.set(0, 0); } - + /* This is the old way (that explains our approach but is way too slow SkMatrix matrix; SkPoint pt; - + pt.set(sx, sy); matrix.setSinCos(tangent.fY, tangent.fX); matrix.preTranslate(-sx, 0); @@ -313,7 +313,7 @@ static void morphpoints(SkPoint dst[], const SkPoint src[], int count, } /* TODO - + Need differentially more subdivisions when the follow-path is curvy. Not sure how to determine that, but we need it. I guess a cheap answer is let the caller tell us, but that seems like a cop-out. Another answer is to get Rob Johnson to figure it out. @@ -323,7 +323,7 @@ static void morphpath(SkPath* dst, const SkPath& src, SkPathMeasure& meas, SkPath::Iter iter(src, false); SkPoint srcP[4], dstP[3]; SkPath::Verb verb; - + while ((verb = iter.next(srcP)) != SkPath::kDone_Verb) { switch (verb) { case SkPath::kMove_Verb: @@ -359,16 +359,16 @@ void SkBaseDevice::drawTextOnPath(const SkDraw& draw, const void* text, size_t b const SkPath& follow, const SkMatrix* matrix, const SkPaint& paint) { SkASSERT(byteLength == 0 || text != nullptr); - + // nothing to draw if (text == nullptr || byteLength == 0 || draw.fRC->isEmpty()) { return; } - + SkTextToPathIter iter((const char*)text, byteLength, paint, true); SkPathMeasure meas(follow, false); SkScalar hOffset = 0; - + // need to measure first if (paint.getTextAlign() != SkPaint::kLeft_Align) { SkScalar pathLen = meas.getLength(); @@ -377,19 +377,19 @@ void SkBaseDevice::drawTextOnPath(const SkDraw& draw, const void* text, size_t b } hOffset += pathLen; } - + const SkPath* iterPath; SkScalar xpos; SkMatrix scaledMatrix; SkScalar scale = iter.getPathScale(); - + scaledMatrix.setScale(scale, scale); - + while (iter.next(&iterPath, &xpos)) { if (iterPath) { SkPath tmp; SkMatrix m(scaledMatrix); - + tmp.setIsVolatile(true); m.postTranslate(xpos + hOffset, 0); if (matrix) { diff --git a/src/core/SkDeviceProfile.h b/src/core/SkDeviceProfile.h index 2872b13458..ed533f8329 100644 --- a/src/core/SkDeviceProfile.h +++ b/src/core/SkDeviceProfile.h @@ -12,7 +12,7 @@ class SkDeviceProfile : public SkRefCnt { public: - + enum LCDConfig { kNone_LCDConfig, // disables LCD text rendering, uses A8 instead diff --git a/src/core/SkDither.cpp b/src/core/SkDither.cpp index 546d4799c8..d966e0e910 100644 --- a/src/core/SkDither.cpp +++ b/src/core/SkDither.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkDither.h b/src/core/SkDither.h index d82b4167b5..463b50403d 100644 --- a/src/core/SkDither.h +++ b/src/core/SkDither.h @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp index 94b7870b03..49df95b568 100644 --- a/src/core/SkEdge.cpp +++ b/src/core/SkEdge.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkEdge.h b/src/core/SkEdge.h index c3adbf85cb..11669b4f7f 100644 --- a/src/core/SkEdge.h +++ b/src/core/SkEdge.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkEdgeBuilder.cpp b/src/core/SkEdgeBuilder.cpp index 8ff68ee4fd..af68e0ff65 100644 --- a/src/core/SkEdgeBuilder.cpp +++ b/src/core/SkEdgeBuilder.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkEdgeBuilder.h b/src/core/SkEdgeBuilder.h index 047460d4fe..59f62870e7 100644 --- a/src/core/SkEdgeBuilder.h +++ b/src/core/SkEdgeBuilder.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkEdgeClipper.cpp b/src/core/SkEdgeClipper.cpp index 55f9192aea..85c519d364 100644 --- a/src/core/SkEdgeClipper.cpp +++ b/src/core/SkEdgeClipper.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkEdgeClipper.h b/src/core/SkEdgeClipper.h index 16887b4a32..e460c1cd87 100644 --- a/src/core/SkEdgeClipper.h +++ b/src/core/SkEdgeClipper.h @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkError.cpp b/src/core/SkError.cpp index 9e4385b489..d85b5ff0cc 100644 --- a/src/core/SkError.cpp +++ b/src/core/SkError.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/core/SkErrorInternals.h b/src/core/SkErrorInternals.h index 65ff231821..d573576099 100644 --- a/src/core/SkErrorInternals.h +++ b/src/core/SkErrorInternals.h @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/core/SkFDot6.h b/src/core/SkFDot6.h index 91f3dda020..82138acf11 100644 --- a/src/core/SkFDot6.h +++ b/src/core/SkFDot6.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkFilterProc.cpp b/src/core/SkFilterProc.cpp index 290384903e..5049727bde 100644 --- a/src/core/SkFilterProc.cpp +++ b/src/core/SkFilterProc.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkFilterProc.h b/src/core/SkFilterProc.h index 3b20d592d2..7348967fd0 100644 --- a/src/core/SkFilterProc.h +++ b/src/core/SkFilterProc.h @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp index 93d48a3d15..241854eb5a 100644 --- a/src/core/SkGlyphCache.cpp +++ b/src/core/SkGlyphCache.cpp @@ -53,7 +53,7 @@ SkGlyphCache::SkGlyphCache(SkTypeface* typeface, const SkDescriptor* desc, SkSca } SkGlyphCache::~SkGlyphCache() { - fGlyphMap.foreach ([](SkGlyph* g) { + fGlyphMap.foreach ([](SkGlyph* g) { if (g->fPathData) { delete g->fPathData->fPath; } } ); @@ -267,7 +267,7 @@ void SkGlyphCache::AddInterval(SkScalar val, SkGlyph::Intercept* intercept) { intercept->fInterval[1] = SkTMax(intercept->fInterval[1], val); } -void SkGlyphCache::AddPoints(const SkPoint* pts, int ptCount, const SkScalar bounds[2], +void SkGlyphCache::AddPoints(const SkPoint* pts, int ptCount, const SkScalar bounds[2], bool yAxis, SkGlyph::Intercept* intercept) { for (int i = 0; i < ptCount; ++i) { SkScalar val = *(&pts[i].fY - yAxis); diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h index 8d6bae6992..2b5262ba5e 100644 --- a/src/core/SkGlyphCache.h +++ b/src/core/SkGlyphCache.h @@ -242,7 +242,7 @@ private: static void OffsetResults(const SkGlyph::Intercept* intercept, SkScalar scale, SkScalar xPos, SkScalar* array, int* count); static void AddInterval(SkScalar val, SkGlyph::Intercept* intercept); - static void AddPoints(const SkPoint* pts, int ptCount, const SkScalar bounds[2], + static void AddPoints(const SkPoint* pts, int ptCount, const SkScalar bounds[2], bool yAxis, SkGlyph::Intercept* intercept); static void AddLine(const SkPoint pts[2], SkScalar axis, bool yAxis, SkGlyph::Intercept* intercept); diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp index 2b1212c0dc..0273139ad7 100644 --- a/src/core/SkGraphics.cpp +++ b/src/core/SkGraphics.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkHalf.cpp b/src/core/SkHalf.cpp index 0db979bc76..262362e076 100644 --- a/src/core/SkHalf.cpp +++ b/src/core/SkHalf.cpp @@ -34,18 +34,18 @@ SkHalf SkFloatToHalf(float f) { static const uint32_t sign_mask = 0x80000000u; static const uint32_t round_mask = ~0xfffu; SkHalf o = 0; - + FloatUIntUnion floatUnion; floatUnion.fFloat = f; - + uint32_t sign = floatUnion.fUInt & sign_mask; floatUnion.fUInt ^= sign; - + // NOTE all the integer compares in this function can be safely // compiled into signed compares since all operands are below // 0x80000000. Important if you want fast straight SSE2 code // (since there's no unsigned PCMPGTD). - + // Inf or NaN (all exponent bits set) if (floatUnion.fUInt >= f32infty) // NaN->qNaN and Inf->Inf @@ -59,10 +59,10 @@ SkHalf SkFloatToHalf(float f) { if (floatUnion.fUInt > f16infty) { floatUnion.fUInt = f16infty; } - + o = floatUnion.fUInt >> 13; // Take the bits! } - + o |= sign >> 16; return o; } @@ -72,7 +72,7 @@ SkHalf SkFloatToHalf(float f) { float SkHalfToFloat(SkHalf h) { static const FloatUIntUnion magic = { 126 << 23 }; FloatUIntUnion o; - + if (halfExponent(h) == 0) { // Zero / Denormal @@ -90,7 +90,7 @@ float SkHalfToFloat(SkHalf h) { else o.fUInt |= ((127 - 15 + halfExponent(h)) << 23); } - + // Set sign o.fUInt |= (halfSign(h) << 31); return o.fFloat; diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 62509c52be..06076c6891 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -804,4 +804,3 @@ bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const SkBitmap* result, SkIPoint* offset) { return fDevice->filterImage(filter, src, ctx, result, offset); } - diff --git a/src/core/SkImageFilterCacheKey.h b/src/core/SkImageFilterCacheKey.h index 76280dbf1a..3f5d1c8fa2 100644 --- a/src/core/SkImageFilterCacheKey.h +++ b/src/core/SkImageFilterCacheKey.h @@ -39,4 +39,3 @@ struct SkImageFilter::Cache::Key { }; #endif - diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp index 6e251a91dc..16f0a0109c 100644 --- a/src/core/SkImageInfo.cpp +++ b/src/core/SkImageInfo.cpp @@ -121,4 +121,3 @@ bool SkReadPixelsRec::trim(int srcWidth, int srcHeight) { return true; } - diff --git a/src/core/SkLight.h b/src/core/SkLight.h index 4a6e149c76..d9eb78d112 100644 --- a/src/core/SkLight.h +++ b/src/core/SkLight.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -40,9 +39,9 @@ public: LightType type() const { return fType; } const SkColor3f& color() const { return fColor; } - const SkVector3& dir() const { + const SkVector3& dir() const { SkASSERT(kAmbient_LightType != fType); - return fDirection; + return fDirection; } private: diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp index d8e88c9a0a..fdd0a04aee 100644 --- a/src/core/SkLightingShader.cpp +++ b/src/core/SkLightingShader.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -53,7 +52,7 @@ public: SkLightingShaderImpl(const SkBitmap& diffuse, const SkBitmap& normal, const SkLightingShader::Lights* lights, const SkVector& invNormRotation, - const SkMatrix* diffLocalM, const SkMatrix* normLocalM) + const SkMatrix* diffLocalM, const SkMatrix* normLocalM) : INHERITED(diffLocalM) , fDiffuseMap(diffuse) , fNormalMap(normal) @@ -204,14 +203,14 @@ public: "Xform", &xformUniName); fragBuilder->codeAppend("vec4 diffuseColor = "); - fragBuilder->appendTextureLookupAndModulate(args.fInputColor, args.fSamplers[0], - args.fCoords[0].c_str(), + fragBuilder->appendTextureLookupAndModulate(args.fInputColor, args.fSamplers[0], + args.fCoords[0].c_str(), args.fCoords[0].getType()); fragBuilder->codeAppend(";"); fragBuilder->codeAppend("vec4 normalColor = "); fragBuilder->appendTextureLookup(args.fSamplers[1], - args.fCoords[1].c_str(), + args.fCoords[1].c_str(), args.fCoords[1].getType()); fragBuilder->codeAppend(";"); @@ -220,7 +219,7 @@ public: fragBuilder->codeAppendf( "mat3 m = mat3(%s.x, -%s.y, 0.0, %s.y, %s.x, 0.0, 0.0, 0.0, 1.0);", xformUniName, xformUniName, xformUniName, xformUniName); - + // TODO: inverse map the light direction vectors in the vertex shader rather than // transforming all the normals here! fragBuilder->codeAppend("normal = normalize(m*normal);"); @@ -302,7 +301,7 @@ public: private: GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new LightingGLFP; } - bool onIsEqual(const GrFragmentProcessor& proc) const override { + bool onIsEqual(const GrFragmentProcessor& proc) const override { const LightingFP& lightingFP = proc.cast(); return fDiffDeviceTransform == lightingFP.fDiffDeviceTransform && fNormDeviceTransform == lightingFP.fNormDeviceTransform && @@ -331,7 +330,7 @@ static bool make_mat(const SkBitmap& bm, const SkMatrix& localMatrix1, const SkMatrix* localMatrix2, SkMatrix* result) { - + result->setIDiv(bm.width(), bm.height()); SkMatrix lmInverse; @@ -360,7 +359,7 @@ const GrFragmentProcessor* SkLightingShaderImpl::asFragmentProcessor( SkASSERT(fDiffuseMap.width() == fNormalMap.width() && fDiffuseMap.height() == fNormalMap.height()); SkMatrix diffM, normM; - + if (!make_mat(fDiffuseMap, this->getLocalMatrix(), localMatrix, &diffM)) { return nullptr; } @@ -371,17 +370,17 @@ const GrFragmentProcessor* SkLightingShaderImpl::asFragmentProcessor( bool doBicubic; GrTextureParams::FilterMode diffFilterMode = GrSkFilterQualityToGrFilterMode( - SkTMin(filterQuality, kMedium_SkFilterQuality), + SkTMin(filterQuality, kMedium_SkFilterQuality), viewM, this->getLocalMatrix(), - &doBicubic); + &doBicubic); SkASSERT(!doBicubic); GrTextureParams::FilterMode normFilterMode = GrSkFilterQualityToGrFilterMode( - SkTMin(filterQuality, kMedium_SkFilterQuality), + SkTMin(filterQuality, kMedium_SkFilterQuality), viewM, fNormLocalMatrix, - &doBicubic); + &doBicubic); SkASSERT(!doBicubic); // TODO: support other tile modes @@ -447,19 +446,19 @@ static inline SkPMColor convert(SkColor3f color, U8CPU a) { color.fX = 0.0f; } else if (color.fX >= 255.0f) { color.fX = 255.0f; - } + } if (color.fY <= 0.0f) { color.fY = 0.0f; } else if (color.fY >= 255.0f) { color.fY = 255.0f; - } + } if (color.fZ <= 0.0f) { color.fZ = 0.0f; } else if (color.fZ >= 255.0f) { color.fZ = 255.0f; - } + } return SkPreMultiplyARGB(a, (int) color.fX, (int) color.fY, (int) color.fZ); } @@ -511,7 +510,7 @@ void SkLightingShaderImpl::LightingShaderContext::shadeSpan(int x, int y, xformedNorm.fX = lightShader.fInvNormRotation.fX * norm.fX + lightShader.fInvNormRotation.fY * norm.fY; - xformedNorm.fY = lightShader.fInvNormRotation.fX * norm.fX - + xformedNorm.fY = lightShader.fInvNormRotation.fX * norm.fX - lightShader.fInvNormRotation.fY * norm.fY; xformedNorm.fZ = norm.fZ; @@ -601,7 +600,7 @@ SkFlattenable* SkLightingShaderImpl::CreateProc(SkReadBuffer& buf) { if (!buf.readScalarArray(&dir.fX, 3)) { return nullptr; } - builder.add(SkLight(color, dir)); + builder.add(SkLight(color, dir)); } } diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h index 30ce6559c5..ffbcbe9eb4 100644 --- a/src/core/SkLightingShader.h +++ b/src/core/SkLightingShader.h @@ -69,7 +69,7 @@ public: @param normal the normal map @param light the light applied to the normal map @param ambient the linear (unpremul) ambient light color. Range is 0..1/channel. - @param localMatrix the matrix mapping the textures to the dest rect + @param localMatrix the matrix mapping the textures to the dest rect nullptr will be returned if: either 'diffuse' or 'normal' are empty diff --git a/src/core/SkLineClipper.h b/src/core/SkLineClipper.h index 11e0a73ca2..d2c9b5fe76 100644 --- a/src/core/SkLineClipper.h +++ b/src/core/SkLineClipper.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkLinearBitmapPipeline.cpp b/src/core/SkLinearBitmapPipeline.cpp index 9c4c42cf40..37f9eb4046 100644 --- a/src/core/SkLinearBitmapPipeline.cpp +++ b/src/core/SkLinearBitmapPipeline.cpp @@ -589,4 +589,3 @@ void SkLinearBitmapPipeline::shadeSpan4f(int x, int y, SkPM4f* dst, int count) { // first pixel to the center of the last pixel. This implies that length is count-1. fFirstStage->pointSpan(Span{{x + 0.5f, y + 0.5f}, count - 1.0f, count}); } - diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp index 51c489721d..cacc052414 100644 --- a/src/core/SkMaskFilter.cpp +++ b/src/core/SkMaskFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h index 16ea47b1b0..94219d42ac 100644 --- a/src/core/SkMaskGamma.h +++ b/src/core/SkMaskGamma.h @@ -92,7 +92,7 @@ void SkTMaskGamma_build_correcting_lut(uint8_t table[256], U8CPU srcI, SkScalar * @param B The number of luminance bits to use [1, 8] from the blue channel. */ template class SkTMaskGamma : public SkRefCnt { - + public: /** Creates a linear SkTMaskGamma. */ @@ -151,7 +151,7 @@ public: const uint8_t* getGammaTables() const { return (const uint8_t*) fGammaTables; } - + private: static const int MAX_LUM_BITS = B_LUM_BITS > (R_LUM_BITS > G_LUM_BITS ? R_LUM_BITS : G_LUM_BITS) diff --git a/src/core/SkMetaData.cpp b/src/core/SkMetaData.cpp index dd6ed05571..6e1f5e2a3d 100644 --- a/src/core/SkMetaData.cpp +++ b/src/core/SkMetaData.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkModeColorFilter.cpp b/src/core/SkModeColorFilter.cpp index 3da51609a3..84c6491f3a 100644 --- a/src/core/SkModeColorFilter.cpp +++ b/src/core/SkModeColorFilter.cpp @@ -52,7 +52,7 @@ uint32_t SkModeColorFilter::getFlags() const { void SkModeColorFilter::filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const { SkPMColor color = fPMColor; SkXfermodeProc proc = fProc; - + for (int i = 0; i < count; i++) { result[i] = proc(color, shader[i]); } @@ -61,7 +61,7 @@ void SkModeColorFilter::filterSpan(const SkPMColor shader[], int count, SkPMColo void SkModeColorFilter::filterSpan4f(const SkPM4f shader[], int count, SkPM4f result[]) const { SkPM4f color = SkPM4f::FromPMColor(fPMColor); SkXfermodeProc4f proc = SkXfermode::GetProc4f(fMode); - + for (int i = 0; i < count; i++) { result[i] = proc(color, shader[i]); } diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp index 5745664858..09efba9377 100644 --- a/src/core/SkMultiPictureDraw.cpp +++ b/src/core/SkMultiPictureDraw.cpp @@ -204,4 +204,3 @@ void SkMultiPictureDraw::draw(bool flush) { GrLayerHoister::End(context); #endif } - diff --git a/src/core/SkNinePatchIter.cpp b/src/core/SkNinePatchIter.cpp index 5d24d75e7a..1a780a0c0d 100644 --- a/src/core/SkNinePatchIter.cpp +++ b/src/core/SkNinePatchIter.cpp @@ -19,22 +19,22 @@ SkNinePatchIter::SkNinePatchIter(int w, int h, const SkIRect& c, const SkRect& d fSrcX[1] = SkIntToScalar(c.fLeft); fSrcX[2] = SkIntToScalar(c.fRight); fSrcX[3] = SkIntToScalar(w); - + fSrcY[0] = 0; fSrcY[1] = SkIntToScalar(c.fTop); fSrcY[2] = SkIntToScalar(c.fBottom); fSrcY[3] = SkIntToScalar(h); - + fDstX[0] = dst.fLeft; fDstX[1] = dst.fLeft + SkIntToScalar(c.fLeft); fDstX[2] = dst.fRight - SkIntToScalar(w - c.fRight); fDstX[3] = dst.fRight; - + fDstY[0] = dst.fTop; fDstY[1] = dst.fTop + SkIntToScalar(c.fTop); fDstY[2] = dst.fBottom - SkIntToScalar(h - c.fBottom); fDstY[3] = dst.fBottom; - + if (fDstX[1] > fDstX[2]) { fDstX[1] = fDstX[0] + (fDstX[3] - fDstX[0]) * c.fLeft / (w - c.width()); fDstX[2] = fDstX[1]; diff --git a/src/core/SkNinePatchIter.h b/src/core/SkNinePatchIter.h index 2d7e9a8b19..df06c1f630 100644 --- a/src/core/SkNinePatchIter.h +++ b/src/core/SkNinePatchIter.h @@ -26,17 +26,16 @@ public: * While it returns true, use src/dst to draw the image/bitmap */ bool next(SkRect* src, SkRect* dst); - + private: SkScalar fSrcX[4]; SkScalar fSrcY[4]; SkScalar fDstX[4]; SkScalar fDstY[4]; - + int fCurrX; int fCurrY; bool fDone; }; #endif - diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 6a54b9a6c3..8d62a6aaf4 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -1115,7 +1115,7 @@ void SkPaint::getTextPath(const void* textData, size_t length, } int SkPaint::getTextIntercepts(const void* textData, size_t length, - SkScalar x, SkScalar y, const SkScalar bounds[2], + SkScalar x, SkScalar y, const SkScalar bounds[2], SkScalar* array) const { SkASSERT(length == 0 || textData != nullptr); if (!length) { diff --git a/src/core/SkPaintPriv.h b/src/core/SkPaintPriv.h index a03f9b3390..1cf404075b 100644 --- a/src/core/SkPaintPriv.h +++ b/src/core/SkPaintPriv.h @@ -21,7 +21,7 @@ public: kOpaque_ShaderOverrideOpacity, //!< the overriding shader is opaque kNotOpaque_ShaderOverrideOpacity, //!< the overriding shader may not be opaque }; - + /** * Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels. * diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 320448a30e..87ecd4ee1d 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -3177,7 +3177,7 @@ bool SkPath::contains(SkScalar x, SkScalar y) const { if ((onCurveCount & 1) || evenOddFill) { return SkToBool(onCurveCount & 1) ^ isInverse; } - // If the point touches an even number of curves, and the fill is winding, check for + // If the point touches an even number of curves, and the fill is winding, check for // coincidence. Count coincidence as places where the on curve points have identical tangents. iter.setPath(*this, true); done = false; diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index c0d97924cb..5ca5ebd143 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * @@ -527,12 +526,12 @@ int SkTKSearch(const T base[], int count, const K& key) { if (count <= 0) { return ~0; } - + SkASSERT(base != nullptr); // base may be nullptr if count is zero - + int lo = 0; int hi = count - 1; - + while (lo < hi) { int mid = (hi + lo) >> 1; if (base[mid].fDistance < key) { @@ -541,7 +540,7 @@ int SkTKSearch(const T base[], int count, const K& key) { hi = mid; } } - + if (base[hi].fDistance < key) { hi += 1; hi = ~hi; diff --git a/src/core/SkPathPriv.h b/src/core/SkPathPriv.h index 048c926ce2..f0bab95030 100644 --- a/src/core/SkPathPriv.h +++ b/src/core/SkPathPriv.h @@ -29,7 +29,7 @@ public: */ static FirstDirection OppositeFirstDirection(FirstDirection dir) { static const FirstDirection gOppositeDir[] = { - kCCW_FirstDirection, kCW_FirstDirection, kUnknown_FirstDirection, + kCCW_FirstDirection, kCW_FirstDirection, kUnknown_FirstDirection, }; return gOppositeDir[dir]; } diff --git a/src/core/SkPerspIter.h b/src/core/SkPerspIter.h index 821f153462..3a00971dbc 100644 --- a/src/core/SkPerspIter.h +++ b/src/core/SkPerspIter.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp index 79b2255f1f..92aa2410ad 100644 --- a/src/core/SkPictureData.cpp +++ b/src/core/SkPictureData.cpp @@ -630,5 +630,3 @@ bool SkPictureData::suitableForLayerOptimization() const { } #endif /////////////////////////////////////////////////////////////////////////////// - - diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp index 02d8592830..71f39ea0f9 100644 --- a/src/core/SkPictureFlat.cpp +++ b/src/core/SkPictureFlat.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h index 00b7c2bb41..73103c69f0 100644 --- a/src/core/SkPictureFlat.h +++ b/src/core/SkPictureFlat.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index ae3c3f20af..f21ac32b96 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -24,7 +24,7 @@ enum LegacySaveFlags { SkCanvas::SaveLayerFlags SkCanvas::LegacySaveFlagsToSaveLayerFlags(uint32_t flags) { uint32_t layerFlags = 0; - + if (0 == (flags & kClipToLayer_LegacySaveFlags)) { layerFlags |= SkCanvas::kDontClipToLayer_PrivateSaveLayerFlag; } @@ -532,4 +532,3 @@ void SkPicturePlayback::handleOp(SkReader32* reader, SkASSERTF(false, "Unknown draw type: %d", op); } } - diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 459402b115..fc502aa6fc 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -975,4 +975,3 @@ void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { } /////////////////////////////////////////////////////////////////////////////// - diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h index 8f167b815e..95289680b0 100644 --- a/src/core/SkPictureShader.h +++ b/src/core/SkPictureShader.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp index e73440ed2a..a5e474b6d4 100644 --- a/src/core/SkPixmap.cpp +++ b/src/core/SkPixmap.cpp @@ -58,7 +58,7 @@ bool SkPixmap::extractSubset(SkPixmap* result, const SkIRect& subset) const { if (!r.intersect(srcRect, subset)) { return false; // r is empty (i.e. no intersection) } - + // If the upper left of the rectangle was outside the bounds of this SkBitmap, we should have // exited above. SkASSERT(static_cast(r.fLeft) < static_cast(this->width())); @@ -84,15 +84,15 @@ bool SkPixmap::readPixels(const SkImageInfo& requestedDstInfo, void* dstPixels, if (0 == requestedDstInfo.width() || 0 == requestedDstInfo.height()) { return false; } - + SkIRect srcR = SkIRect::MakeXYWH(x, y, requestedDstInfo.width(), requestedDstInfo.height()); if (!srcR.intersect(0, 0, this->width(), this->height())) { return false; } - + // the intersect may have shrunk info's logical size const SkImageInfo dstInfo = requestedDstInfo.makeWH(srcR.width(), srcR.height()); - + // if x or y are negative, then we have to adjust pixels if (x > 0) { x = 0; @@ -134,7 +134,7 @@ bool SkPixmap::erase(SkColor color, const SkIRect& inArea) const { int height = area.height(); const int width = area.width(); const int rowBytes = this->rowBytes(); - + switch (this->colorType()) { case kGray_8_SkColorType: { if (255 != a) { @@ -162,14 +162,14 @@ bool SkPixmap::erase(SkColor color, const SkIRect& inArea) const { case kRGB_565_SkColorType: { uint16_t* p = this->writable_addr16(area.fLeft, area.fTop); uint16_t v; - + // make rgb premultiplied if (255 != a) { r = SkMulDiv255Round(r, a); g = SkMulDiv255Round(g, a); b = SkMulDiv255Round(b, a); } - + if (kARGB_4444_SkColorType == this->colorType()) { v = pack_8888_to_4444(a, r, g, b); } else { @@ -186,7 +186,7 @@ bool SkPixmap::erase(SkColor color, const SkIRect& inArea) const { case kBGRA_8888_SkColorType: case kRGBA_8888_SkColorType: { uint32_t* p = this->writable_addr32(area.fLeft, area.fTop); - + if (255 != a && kPremul_SkAlphaType == this->alphaType()) { r = SkMulDiv255Round(r, a); g = SkMulDiv255Round(g, a); @@ -273,4 +273,3 @@ bool SkPixmap::scalePixels(const SkPixmap& dst, SkFilterQuality quality) const { } ////////////////////////////////////////////////////////////////////////////////////////////////// - diff --git a/src/core/SkPoint.cpp b/src/core/SkPoint.cpp index 345ef37448..490e4a2d2d 100644 --- a/src/core/SkPoint.cpp +++ b/src/core/SkPoint.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * diff --git a/src/core/SkPtrRecorder.cpp b/src/core/SkPtrRecorder.cpp index be169d7b0d..dd73a7c29d 100644 --- a/src/core/SkPtrRecorder.cpp +++ b/src/core/SkPtrRecorder.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkPtrRecorder.h b/src/core/SkPtrRecorder.h index 2d755e69e5..402278e9bb 100644 --- a/src/core/SkPtrRecorder.h +++ b/src/core/SkPtrRecorder.h @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * @@ -22,7 +21,7 @@ */ class SkPtrSet : public SkRefCnt { public: - + /** * Search for the specified ptr in the set. If it is found, return its @@ -144,7 +143,7 @@ class SkFactorySet : public SkTPtrSet {}; */ class SkNamedFactorySet : public SkRefCnt { public: - + SkNamedFactorySet(); diff --git a/src/core/SkQuadClipper.h b/src/core/SkQuadClipper.h index c0b8695c91..1dd8576b0a 100644 --- a/src/core/SkQuadClipper.h +++ b/src/core/SkQuadClipper.h @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/core/SkRTree.h b/src/core/SkRTree.h index 557817189d..499f7a5d7d 100644 --- a/src/core/SkRTree.h +++ b/src/core/SkRTree.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp index 5afe279b95..89467677f3 100644 --- a/src/core/SkRasterClip.cpp +++ b/src/core/SkRasterClip.cpp @@ -211,7 +211,7 @@ bool SkRasterClip::op(const SkPath& path, const SkIRect& bounds, SkRegion::Op op } } else { base.setRect(bounds); - + if (SkRegion::kReplace_Op == op) { return this->setPath(path, base, doAA); } else { @@ -302,7 +302,7 @@ bool SkRasterClip::op(const SkRect& r, const SkIRect& bounds, SkRegion::Op op, b } return this->op(ir, op); } - + if (fIsBW && doAA) { // check that the rect really needs aa, or is it close enought to // integer boundaries that we can just treat it as a BW rect? @@ -369,13 +369,13 @@ const SkRegion& SkRasterClip::forceGetBW() { void SkRasterClip::convertToAA() { AUTO_RASTERCLIP_VALIDATE(*this); - + SkASSERT(!fForceConservativeRects); - + SkASSERT(fIsBW); fAA.setRegion(fBW); fIsBW = false; - + // since we are being explicitly asked to convert-to-aa, we pass false so we don't "optimize" // ourselves back to BW. (void)this->updateCacheAndReturnNonEmpty(false); diff --git a/src/core/SkRasterClip.h b/src/core/SkRasterClip.h index 8f05bb9b3d..5d99f1dfab 100644 --- a/src/core/SkRasterClip.h +++ b/src/core/SkRasterClip.h @@ -48,7 +48,7 @@ public: bool op(const SkRect&, const SkIRect&, SkRegion::Op, bool doAA); bool op(const SkRRect&, const SkIRect&, SkRegion::Op, bool doAA); bool op(const SkPath&, const SkIRect&, SkRegion::Op, bool doAA); - + void translate(int dx, int dy, SkRasterClip* dst) const; void translate(int dx, int dy) { this->translate(dx, dy, this); diff --git a/src/core/SkRasterizer.cpp b/src/core/SkRasterizer.cpp index 6a3ea10678..60176b8446 100644 --- a/src/core/SkRasterizer.cpp +++ b/src/core/SkRasterizer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp index 59d5172f81..fba02f7bdb 100644 --- a/src/core/SkReadBuffer.cpp +++ b/src/core/SkReadBuffer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 394cc72026..d0e8c4cf48 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -811,4 +811,3 @@ void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec } visitor.cleanUp(); } - diff --git a/src/core/SkRecordOpts.cpp b/src/core/SkRecordOpts.cpp index 0121ea54fc..ea19d6eaa5 100644 --- a/src/core/SkRecordOpts.cpp +++ b/src/core/SkRecordOpts.cpp @@ -292,4 +292,3 @@ void SkRecordOptimize2(SkRecord* record) { record->defrag(); } - diff --git a/src/core/SkRect.cpp b/src/core/SkRect.cpp index f2060f8441..0b2723ab0a 100644 --- a/src/core/SkRect.cpp +++ b/src/core/SkRect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkRefDict.cpp b/src/core/SkRefDict.cpp index 9364a39cc0..74071888ac 100644 --- a/src/core/SkRefDict.cpp +++ b/src/core/SkRefDict.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkRefDict.h b/src/core/SkRefDict.h index 9583df1f12..fec49ceb7a 100644 --- a/src/core/SkRefDict.h +++ b/src/core/SkRefDict.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp index ba6658182a..38d12d2f5d 100644 --- a/src/core/SkRegion.cpp +++ b/src/core/SkRegion.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkRegionPriv.h b/src/core/SkRegionPriv.h index c9633c7ad6..a4cf77b7f5 100644 --- a/src/core/SkRegionPriv.h +++ b/src/core/SkRegionPriv.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkScalar.cpp b/src/core/SkScalar.cpp index 7cb0a8b148..87a5073e14 100644 --- a/src/core/SkScalar.cpp +++ b/src/core/SkScalar.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 5e125f3008..cf4098bbdd 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkScan.cpp b/src/core/SkScan.cpp index b21dd6bf9c..7fce3f1726 100644 --- a/src/core/SkScan.cpp +++ b/src/core/SkScan.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkScan.h b/src/core/SkScan.h index 7309a1dd8c..f9443207c0 100644 --- a/src/core/SkScan.h +++ b/src/core/SkScan.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 The Android Open Source Project * diff --git a/src/core/SkScanPriv.h b/src/core/SkScanPriv.h index 75ceee08b4..798cae6d0f 100644 --- a/src/core/SkScanPriv.h +++ b/src/core/SkScanPriv.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp index 06365c1b93..3b0f3e189b 100644 --- a/src/core/SkScan_AntiPath.cpp +++ b/src/core/SkScan_AntiPath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkScan_Antihair.cpp b/src/core/SkScan_Antihair.cpp index 8ee0ba5f98..b3770eb646 100644 --- a/src/core/SkScan_Antihair.cpp +++ b/src/core/SkScan_Antihair.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 The Android Open Source Project * diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp index 6c1f1c052d..884f785299 100644 --- a/src/core/SkScan_Path.cpp +++ b/src/core/SkScan_Path.cpp @@ -510,7 +510,7 @@ void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitte } else { rightEdge = SkScalarRoundToInt(path.getBounds().right()) << shiftEdgesUp; } - + walk_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, proc, rightEdge); } } diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp index b8eabc50bf..681c224ad8 100644 --- a/src/core/SkSpecialImage.cpp +++ b/src/core/SkSpecialImage.cpp @@ -166,7 +166,7 @@ public: } ~SkSpecialImage_Image() override { } - + bool isOpaque() const override { return fImage->isOpaque(); } size_t getSize() const override { @@ -200,7 +200,7 @@ public: bool getBitmapDeprecated(SkBitmap* result) const override { #if SK_SUPPORT_GPU if (GrTexture* texture = as_IB(fImage.get())->peekTexture()) { - const SkImageInfo info = GrMakeInfoFromTexture(texture, + const SkImageInfo info = GrMakeInfoFromTexture(texture, fImage->width(), fImage->height(), fImage->isOpaque()); if (!result->setInfo(info)) { @@ -357,7 +357,7 @@ public: sk_sp onMakeSubset(const SkIRect& subset) const override { SkBitmap subsetBM; - + if (!fBitmap.extractSubset(&subsetBM, subset)) { return nullptr; } @@ -415,7 +415,7 @@ sk_sp SkSpecialImage::MakeFromPixmap(SkImageFilter::Proxy* proxy #include "SkImage_Gpu.h" class SkSpecialImage_Gpu : public SkSpecialImage_Base { -public: +public: SkSpecialImage_Gpu(SkImageFilter::Proxy* proxy, const SkIRect& subset, uint32_t uniqueID, GrTexture* tex, SkAlphaType at) : INHERITED(proxy, subset, uniqueID) @@ -447,7 +447,7 @@ public: GrTexture* onPeekTexture() const override { return fTexture; } bool getBitmapDeprecated(SkBitmap* result) const override { - const SkImageInfo info = GrMakeInfoFromTexture(fTexture, + const SkImageInfo info = GrMakeInfoFromTexture(fTexture, this->width(), this->height(), this->isOpaque()); if (!result->setInfo(info)) { @@ -463,7 +463,7 @@ public: bool testingOnlyOnGetROPixels(SkBitmap* result) const override { - const SkImageInfo info = SkImageInfo::MakeN32(this->width(), + const SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(), this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType); @@ -495,7 +495,7 @@ public: return SkSpecialImage::MakeFromGpu(this->internal_getProxy(), subset, this->uniqueID(), - fTexture, + fTexture, fAlphaType); } @@ -536,7 +536,7 @@ private: }; sk_sp SkSpecialImage::MakeFromGpu(SkImageFilter::Proxy* proxy, - const SkIRect& subset, + const SkIRect& subset, uint32_t uniqueID, GrTexture* tex, SkAlphaType at) { diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h index 778bf53449..4de28ebd16 100644 --- a/src/core/SkSpecialImage.h +++ b/src/core/SkSpecialImage.h @@ -76,7 +76,7 @@ public: static sk_sp MakeFromGpu(SkImageFilter::Proxy*, const SkIRect& subset, uint32_t uniqueID, - GrTexture*, + GrTexture*, SkAlphaType at = kPremul_SkAlphaType); static sk_sp MakeFromPixmap(SkImageFilter::Proxy*, const SkIRect& subset, @@ -164,4 +164,3 @@ private: }; #endif - diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp index c1b06dd769..2ac71ffb52 100644 --- a/src/core/SkSpecialSurface.cpp +++ b/src/core/SkSpecialSurface.cpp @@ -70,7 +70,7 @@ public: SkPixelRef* pr, const SkIRect& subset, const SkSurfaceProps* props) - : INHERITED(proxy, subset, props) { + : INHERITED(proxy, subset, props) { const SkImageInfo& info = pr->info(); fBitmap.setInfo(info, info.minRowBytes()); @@ -148,7 +148,7 @@ private: typedef SkSpecialSurface_Base INHERITED; }; -sk_sp SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy, +sk_sp SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy, const SkIRect& subset, GrTexture* texture, const SkSurfaceProps* props) { diff --git a/src/core/SkSpecialSurface.h b/src/core/SkSpecialSurface.h index 098baa42dd..d24ee74569 100644 --- a/src/core/SkSpecialSurface.h +++ b/src/core/SkSpecialSurface.h @@ -35,7 +35,7 @@ public: /** * Return a canvas that will draw into this surface. This will always * return the same canvas for a given surface, and is managed/owned by the - * surface. + * surface. * * The canvas will be invalid after 'newImageSnapshot' is called. */ diff --git a/src/core/SkSpriteBlitter4f.cpp b/src/core/SkSpriteBlitter4f.cpp index 474bf4d0f6..2561620379 100644 --- a/src/core/SkSpriteBlitter4f.cpp +++ b/src/core/SkSpriteBlitter4f.cpp @@ -18,13 +18,13 @@ public: fFilter = SkFilterSpanProc_Choose(paint); fBuffer.reset(src.width()); } - + protected: SkXfermode* fXfer; SkLoadSpanProc fLoader; SkFilterSpanProc fFilter; SkAutoTMalloc fBuffer; - + private: typedef SkSpriteBlitter INHERITED; }; @@ -53,7 +53,7 @@ public: dst = (uint64_t* SK_RESTRICT)((char*)dst + dstRB); } } - + private: SkXfermode::D64Proc fWriter; @@ -89,12 +89,12 @@ public: } fWriter = SkXfermode::GetD32Proc(fXfer, flags); } - + void blitRect(int x, int y, int width, int height) override { SkASSERT(width > 0 && height > 0); uint32_t* SK_RESTRICT dst = fDst.writable_addr32(x, y); size_t dstRB = fDst.rowBytes(); - + for (int bottom = y + height; y < bottom; ++y) { fLoader(fSource, x - fLeft, y - fTop, fBuffer, width); fFilter(*fPaint, fBuffer, width); @@ -102,10 +102,10 @@ public: dst = (uint32_t* SK_RESTRICT)((char*)dst + dstRB); } } - + protected: SkXfermode::D32Proc fWriter; - + private: typedef Sprite_4f INHERITED; }; @@ -114,11 +114,11 @@ private: SkSpriteBlitter* SkSpriteBlitter::ChooseS32(const SkPixmap& source, const SkPaint& paint, SkTBlitterAllocator* allocator) { SkASSERT(allocator != nullptr); - + if (paint.getMaskFilter() != nullptr) { return nullptr; } - + switch (source.colorType()) { case kN32_SkColorType: case kRGBA_F16_SkColorType: diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp index 4dd4164423..d0d3001cbb 100644 --- a/src/core/SkSpriteBlitter_RGB16.cpp +++ b/src/core/SkSpriteBlitter_RGB16.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp index a4c44fb2bc..1d1c9b971f 100644 --- a/src/core/SkStream.cpp +++ b/src/core/SkStream.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp index 8ac5674474..2e2c0e7173 100644 --- a/src/core/SkString.cpp +++ b/src/core/SkString.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index 9c26294129..0f1a15f0b6 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -397,7 +397,7 @@ static bool has_valid_tangent(const SkPath::Iter* iter) { continue; } return true; - case SkPath::kClose_Verb: + case SkPath::kClose_Verb: case SkPath::kDone_Verb: return false; } @@ -627,7 +627,7 @@ SkPathStroker::ReductionType SkPathStroker::CheckConicLinear(const SkConic& coni SkScalar xT = 0, yT = 0; (void) conic.findXExtrema(&xT); (void) conic.findYExtrema(&yT); - SkScalar t = SkTMax(xT, yT); + SkScalar t = SkTMax(xT, yT); if (0 == t) { return kLine_ReductionType; } diff --git a/src/core/SkStrokeRec.cpp b/src/core/SkStrokeRec.cpp index 6c975b445f..6aed573418 100644 --- a/src/core/SkStrokeRec.cpp +++ b/src/core/SkStrokeRec.cpp @@ -96,7 +96,7 @@ void SkStrokeRec::setStrokeStyle(SkScalar width, bool strokeAndFill) { #include "SkStroke.h" -#ifdef SK_DEBUG +#ifdef SK_DEBUG // enables tweaking these values at runtime from SampleApp bool gDebugStrokerErrorSet = false; SkScalar gDebugStrokerError; diff --git a/src/core/SkStrokerPriv.cpp b/src/core/SkStrokerPriv.cpp index 7fc773a114..840f961982 100644 --- a/src/core/SkStrokerPriv.cpp +++ b/src/core/SkStrokerPriv.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkStrokerPriv.h b/src/core/SkStrokerPriv.h index 1c35f0a8ea..d008efa11a 100644 --- a/src/core/SkStrokerPriv.h +++ b/src/core/SkStrokerPriv.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkSwizzle.cpp b/src/core/SkSwizzle.cpp index 9c1971817b..f080b83a87 100644 --- a/src/core/SkSwizzle.cpp +++ b/src/core/SkSwizzle.cpp @@ -12,5 +12,3 @@ void SkSwapRB(uint32_t* dest, const uint32_t* src, int count) { SkOpts::RGBA_to_BGRA(dest, src, count); } - - diff --git a/src/core/SkTDPQueue.h b/src/core/SkTDPQueue.h index 1545f97995..294c9f410b 100644 --- a/src/core/SkTDPQueue.h +++ b/src/core/SkTDPQueue.h @@ -34,7 +34,7 @@ public: /** Gets the next item in the queue without popping it. */ const T& peek() const { return fArray[0]; } T& peek() { return fArray[0]; } - + /** Removes the next item. */ void pop() { this->validate(); @@ -134,7 +134,7 @@ private: SkASSERT(index >= 0); do { int child = LeftOf(index); - + if (child >= fArray.count()) { // We're a leaf. this->setIndex(index); @@ -188,7 +188,7 @@ private: } SkTDArray fArray; - + typedef SkNoncopyable INHERITED; }; diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h index 2fa37b54f7..b144d18d48 100644 --- a/src/core/SkTDynamicHash.h +++ b/src/core/SkTDynamicHash.h @@ -127,12 +127,12 @@ public: fDeleted = 0; } - void reset() { - fCount = 0; - fDeleted = 0; - fCapacity = 0; - sk_free(fArray); - fArray = nullptr; + void reset() { + fCount = 0; + fDeleted = 0; + fCapacity = 0; + sk_free(fArray); + fArray = nullptr; } protected: diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h index b0d04d5aa8..4c8683cb8c 100644 --- a/src/core/SkTMultiMap.h +++ b/src/core/SkTMultiMap.h @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/core/SkTSearch.cpp b/src/core/SkTSearch.cpp index 5b5f139042..9ff9777638 100644 --- a/src/core/SkTSearch.cpp +++ b/src/core/SkTSearch.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkTSort.h b/src/core/SkTSort.h index 027ea52a5e..51b103cb5d 100644 --- a/src/core/SkTSort.h +++ b/src/core/SkTSort.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkTaskGroup.cpp b/src/core/SkTaskGroup.cpp index b3c23b649b..b696555d6f 100644 --- a/src/core/SkTaskGroup.cpp +++ b/src/core/SkTaskGroup.cpp @@ -207,4 +207,3 @@ void SkTaskGroup::add(std::function fn) { ThreadPool::Add(fn, &fPend void SkTaskGroup::batch(int N, std::function fn) { ThreadPool::Batch(N, fn, &fPending); } - diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp index 79fe858aac..463312aa6d 100644 --- a/src/core/SkTextBlob.cpp +++ b/src/core/SkTextBlob.cpp @@ -646,4 +646,3 @@ const SkTextBlob* SkTextBlobBuilder::build() { return blob; } - diff --git a/src/core/SkTextFormatParams.h b/src/core/SkTextFormatParams.h index f41c4de1d5..ef22c848bf 100644 --- a/src/core/SkTextFormatParams.h +++ b/src/core/SkTextFormatParams.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/core/SkTextMapStateProc.h b/src/core/SkTextMapStateProc.h index 8ef9389b3a..944050917c 100644 --- a/src/core/SkTextMapStateProc.h +++ b/src/core/SkTextMapStateProc.h @@ -75,4 +75,3 @@ inline void SkTextMapStateProc::operator()(const SkScalar pos[], SkPoint* loc) c } #endif - diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp index 8b7620b484..6024c81a17 100644 --- a/src/core/SkTypeface.cpp +++ b/src/core/SkTypeface.cpp @@ -358,4 +358,3 @@ bool SkTypeface::onComputeBounds(SkRect* bounds) const { } return false; } - diff --git a/src/core/SkTypefaceCache.cpp b/src/core/SkTypefaceCache.cpp index 5fe080d05d..faf39788ed 100644 --- a/src/core/SkTypefaceCache.cpp +++ b/src/core/SkTypefaceCache.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkTypefaceCache.h b/src/core/SkTypefaceCache.h index f39b0d7a44..bb2cb85bfc 100644 --- a/src/core/SkTypefaceCache.h +++ b/src/core/SkTypefaceCache.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkUnPreMultiply.cpp b/src/core/SkUnPreMultiply.cpp index 6245e96429..a15e7d13a3 100644 --- a/src/core/SkUnPreMultiply.cpp +++ b/src/core/SkUnPreMultiply.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp index f706cb9f25..635d1b1736 100644 --- a/src/core/SkUtils.cpp +++ b/src/core/SkUtils.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/core/SkUtilsArm.cpp b/src/core/SkUtilsArm.cpp index 9dc4e5472a..bf98fed476 100644 --- a/src/core/SkUtilsArm.cpp +++ b/src/core/SkUtilsArm.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/src/core/SkUtilsArm.h b/src/core/SkUtilsArm.h index 51ae7e4a95..317677115c 100644 --- a/src/core/SkUtilsArm.h +++ b/src/core/SkUtilsArm.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp index f8b3195403..6baea37946 100644 --- a/src/core/SkWriteBuffer.cpp +++ b/src/core/SkWriteBuffer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp index 262e5265c7..98eb796b73 100644 --- a/src/core/SkXfermode.cpp +++ b/src/core/SkXfermode.cpp @@ -246,7 +246,7 @@ static inline void clipColor(float* r, float* g, float* b, float a) { *g = L + (*g - L) * scale; *b = L + (*b - L) * scale; } - + if ((x > a) && (denom = x - L)) { // Compute denom and make sure it's non zero float scale = (a - L) / denom; *r = L + (*r - L) * scale; @@ -268,7 +268,7 @@ static Sk4f hue_4f(const Sk4f& s, const Sk4f& d) { float sr = s[SkPM4f::R]; float sg = s[SkPM4f::G]; float sb = s[SkPM4f::B]; - + float da = d[SkPM4f::A]; float dr = d[SkPM4f::R]; float dg = d[SkPM4f::G]; @@ -289,18 +289,18 @@ static Sk4f saturation_4f(const Sk4f& s, const Sk4f& d) { float sr = s[SkPM4f::R]; float sg = s[SkPM4f::G]; float sb = s[SkPM4f::B]; - + float da = d[SkPM4f::A]; float dr = d[SkPM4f::R]; float dg = d[SkPM4f::G]; float db = d[SkPM4f::B]; - + float Dr = dr; float Dg = dg; float Db = db; SetSat(&Dr, &Dg, &Db, Sat(sr, sg, sb) * da); SetLum(&Dr, &Dg, &Db, sa * da, Lum(dr, dg, db) * sa); - + return color_alpha(s * inv_alpha(d) + d * inv_alpha(s) + set_argb(0, Dr, Dg, Db), sa + da - sa * da); } @@ -310,7 +310,7 @@ static Sk4f color_4f(const Sk4f& s, const Sk4f& d) { float sr = s[SkPM4f::R]; float sg = s[SkPM4f::G]; float sb = s[SkPM4f::B]; - + float da = d[SkPM4f::A]; float dr = d[SkPM4f::R]; float dg = d[SkPM4f::G]; @@ -320,7 +320,7 @@ static Sk4f color_4f(const Sk4f& s, const Sk4f& d) { float Sg = sg; float Sb = sb; SetLum(&Sr, &Sg, &Sb, sa * da, Lum(dr, dg, db) * sa); - + Sk4f res = color_alpha(s * inv_alpha(d) + d * inv_alpha(s) + set_argb(0, Sr, Sg, Sb), sa + da - sa * da); // Can return tiny negative values ... @@ -332,17 +332,17 @@ static Sk4f luminosity_4f(const Sk4f& s, const Sk4f& d) { float sr = s[SkPM4f::R]; float sg = s[SkPM4f::G]; float sb = s[SkPM4f::B]; - + float da = d[SkPM4f::A]; float dr = d[SkPM4f::R]; float dg = d[SkPM4f::G]; float db = d[SkPM4f::B]; - + float Dr = dr; float Dg = dg; float Db = db; SetLum(&Dr, &Dg, &Db, sa * da, Lum(sr, sg, sb) * da); - + Sk4f res = color_alpha(s * inv_alpha(d) + d * inv_alpha(s) + set_argb(0, Dr, Dg, Db), sa + da - sa * da); // Can return tiny negative values ... diff --git a/src/core/SkXfermodeU64.cpp b/src/core/SkXfermodeU64.cpp index d3ddb2f02b..630a9d0683 100644 --- a/src/core/SkXfermodeU64.cpp +++ b/src/core/SkXfermodeU64.cpp @@ -238,7 +238,7 @@ static SkXfermode::D64Proc find_proc(SkXfermode::Mode mode, uint32_t flags) { SkXfermode::D64Proc SkXfermode::onGetD64Proc(uint32_t flags) const { SkASSERT(0 == (flags & ~7)); flags &= 7; - + Mode mode; return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags]; } @@ -246,4 +246,3 @@ SkXfermode::D64Proc SkXfermode::onGetD64Proc(uint32_t flags) const { SkXfermode::D64Proc SkXfermode::GetD64Proc(SkXfermode* xfer, uint32_t flags) { return xfer ? xfer->onGetD64Proc(flags) : find_proc(SkXfermode::kSrcOver_Mode, flags); } - diff --git a/src/core/SkYUVPlanesCache.cpp b/src/core/SkYUVPlanesCache.cpp index 336b581246..07a07c698b 100644 --- a/src/core/SkYUVPlanesCache.cpp +++ b/src/core/SkYUVPlanesCache.cpp @@ -77,7 +77,7 @@ SkCachedData* SkYUVPlanesCache::FindAndRef(uint32_t genID, Info* info, if (!CHECK_LOCAL(localCache, find, Find, key, YUVPlanesRec::Visitor, &result)) { return nullptr; } - + *info = result.fInfo; return result.fData; } diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index 50fbbac601..afab4b4891 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -57,7 +56,7 @@ void GrGLCircleBlurFragmentProcessor::emitCode(EmitArgs& args) { // We just want to compute "length(vec) - %s.z + 0.5) * %s.w" but need to rearrange // for precision - fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s.y) * %s.w );", + fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s.y) * %s.w );", fragmentPos, dataName, dataName, fragmentPos, dataName, dataName); fragBuilder->codeAppendf("float dist = length(vec) + ( 0.5 - %s.z ) * %s.w;", @@ -88,7 +87,7 @@ void GrGLCircleBlurFragmentProcessor::onSetData(const GrGLSLProgramDataManager& GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circle, float sigma, float offset, - GrTexture* blurProfile) + GrTexture* blurProfile) : fCircle(circle) , fSigma(sigma) , fOffset(offset) diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h index 2a97646ff5..ca12db7f60 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.h +++ b/src/effects/GrCircleBlurFragmentProcessor.h @@ -18,7 +18,7 @@ class GrTextureProvider; -// This FP handles the special case of a blurred circle. It uses a 1D +// This FP handles the special case of a blurred circle. It uses a 1D // profile that is just rotated about the origin of the circle. class GrCircleBlurFragmentProcessor : public GrFragmentProcessor { public: diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp index 1d147bd78f..0d61632175 100644 --- a/src/effects/Sk1DPathEffect.cpp +++ b/src/effects/Sk1DPathEffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp index a54f453ecf..da43d22487 100644 --- a/src/effects/Sk2DPathEffect.cpp +++ b/src/effects/Sk2DPathEffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index d3d36f7630..55dfe58b46 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -410,4 +410,3 @@ void SkAlphaThresholdFilterImpl::toString(SkString* str) const { str->append(")"); } #endif - diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp index c8e0756517..32238f1f9e 100644 --- a/src/effects/SkArithmeticMode.cpp +++ b/src/effects/SkArithmeticMode.cpp @@ -25,7 +25,7 @@ public: fK[3] = k4; fEnforcePMColor = enforcePMColor; } - + void xfer32(SkPMColor[], const SkPMColor[], int count, const SkAlpha[]) const override; SK_TO_STRING_OVERRIDE() @@ -147,7 +147,7 @@ SkXfermode* SkArithmeticMode::Create(SkScalar k1, SkScalar k2, SkScalarNearlyEqual(k3, SK_Scalar1) && SkScalarNearlyZero(k4)) { return SkXfermode::Create(SkXfermode::kDst_Mode); } - + return new SkArithmeticMode_scalar(k1, k2, k3, k4, enforcePMColor); } diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h index 18530e9e94..a44ac11e74 100644 --- a/src/effects/SkArithmeticMode_gpu.h +++ b/src/effects/SkArithmeticMode_gpu.h @@ -85,12 +85,12 @@ public: GrXPFactory::InvariantBlendedColor*) const override; private: - GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePMColor); + GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePMColor); GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, const GrPipelineOptimizations& optimizations, bool hasMixedSamples, - const DstTexture*) const override; + const DstTexture*) const override; bool onWillReadDstColor(const GrCaps& caps, const GrPipelineOptimizations& optimizations, diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp index a4fbc9887a..d9678f5834 100644 --- a/src/effects/SkAvoidXfermode.cpp +++ b/src/effects/SkAvoidXfermode.cpp @@ -223,7 +223,7 @@ private: } AvoidFP(SkColor opColor, uint8_t tolerance, - SkAvoidXfermode::Mode mode, const GrFragmentProcessor* dst) + SkAvoidXfermode::Mode mode, const GrFragmentProcessor* dst) : fOpColor(opColor), fTolerance(tolerance), fMode(mode) { this->initClassID(); @@ -377,7 +377,7 @@ private: void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; - bool onIsEqual(const GrXferProcessor& xpBase) const override { + bool onIsEqual(const GrXferProcessor& xpBase) const override { const AvoidXP& xp = xpBase.cast(); return fOpColor == xp.fOpColor && diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 60d8d17cdf..65c0aa8d0a 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -212,7 +212,7 @@ sk_sp SkBlurImageFilter::onFilterImage(SkSpecialImage* source, SkOpts::box_blur_xy(t, h, dstBoundsT, d, kernelSizeY3, highOffsetY, highOffsetY, h, w); } - return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), + return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), SkIRect::MakeWH(dstBounds.width(), dstBounds.height()), dst); diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp index 4d05353f1a..d22881aa9e 100644 --- a/src/effects/SkBlurMask.cpp +++ b/src/effects/SkBlurMask.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 7d77a99840..517aa3a88d 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -624,8 +624,8 @@ public: // in OpenGL ES, mediump floats have a minimum range of 2^14. If we have coordinates bigger // than that, the shader math will end up with infinities and result in the blur effect not // working correctly. To avoid this, we switch into highp when the coordinates are too big. - // As 2^14 is the minimum range but the actual range can be bigger, we might end up - // switching to highp sooner than strictly necessary, but most devices that have a bigger + // As 2^14 is the minimum range but the actual range can be bigger, we might end up + // switching to highp sooner than strictly necessary, but most devices that have a bigger // range for mediump also have mediump being exactly the same as highp (e.g. all non-OpenGL // ES devices), and thus incur no additional penalty for the switch. static const SkScalar kMAX_BLUR_COORD = SkIntToScalar(16000); @@ -744,12 +744,12 @@ void GrGLRectBlurEffect::emitCode(EmitArgs& args) { fragBuilder->codeAppendf("vec4 src=vec4(1);"); } - fragBuilder->codeAppendf("%s vec2 translatedPos = %s.xy - %s.xy;", precisionString, fragmentPos, + fragBuilder->codeAppendf("%s vec2 translatedPos = %s.xy - %s.xy;", precisionString, fragmentPos, rectName); fragBuilder->codeAppendf("%s float width = %s.z - %s.x;", precisionString, rectName, rectName); fragBuilder->codeAppendf("%s float height = %s.w - %s.y;", precisionString, rectName, rectName); - fragBuilder->codeAppendf("%s vec2 smallDims = vec2(width - %s, height - %s);", precisionString, + fragBuilder->codeAppendf("%s vec2 smallDims = vec2(width - %s, height - %s);", precisionString, profileSizeName, profileSizeName); fragBuilder->codeAppendf("%s float center = 2.0 * floor(%s/2.0 + .25) - 1.0;", precisionString, profileSizeName); @@ -757,7 +757,7 @@ void GrGLRectBlurEffect::emitCode(EmitArgs& args) { OutputRectBlurProfileLookup(fragBuilder, args.fSamplers[0], "horiz_lookup", profileSizeName, "translatedPos.x", "width", "wh.x"); - OutputRectBlurProfileLookup(fragBuilder, args.fSamplers[0], "vert_lookup", profileSizeName, + OutputRectBlurProfileLookup(fragBuilder, args.fSamplers[0], "vert_lookup", profileSizeName, "translatedPos.y", "height", "wh.y"); fragBuilder->codeAppendf("float final = horiz_lookup * vert_lookup;"); @@ -1168,7 +1168,7 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvid SkRect proxyRect = rrect.rect(); proxyRect.outset(extra, extra); - SkAutoTUnref fp(GrRRectBlurEffect::Create(texProvider, + SkAutoTUnref fp(GrRRectBlurEffect::Create(texProvider, xformedSigma, rrect)); if (!fp) { return false; diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 1e2cdacb97..1da8b2ce16 100644 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -35,7 +35,7 @@ SkImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, SkImageFilter } SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, - SkImageFilter* input, + SkImageFilter* input, const CropRect* cropRect) : INHERITED(1, &input, cropRect) , fColorFilter(SkRef(cf)) { diff --git a/src/effects/SkColorMatrix.cpp b/src/effects/SkColorMatrix.cpp index d99d51e1de..45cd502009 100644 --- a/src/effects/SkColorMatrix.cpp +++ b/src/effects/SkColorMatrix.cpp @@ -192,4 +192,3 @@ void SkColorMatrix::setYUV2RGB() { setrow(fMat + 10, 1, kU2B, 0); fMat[kA_Scale] = 1; } - diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index 325e2ca94a..c38889c608 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index 1989d9d603..5e68dc67ef 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index ab4767c64b..ec75fd0604 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -631,4 +631,3 @@ void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc, b->add32(xKey | yKey); } #endif - diff --git a/src/effects/SkEmbossMask.cpp b/src/effects/SkEmbossMask.cpp index 32e9b232ae..310addf57d 100644 --- a/src/effects/SkEmbossMask.cpp +++ b/src/effects/SkEmbossMask.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkEmbossMask.h b/src/effects/SkEmbossMask.h index 7053be2b55..80fcb20c3d 100644 --- a/src/effects/SkEmbossMask.h +++ b/src/effects/SkEmbossMask.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkEmbossMask_Table.h b/src/effects/SkEmbossMask_Table.h index 0d331ee19c..b7073f302b 100644 --- a/src/effects/SkEmbossMask_Table.h +++ b/src/effects/SkEmbossMask_Table.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index 7fac2a6b2c..c43f27303e 100644 --- a/src/effects/SkGpuBlurUtils.cpp +++ b/src/effects/SkGpuBlurUtils.cpp @@ -300,7 +300,7 @@ GrTexture* GaussianBlur(GrContext* context, srcDrawContext.reset(context->drawContext(srcTexture->asRenderTarget())); if (!srcDrawContext) { return nullptr; - } + } } // Clear out a radius to the right of the srcRect to prevent the @@ -333,7 +333,7 @@ GrTexture* GaussianBlur(GrContext* context, srcDrawContext.reset(context->drawContext(srcTexture->asRenderTarget())); if (!srcDrawContext) { return nullptr; - } + } } // Clear out a radius below the srcRect to prevent the Y diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp index 526fb4d7e3..0a5c4f9df3 100644 --- a/src/effects/SkLayerDrawLooper.cpp +++ b/src/effects/SkLayerDrawLooper.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp index 351265c46e..a51613a162 100644 --- a/src/effects/SkLayerRasterizer.cpp +++ b/src/effects/SkLayerRasterizer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 4b0ab8e030..92028180f6 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -743,7 +743,7 @@ class GrGLLight; class SkImageFilterLight : public SkRefCnt { public: - + enum LightType { kDistant_LightType, @@ -880,8 +880,8 @@ public: // Use X scale and Y scale on Z and average the result SkPoint locationZ = SkPoint::Make(fLocation.fZ, fLocation.fZ); matrix.mapVectors(&locationZ, 1); - SkPoint3 location = SkPoint3::Make(location2.fX, - location2.fY, + SkPoint3 location = SkPoint3::Make(location2.fX, + location2.fY, SkScalarAve(locationZ.fX, locationZ.fY)); return new SkPointLight(location, color()); } diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp index e3b99c690a..47d33dffb4 100755 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/SkMergeImageFilter.cpp @@ -77,7 +77,7 @@ sk_sp SkMergeImageFilter::onFilterImage(SkSpecialImage* source, if (!inputs[i]) { continue; } - const SkIRect inputBounds = SkIRect::MakeXYWH(offsets[i].fX, offsets[i].fY, + const SkIRect inputBounds = SkIRect::MakeXYWH(offsets[i].fX, offsets[i].fY, inputs[i]->width(), inputs[i]->height()); bounds.join(inputBounds); } @@ -165,7 +165,7 @@ void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const { #ifndef SK_IGNORE_TO_STRING void SkMergeImageFilter::toString(SkString* str) const { str->appendf("SkMergeImageFilter: ("); - + for (int i = 0; i < this->countInputs(); ++i) { SkImageFilter* filter = this->getInput(i); str->appendf("%d: (", i); diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index b592fd01b0..8c952e87a2 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -611,7 +611,7 @@ sk_sp SkMorphologyImageFilter::filterImageGeneric(bool dilate, call_proc_X(procX, inputPixmap, &dst, width, srcBounds); } else if (height > 0) { call_proc_Y(procY, - inputPixmap.addr32(srcBounds.left(), srcBounds.top()), + inputPixmap.addr32(srcBounds.left(), srcBounds.top()), inputPixmap.rowBytesAsPixels(), &dst, height, srcBounds); } @@ -632,4 +632,3 @@ sk_sp SkErodeImageFilter::onFilterImage(SkSpecialImage* source, SkIPoint* offset) const { return this->filterImageGeneric(false, source, ctx, offset); } - diff --git a/src/effects/SkPackBits.h b/src/effects/SkPackBits.h index f6430faadd..2dc7677afc 100644 --- a/src/effects/SkPackBits.h +++ b/src/effects/SkPackBits.h @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index 8f8853ec36..f5e3d4680b 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -17,7 +17,7 @@ SkPictureImageFilter::SkPictureImageFilter(sk_sp picture) : INHERITED(0, 0, nullptr) , fPicture(std::move(picture)) , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty()) - , fPictureResolution(kDeviceSpace_PictureResolution) + , fPictureResolution(kDeviceSpace_PictureResolution) , fFilterQuality(kLow_SkFilterQuality) { } @@ -48,7 +48,7 @@ SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) { pictureResolution = kDeviceSpace_PictureResolution; } else { pictureResolution = (PictureResolution)buffer.readInt(); - } + } if (kLocalSpace_PictureResolution == pictureResolution) { //filterLevel is only serialized if pictureResolution is LocalSpace @@ -105,9 +105,9 @@ bool SkPictureImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& return false; } - if (kDeviceSpace_PictureResolution == fPictureResolution || + if (kDeviceSpace_PictureResolution == fPictureResolution || 0 == (ctx.ctm().getType() & ~SkMatrix::kTranslate_Mask)) { - this->drawPictureAtDeviceResolution(device.get(), bounds, ctx); + this->drawPictureAtDeviceResolution(device.get(), bounds, ctx); } else { this->drawPictureAtLocalResolution(proxy, device.get(), bounds, ctx); } @@ -161,7 +161,7 @@ void SkPictureImageFilter::drawPictureAtLocalResolution(Proxy* proxy, SkBaseDevi #ifndef SK_IGNORE_TO_STRING void SkPictureImageFilter::toString(SkString* str) const { str->appendf("SkPictureImageFilter: ("); - str->appendf("crop: (%f,%f,%f,%f) ", + str->appendf("crop: (%f,%f,%f,%f) ", fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fBottom); if (fPicture) { str->appendf("picture: (%f,%f,%f,%f)", diff --git a/src/effects/SkPixelXorXfermode.cpp b/src/effects/SkPixelXorXfermode.cpp index e175840d32..c69fe0933b 100644 --- a/src/effects/SkPixelXorXfermode.cpp +++ b/src/effects/SkPixelXorXfermode.cpp @@ -294,7 +294,7 @@ private: void onSetData(const GrGLSLProgramDataManager& pdman, const GrXferProcessor& processor) override { const PixelXorXP& pixelXor = processor.cast(); - pdman.set3f(fOpColorUni, + pdman.set3f(fOpColorUni, SkGetPackedR32(pixelXor.opColor())/255.0f, SkGetPackedG32(pixelXor.opColor())/255.0f, SkGetPackedB32(pixelXor.opColor())/255.0f); diff --git a/src/effects/SkTableMaskFilter.cpp b/src/effects/SkTableMaskFilter.cpp index 88484d7091..ddf9f33f54 100644 --- a/src/effects/SkTableMaskFilter.cpp +++ b/src/effects/SkTableMaskFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 09651b632c..8f7fdc70e3 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -247,4 +247,3 @@ bool SkXfermodeImageFilter::filterImageGPUDeprecated(Proxy* proxy, } #endif - diff --git a/src/effects/gradients/SkGradientBitmapCache.cpp b/src/effects/gradients/SkGradientBitmapCache.cpp index cba103be36..20b87e02ca 100644 --- a/src/effects/gradients/SkGradientBitmapCache.cpp +++ b/src/effects/gradients/SkGradientBitmapCache.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/effects/gradients/SkGradientBitmapCache.h b/src/effects/gradients/SkGradientBitmapCache.h index 81bd214fe0..0dcd32272e 100644 --- a/src/effects/gradients/SkGradientBitmapCache.h +++ b/src/effects/gradients/SkGradientBitmapCache.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index 254e438624..1312b36927 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/effects/gradients/SkRadialGradient.h b/src/effects/gradients/SkRadialGradient.h index 428d7fae79..6e41e7982e 100644 --- a/src/effects/gradients/SkRadialGradient.h +++ b/src/effects/gradients/SkRadialGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index 3021e4bc08..f14035c526 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/effects/gradients/SkSweepGradient.h b/src/effects/gradients/SkSweepGradient.h index f458cea8ce..de57335f4f 100644 --- a/src/effects/gradients/SkSweepGradient.h +++ b/src/effects/gradients/SkSweepGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h index 5783c39bd4..309b66626f 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.h +++ b/src/effects/gradients/SkTwoPointConicalGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp index 539436928c..4f1dabe6c2 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -293,7 +292,7 @@ void GLEdge2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& pdman, if (fCachedRadius != radius0 || fCachedDiffRadius != diffRadius) { - pdman.set3f(fParamUni, SkScalarToFloat(radius0), + pdman.set3f(fParamUni, SkScalarToFloat(radius0), SkScalarToFloat(SkScalarMul(radius0, radius0)), SkScalarToFloat(diffRadius)); fCachedRadius = radius0; fCachedDiffRadius = diffRadius; diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp index 353d90183c..82dc7f713f 100644 --- a/src/gpu/GrAuditTrail.cpp +++ b/src/gpu/GrAuditTrail.cpp @@ -19,11 +19,11 @@ void GrAuditTrail::addBatch(const GrBatch* batch) { auditBatch->fClientID = kGrAuditTrailInvalidID; auditBatch->fBatchListID = kGrAuditTrailInvalidID; auditBatch->fChildID = kGrAuditTrailInvalidID; - + // consume the current stack trace if any auditBatch->fStackTrace = fCurrentStackTrace; fCurrentStackTrace.reset(); - + if (fClientID != kGrAuditTrailInvalidID) { auditBatch->fClientID = fClientID; Batches** batchesLookup = fClientIDLookup.find(fClientID); @@ -70,13 +70,13 @@ void GrAuditTrail::batchingResultCombined(const GrBatch* consumer, const GrBatch // steal all of consumed's batches for (int i = 0; i < consumedBatch.fChildren.count(); i++) { Batch* childBatch = consumedBatch.fChildren[i]; - + // set the ids for the child batch childBatch->fBatchListID = index; childBatch->fChildID = consumerBatch.fChildren.count(); consumerBatch.fChildren.push_back(childBatch); } - + // Update the bounds for the combineWith node consumerBatch.fBounds = consumer->bounds(); @@ -116,7 +116,7 @@ void GrAuditTrail::getBoundsByClientID(SkTArray* outInfo, int clientI if (kGrAuditTrailInvalidID == currentBatchListID || batch->fBatchListID != currentBatchListID) { BatchInfo& outBatchInfo = outInfo->push_back(); - + // copy out all of the batches so the client can display them even if // they have a different clientID this->copyOutFromBatchList(&outBatchInfo, batch->fBatchListID); diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h index 6bfff0cd89..564abd917f 100644 --- a/src/gpu/GrAutoLocaleSetter.h +++ b/src/gpu/GrAutoLocaleSetter.h @@ -36,7 +36,7 @@ class GrAutoLocaleSetter : public SkNoncopyable { public: GrAutoLocaleSetter (const char* name) { #if defined(SK_BUILD_FOR_WIN) - fOldPerThreadLocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); + fOldPerThreadLocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); char* oldLocale = setlocale(LC_ALL, name); if (oldLocale) { fOldLocale = oldLocale; @@ -84,4 +84,3 @@ private: #undef HAVE_LOCALE_T #endif - diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 865865862b..65b18a5edc 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -99,8 +99,8 @@ static GrTexture* create_mask_GPU(GrContext* context, const GrStrokeInfo& strokeInfo, bool doAA, int sampleCnt) { - // This mask will ultimately be drawn as a non-AA rect (see draw_mask). - // Non-AA rects have a bad habit of snapping arbitrarily. Integerize here + // This mask will ultimately be drawn as a non-AA rect (see draw_mask). + // Non-AA rects have a bad habit of snapping arbitrarily. Integerize here // so the mask draws in a reproducible manner. *maskRect = SkRect::Make(maskRect->roundOut()); @@ -275,7 +275,7 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, strokeInfo, pathPtr, pathIsMutable); } -void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, +void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, GrDrawContext* drawContext, const GrClip& clip, const SkPath& origSrcPath, @@ -347,4 +347,3 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); } } - diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp index ac34b5cfcc..278cf86bfd 100644 --- a/src/gpu/GrBufferAllocPool.cpp +++ b/src/gpu/GrBufferAllocPool.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp index 1c5371a273..41f5b9b391 100644 --- a/src/gpu/GrCaps.cpp +++ b/src/gpu/GrCaps.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index e04adee90d..2700f56986 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -86,9 +86,9 @@ bool GrClipMaskManager::PathNeedsSWRenderer(GrContext* context, path.toggleInverseFillType(); } GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); - + GrPathRendererChain::DrawType type; - + if (needsStencil) { type = element->isAA() ? GrPathRendererChain::kStencilAndColorAntiAlias_DrawType @@ -96,9 +96,9 @@ bool GrClipMaskManager::PathNeedsSWRenderer(GrContext* context, } else { type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_DrawType - : GrPathRendererChain::kColor_DrawType; + : GrPathRendererChain::kColor_DrawType; } - + GrPathRenderer::CanDrawPathArgs canDrawArgs; canDrawArgs.fShaderCaps = context->caps()->shaderCaps(); canDrawArgs.fViewMatrix = &viewMatrix; @@ -177,7 +177,7 @@ bool GrClipMaskManager::UseSWOnlyPath(GrContext* context, SkRegion::Op op = element->getOp(); bool invert = element->isInverseFilled(); - bool needsStencil = invert || + bool needsStencil = invert || SkRegion::kIntersect_Op == op || SkRegion::kReverseDifference_Op == op; if (PathNeedsSWRenderer(context, pipelineBuilder.getStencil().isDisabled(), diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h index 36354545d5..ef0c2be040 100644 --- a/src/gpu/GrClipMaskManager.h +++ b/src/gpu/GrClipMaskManager.h @@ -71,7 +71,7 @@ public: bool setupScissorClip(const GrPipelineBuilder& pipelineBuilder, GrPipelineBuilder::AutoRestoreStencil* ars, - const SkIRect& scissor, + const SkIRect& scissor, const SkRect* devBounds, GrAppliedClip* out); diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp index 4e1a3e0d64..00ae1226e8 100755 --- a/src/gpu/GrContextFactory.cpp +++ b/src/gpu/GrContextFactory.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 12bb1dec2b..9110b34d6f 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -43,7 +42,7 @@ class AutoCheckFlush { public: - AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingManager) { + AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingManager) { SkASSERT(fDrawingManager); } ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); } @@ -270,7 +269,7 @@ GrDrawBatch* GrDrawContext::getFillRectBatch(const GrPaint& paint, } else { // filled BW rect batch = GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect, - nullptr, nullptr); + nullptr, nullptr); } return batch; @@ -348,7 +347,7 @@ void GrDrawContext::drawRect(const GrClip& clip, width, snapToPixelCenters)); // Depending on sub-pixel coordinates and the particular GPU, we may lose a corner of - // hairline rects. We jam all the vertices to pixel centers to avoid this, but not + // hairline rects. We jam all the vertices to pixel centers to avoid this, but not // when MSAA is enabled because it can cause ugly artifacts. } } @@ -364,7 +363,7 @@ void GrDrawContext::drawRect(const GrClip& clip, this->getDrawTarget()->drawBatch(pipelineBuilder, batch); return; } - + SkPath path; path.setIsVolatile(true); path.addRect(rect); @@ -519,12 +518,12 @@ void GrDrawContext::drawAtlas(const GrClip& clip, GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawAtlas"); AutoCheckFlush acf(fDrawingManager); - + GrDrawAtlasBatch::Geometry geometry; geometry.fColor = paint.getColor(); SkAutoTUnref batch(GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xform, texRect, colors)); - + GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); this->getDrawTarget()->drawBatch(pipelineBuilder, batch); } @@ -599,7 +598,7 @@ bool GrDrawContext::drawFilledDRRect(const GrClip& clip, } } else { inverseVM.reset(); - } + } GrPaint grPaint(paintIn); grPaint.setAntiAlias(false); @@ -622,7 +621,7 @@ bool GrDrawContext::drawFilledDRRect(const GrClip& clip, if (applyAA) { bounds.outset(SK_ScalarHalf, SK_ScalarHalf); } - + this->fillRectWithLocalMatrix(clip, grPaint, SkMatrix::I(), bounds, inverseVM); return true; } @@ -866,8 +865,8 @@ bool GrDrawContextPriv::drawAndStencilPath(const SkIRect* scissorRect, GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::drawPath"); if (path.isEmpty() && path.isInverseFillType()) { - this->drawAndStencilRect(scissorRect, ss, op, invert, false, SkMatrix::I(), - SkRect::MakeIWH(fDrawContext->fRenderTarget->width(), + this->drawAndStencilRect(scissorRect, ss, op, invert, false, SkMatrix::I(), + SkRect::MakeIWH(fDrawContext->fRenderTarget->width(), fDrawContext->fRenderTarget->height())); return true; } diff --git a/src/gpu/GrDrawContextPriv.h b/src/gpu/GrDrawContextPriv.h index 935b631a26..4482e35672 100644 --- a/src/gpu/GrDrawContextPriv.h +++ b/src/gpu/GrDrawContextPriv.h @@ -46,7 +46,7 @@ private: GrDrawContextPriv* operator&(); GrDrawContext* fDrawContext; - + friend class GrDrawContext; // to construct/copy this type. }; @@ -57,4 +57,3 @@ inline const GrDrawContextPriv GrDrawContext::drawContextPriv () const { } #endif - diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index 39c1e32d07..49c46feeaf 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * @@ -468,7 +467,7 @@ void GrDrawTarget::recordBatch(GrBatch* batch) { batch->bounds().fLeft, batch->bounds().fRight, batch->bounds().fTop, batch->bounds().fBottom); GrBATCH_INFO(SkTabString(batch->dumpInfo(), 1).c_str()); - GrBATCH_INFO("\tOutcome:\n"); + GrBATCH_INFO("\tOutcome:\n"); int maxCandidates = SkTMin(fMaxBatchLookback, fBatches.count()); if (maxCandidates) { int i = 0; @@ -568,13 +567,13 @@ bool GrDrawTarget::installPipelineInDrawBatch(const GrPipelineBuilder* pipelineB viewport.fWidth = rt->width(); viewport.fHeight = rt->height(); SkIRect ibounds; - ibounds.fLeft = SkTPin(SkScalarFloorToInt(batch->bounds().fLeft), viewport.fLeft, + ibounds.fLeft = SkTPin(SkScalarFloorToInt(batch->bounds().fLeft), viewport.fLeft, viewport.fWidth); - ibounds.fTop = SkTPin(SkScalarFloorToInt(batch->bounds().fTop), viewport.fBottom, + ibounds.fTop = SkTPin(SkScalarFloorToInt(batch->bounds().fTop), viewport.fBottom, viewport.fHeight); - ibounds.fRight = SkTPin(SkScalarCeilToInt(batch->bounds().fRight), viewport.fLeft, + ibounds.fRight = SkTPin(SkScalarCeilToInt(batch->bounds().fRight), viewport.fLeft, viewport.fWidth); - ibounds.fBottom = SkTPin(SkScalarCeilToInt(batch->bounds().fBottom), viewport.fBottom, + ibounds.fBottom = SkTPin(SkScalarCeilToInt(batch->bounds().fBottom), viewport.fBottom, viewport.fHeight); if (scissor != nullptr && scissor->enabled()) { if (!ibounds.intersect(scissor->rect())) { diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index ca50fe4502..6efc286e73 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -63,7 +63,7 @@ void GrDrawingManager::flush() { } fFlushing = true; - SkDEBUGCODE(bool result =) + SkDEBUGCODE(bool result =) SkTTopoSort(&fDrawTargets); SkASSERT(result); @@ -129,7 +129,7 @@ GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) { *fDrawTargets.append() = dt; - // DrawingManager gets the creation ref - this ref is for the caller + // DrawingManager gets the creation ref - this ref is for the caller return SkRef(dt); } diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h index 0a4c3e3c7d..f011b4194b 100644 --- a/src/gpu/GrDrawingManager.h +++ b/src/gpu/GrDrawingManager.h @@ -33,7 +33,7 @@ public: GrDrawContext* drawContext(GrRenderTarget* rt, const SkSurfaceProps*); - // The caller automatically gets a ref on the returned drawTarget. It must + // The caller automatically gets a ref on the returned drawTarget. It must // be balanced by an unref call. GrDrawTarget* newDrawTarget(GrRenderTarget* rt); diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index 495a7b3a33..46efd80690 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -373,4 +372,3 @@ const GrFragmentProcessor* GrFragmentProcessor::RunInSeries(const GrFragmentProc return new SeriesFragmentProcessor(series, cnt); } } - diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 35c04caa23..4f99ab83a5 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -488,4 +488,3 @@ bool GrGpu::draw(const GrPipeline& pipeline, this->onDraw(pipeline, primProc, meshes, meshCount); return true; } - diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index a49b2c28fd..8562d1e509 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -132,7 +132,7 @@ public: * @return the buffer if successful, otherwise nullptr. */ GrBuffer* createBuffer(GrBufferType, size_t size, GrAccessPattern); - + /** * Resolves MSAA. */ @@ -357,7 +357,7 @@ public: const GrMesh*, int meshCount); - // Called by drawtarget when flushing. + // Called by drawtarget when flushing. // Provides a hook for post-flush actions (e.g. PLS reset and Vulkan command buffer submits). virtual void finishDrawTarget() {} diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp index 8525af7670..c6134b65a2 100644 --- a/src/gpu/GrGpuFactory.cpp +++ b/src/gpu/GrGpuFactory.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp index 7c053b31d7..53e568b2a4 100644 --- a/src/gpu/GrGpuResource.cpp +++ b/src/gpu/GrGpuResource.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -37,7 +36,7 @@ GrGpuResource::~GrGpuResource() { SkASSERT(this->wasDestroyed()); } -void GrGpuResource::release() { +void GrGpuResource::release() { SkASSERT(fGpu); this->onRelease(); get_resource_cache(fGpu)->resourceAccess().removeResource(this); diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h index 4b47a1c932..cccbecf423 100644 --- a/src/gpu/GrGpuResourceCacheAccess.h +++ b/src/gpu/GrGpuResourceCacheAccess.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -41,7 +40,7 @@ private: * ownership of. */ bool isAdopted() const { return GrGpuResource::kAdopted_LifeCycle == fResource->fLifeCycle; } - + /** * Called by the cache to delete the resource under normal circumstances. */ diff --git a/src/gpu/GrGpuResourcePriv.h b/src/gpu/GrGpuResourcePriv.h index 5da1c94878..8b672832c5 100644 --- a/src/gpu/GrGpuResourcePriv.h +++ b/src/gpu/GrGpuResourcePriv.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/gpu/GrImageIDTextureAdjuster.h b/src/gpu/GrImageIDTextureAdjuster.h index 454571eca7..ad5e671b73 100644 --- a/src/gpu/GrImageIDTextureAdjuster.h +++ b/src/gpu/GrImageIDTextureAdjuster.h @@ -15,7 +15,7 @@ class SkBitmap; class SkImage_Base; class SkImageCacherator; -/** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope and unmodified +/** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope and unmodified while this object exists. */ class GrBitmapTextureAdjuster : public GrTextureAdjuster { public: diff --git a/src/gpu/GrInvariantOutput.cpp b/src/gpu/GrInvariantOutput.cpp index 8de5817054..ee64d333ab 100644 --- a/src/gpu/GrInvariantOutput.cpp +++ b/src/gpu/GrInvariantOutput.cpp @@ -29,4 +29,3 @@ bool GrInvariantOutput::colorComponentsAllEqual() const { } #endif // end DEBUG - diff --git a/src/gpu/GrLayerAtlas.cpp b/src/gpu/GrLayerAtlas.cpp index c1f8732b35..ccb208a71c 100644 --- a/src/gpu/GrLayerAtlas.cpp +++ b/src/gpu/GrLayerAtlas.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * @@ -167,4 +166,3 @@ GrLayerAtlas::Plot* GrLayerAtlas::addToAtlas(ClientPlotUsage* usage, // If the above fails, then the current plot list has no room return nullptr; } - diff --git a/src/gpu/GrLayerAtlas.h b/src/gpu/GrLayerAtlas.h index e84667b5ea..cf182626a8 100644 --- a/src/gpu/GrLayerAtlas.h +++ b/src/gpu/GrLayerAtlas.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * @@ -20,10 +19,10 @@ class GrTextureProvider; class GrRectanizer; // The backing GrTexture for a GrLayerAtlas is broken into a spatial grid of Plots. When -// the atlas needs space on the texture (i.e., in response to an addToAtlas call), it -// iterates through the plots in use by the requesting client looking for space and, -// if no space is found, opens up a new Plot for that client. The Plots keep track of -// subimage placement via their GrRectanizer. +// the atlas needs space on the texture (i.e., in response to an addToAtlas call), it +// iterates through the plots in use by the requesting client looking for space and, +// if no space is found, opens up a new Plot for that client. The Plots keep track of +// subimage placement via their GrRectanizer. // // If all Plots are full, the replacement strategy is up to the client. The Plot::reset // call will remove a Plot's knowledge of any allocated rects - freeing its space for reuse. @@ -57,7 +56,7 @@ public: // This class allows each client to independently track the Plots in // which its data is stored. - // For example, multiple pictures may simultaneously store their layers in the + // For example, multiple pictures may simultaneously store their layers in the // layer atlas. When a picture goes away it can use the ClientPlotUsage to remove itself // from those plots. class ClientPlotUsage { @@ -87,8 +86,8 @@ public: } #ifdef SK_DEBUG - bool contains(const Plot* plot) const { - return fPlots.contains(const_cast(plot)); + bool contains(const Plot* plot) const { + return fPlots.contains(const_cast(plot)); } #endif @@ -97,13 +96,13 @@ public: SkDEBUGCODE(int fMaxPlots;) }; - GrLayerAtlas(GrTextureProvider*, GrPixelConfig, GrSurfaceFlags flags, + GrLayerAtlas(GrTextureProvider*, GrPixelConfig, GrSurfaceFlags flags, const SkISize& backingTextureSize, int numPlotsX, int numPlotsY); ~GrLayerAtlas(); - // Requests a width x height block in the atlas. Upon success it returns - // the containing Plot and absolute location in the backing texture. + // Requests a width x height block in the atlas. Upon success it returns + // the containing Plot and absolute location in the backing texture. // nullptr is returned if there is no more space in the atlas. Plot* addToAtlas(ClientPlotUsage*, int width, int height, SkIPoint16* loc); diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h index 4f4317c298..b341cb221d 100644 --- a/src/gpu/GrLayerCache.h +++ b/src/gpu/GrLayerCache.h @@ -34,7 +34,7 @@ public: static uint32_t Hash(const uint32_t& key) { return SkChecksum::Mix(key); } // GrPictureInfo proper - GrPictureInfo(uint32_t pictureID) + GrPictureInfo(uint32_t pictureID) : fPictureID(pictureID) , fPlotUsage(kNumPlots) { #if !GR_CACHE_HOISTED_LAYERS diff --git a/src/gpu/GrLayerHoister.h b/src/gpu/GrLayerHoister.h index 13cac5173a..8b338a8224 100644 --- a/src/gpu/GrLayerHoister.h +++ b/src/gpu/GrLayerHoister.h @@ -47,7 +47,7 @@ public: @param topLevelPicture The top-level picture that is about to be rendered @param initialMat The CTM of the canvas into which the layers will be drawn @param query The rectangle that is about to be drawn. - @param atlasedNeedRendering Out parameter storing the layers that + @param atlasedNeedRendering Out parameter storing the layers that should be hoisted to the atlas @param recycled Out parameter storing layers that are atlased but do not need rendering @param numSamples The number if MSAA samples required @@ -95,7 +95,7 @@ public: @param layers The hoisted layers @param replacements Replacement object that will be used for a replacement draw */ - static void ConvertLayersToReplacements(const SkPicture* topLevelPicture, + static void ConvertLayersToReplacements(const SkPicture* topLevelPicture, const SkTDArray& layers, GrReplacements* replacements); diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp index adf46846c8..ee54f6ba6e 100644 --- a/src/gpu/GrMemoryPool.cpp +++ b/src/gpu/GrMemoryPool.cpp @@ -171,7 +171,7 @@ void GrMemoryPool::validate() { SkASSERT(userStart == block->fCurrPtr); } else { AllocHeader* allocData = reinterpret_cast(userStart); - SkASSERT(allocData->fSentinal == kAssignedMarker || + SkASSERT(allocData->fSentinal == kAssignedMarker || allocData->fSentinal == kFreedMarker); SkASSERT(block == allocData->fHeader); } diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 9388f323c8..605ad6e77a 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -377,7 +377,7 @@ public: const Attribute* inEllipseOffsets0() const { return fInEllipseOffsets0; } const Attribute* inEllipseOffsets1() const { return fInEllipseOffsets1; } const SkMatrix& viewMatrix() const { return fViewMatrix; } - + class GLSLProcessor : public GrGLSLGeometryProcessor { public: GLSLProcessor() @@ -530,12 +530,12 @@ GrDrawBatch* GrOvalRenderer::CreateOvalBatch(GrColor color, if (SkScalarNearlyEqual(oval.width(), oval.height()) && circle_stays_circle(viewMatrix)) { return CreateCircleBatch(color, viewMatrix, oval, stroke); } - + // if we have shader derivative support, render as device-independent if (shaderCaps->shaderDerivativeSupport()) { return CreateDIEllipseBatch(color, viewMatrix, oval, stroke); } - + // otherwise axis-aligned ellipses only if (viewMatrix.rectStaysRect()) { return CreateEllipseBatch(color, viewMatrix, oval, stroke); @@ -581,7 +581,7 @@ public: return string; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -765,7 +765,7 @@ public: const char* name() const override { return "EllipseBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -990,7 +990,7 @@ public: const char* name() const override { return "DIEllipseBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -1063,7 +1063,7 @@ private: } helper.recordDraw(target); } - + DIEllipseBatch(const Geometry& geometry, const SkRect& bounds) : INHERITED(ClassID()) { fGeoData.push_back(geometry); @@ -1251,7 +1251,7 @@ public: const char* name() const override { return "RRectCircleBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -1400,7 +1400,7 @@ public: const char* name() const override { return "RRectEllipseRendererBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/GrPLSGeometryProcessor.h b/src/gpu/GrPLSGeometryProcessor.h index 5c1d6ee6f4..0640af63f0 100644 --- a/src/gpu/GrPLSGeometryProcessor.h +++ b/src/gpu/GrPLSGeometryProcessor.h @@ -16,7 +16,7 @@ */ class GrPLSGeometryProcessor : public GrGeometryProcessor { public: - GrPixelLocalStorageState getPixelLocalStorageState() const override { + GrPixelLocalStorageState getPixelLocalStorageState() const override { return GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState; } diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp index c381562b7c..af93e8fa90 100644 --- a/src/gpu/GrPaint.cpp +++ b/src/gpu/GrPaint.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * @@ -57,7 +56,7 @@ bool GrPaint::isConstantBlendedColor(GrColor* color) const { GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(), colorProcInfo.validFlags(), colorProcInfo.isOpaque(), - &blendedColor); + &blendedColor); } if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { diff --git a/src/gpu/GrPath.cpp b/src/gpu/GrPath.cpp index 71c13af306..04d93b10ae 100644 --- a/src/gpu/GrPath.cpp +++ b/src/gpu/GrPath.cpp @@ -211,4 +211,3 @@ bool GrPath::isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) const { return fSkPath == path; } #endif - diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h index 00165d198e..7bca17f260 100644 --- a/src/gpu/GrPathRange.h +++ b/src/gpu/GrPathRange.h @@ -23,7 +23,7 @@ class SkDescriptor; class GrPathRange : public GrGpuResource { public: - + enum PathIndexType { kU8_PathIndexType, //!< uint8_t diff --git a/src/gpu/GrPathRenderer.cpp b/src/gpu/GrPathRenderer.cpp index 3dcedf9f7c..1f53e84057 100644 --- a/src/gpu/GrPathRenderer.cpp +++ b/src/gpu/GrPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index 7ada6d10f7..85b3275e89 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -157,7 +156,7 @@ public: canArgs.fAntiAlias = args.fAntiAlias; canArgs.fIsStencilDisabled = args.fPipelineBuilder->getStencil().isDisabled(); - canArgs.fIsStencilBufferMSAA = + canArgs.fIsStencilBufferMSAA = args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisampled(); SkASSERT(this->canDrawPath(canArgs)); SkASSERT(args.fPipelineBuilder->getStencil().isDisabled() || diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp index d9717d51cb..098d8fb2d9 100644 --- a/src/gpu/GrPathRendererChain.cpp +++ b/src/gpu/GrPathRendererChain.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp index e3c4864980..d8e2e5d98e 100644 --- a/src/gpu/GrPipeline.cpp +++ b/src/gpu/GrPipeline.cpp @@ -46,7 +46,7 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, GrXferProcessor::OptFlags optFlags = GrXferProcessor::kNone_OptFlags; - const GrXferProcessor* xpForOpts = xferProcessor ? xferProcessor.get() : + const GrXferProcessor* xpForOpts = xferProcessor ? xferProcessor.get() : &GrPorterDuffXPFactory::SimpleSrcOverXP(); optFlags = xpForOpts->getOptimizations(args.fOpts, builder.getStencil().doesWrite(), @@ -92,8 +92,8 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, // information. int firstCoverageProcessorIdx = 0; - pipeline->adjustProgramFromOptimizations(builder, optFlags, args.fOpts.fColorPOI, - args.fOpts.fCoveragePOI, &firstColorProcessorIdx, + pipeline->adjustProgramFromOptimizations(builder, optFlags, args.fOpts.fColorPOI, + args.fOpts.fCoveragePOI, &firstColorProcessorIdx, &firstCoverageProcessorIdx); bool usesLocalCoords = false; @@ -134,7 +134,7 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, overrides->fFlags |= GrXPOverridesForBatch::kReadsLocalCoords_Flag; } if (SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag)) { - overrides->fFlags |= GrXPOverridesForBatch::kCanTweakAlphaForCoverage_Flag; + overrides->fFlags |= GrXPOverridesForBatch::kCanTweakAlphaForCoverage_Flag; } GrXPFactory::InvariantBlendedColor blendedColor; @@ -144,7 +144,7 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(args.fOpts.fColorPOI.color(), args.fOpts.fColorPOI.validFlags(), args.fOpts.fColorPOI.isOpaque(), - &blendedColor); + &blendedColor); } if (blendedColor.fWillBlendWithDst) { overrides->fFlags |= GrXPOverridesForBatch::kWillColorBlendWithDst_Flag; @@ -174,7 +174,7 @@ void GrPipeline::addDependenciesTo(GrRenderTarget* rt) const { const GrXferProcessor& xfer = this->getXferProcessor(); for (int i = 0; i < xfer.numTextures(); ++i) { - GrTexture* texture = xfer.textureAccess(i).getTexture(); + GrTexture* texture = xfer.textureAccess(i).getTexture(); SkASSERT(rt->getLastDrawTarget()); rt->getLastDrawTarget()->addDependency(texture); } @@ -228,4 +228,3 @@ bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, } return true; } - diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp index 2eba5354fa..d82ee1c0c2 100644 --- a/src/gpu/GrPipelineBuilder.cpp +++ b/src/gpu/GrPipelineBuilder.cpp @@ -53,7 +53,7 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, const GrPipelineOptimizations& optimizations) const { if (this->getXPFactory()) { - return this->getXPFactory()->willNeedDstTexture(caps, optimizations, + return this->getXPFactory()->willNeedDstTexture(caps, optimizations, this->hasMixedSamples()); } return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations, diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h index 83ad05f85f..4190070efb 100644 --- a/src/gpu/GrPipelineBuilder.h +++ b/src/gpu/GrPipelineBuilder.h @@ -108,7 +108,7 @@ public: */ class AutoRestoreFragmentProcessorState : public ::SkNoncopyable { public: - AutoRestoreFragmentProcessorState() + AutoRestoreFragmentProcessorState() : fPipelineBuilder(nullptr) , fColorEffectCnt(0) , fCoverageEffectCnt(0) {} @@ -169,7 +169,7 @@ public: /** * Checks whether the xp will need destination in a texture to correctly blend. */ - bool willXPNeedDstTexture(const GrCaps& caps, + bool willXPNeedDstTexture(const GrCaps& caps, const GrPipelineOptimizations& optimizations) const; /// @} @@ -303,7 +303,7 @@ public: * @param flags bitfield of Flags specifying the states to enable */ void enableState(uint32_t flags) { fFlags |= flags; } - + /** * Disable render state settings. * diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h index 3300ec757d..0d5280fbd3 100644 --- a/src/gpu/GrPrimitiveProcessor.h +++ b/src/gpu/GrPrimitiveProcessor.h @@ -47,7 +47,7 @@ class GrGLSLPrimitiveProcessor; struct GrInitInvariantOutput; -// Describes the state of pixel local storage with respect to the current draw. +// Describes the state of pixel local storage with respect to the current draw. enum GrPixelLocalStorageState { // The draw is actively updating PLS. kDraw_GrPixelLocalStorageState, @@ -208,7 +208,7 @@ public: */ virtual bool hasTransformedLocalCoords() const = 0; - virtual GrPixelLocalStorageState getPixelLocalStorageState() const { + virtual GrPixelLocalStorageState getPixelLocalStorageState() const { return kDisabled_GrPixelLocalStorageState; } @@ -216,7 +216,7 @@ public: * If non-null, overrides the dest color returned by GrGLSLFragmentShaderBuilder::dstColor(). */ virtual const char* getDestColorOverride() const { return nullptr; } - + virtual float getSampleShading() const { return 0.0; } diff --git a/src/gpu/GrProcOptInfo.h b/src/gpu/GrProcOptInfo.h index 94f80e77b2..87e7cd9c69 100644 --- a/src/gpu/GrProcOptInfo.h +++ b/src/gpu/GrProcOptInfo.h @@ -32,7 +32,7 @@ public: GrColorComponentFlags, bool areCoverageStages, bool isLCD = false); void initUsingInvariantOutput(GrInitInvariantOutput invOutput); void completeCalculations(const GrFragmentProcessor * const processors[], int cnt); - + bool isSolidWhite() const { return fInOut.isSolidWhite(); } bool isOpaque() const { return fInOut.isOpaque(); } bool isSingleComponent() const { return fInOut.isSingleComponent(); } diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp index 6611234e8a..6b56392839 100644 --- a/src/gpu/GrProgramElement.cpp +++ b/src/gpu/GrProgramElement.cpp @@ -34,4 +34,3 @@ void GrProgramElement::pendingIOComplete() const { fGpuResources[i]->pendingIOComplete(); } } - diff --git a/src/gpu/GrRectanizer_pow2.cpp b/src/gpu/GrRectanizer_pow2.cpp index 7091a57db1..bb41d7149d 100644 --- a/src/gpu/GrRectanizer_pow2.cpp +++ b/src/gpu/GrRectanizer_pow2.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/GrRectanizer_skyline.cpp b/src/gpu/GrRectanizer_skyline.cpp index 32fd410862..bbb9859d8e 100644 --- a/src/gpu/GrRectanizer_skyline.cpp +++ b/src/gpu/GrRectanizer_skyline.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/gpu/GrRectanizer_skyline.h b/src/gpu/GrRectanizer_skyline.h index 576b1fc62a..a1c571ef41 100644 --- a/src/gpu/GrRectanizer_skyline.h +++ b/src/gpu/GrRectanizer_skyline.h @@ -49,7 +49,7 @@ private: // Can a width x height rectangle fit in the free space represented by // the skyline segments >= 'skylineIndex'? If so, return true and fill in - // 'y' with the y-location at which it fits (the x location is pulled from + // 'y' with the y-location at which it fits (the x location is pulled from // 'skylineIndex's segment. bool rectangleFits(int skylineIndex, int width, int height, int* y) const; // Update the skyline structure to include a width x height rect located diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp index 41c7f101a9..ae44071976 100644 --- a/src/gpu/GrRenderTarget.cpp +++ b/src/gpu/GrRenderTarget.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -102,7 +101,7 @@ bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { if (!fRenderTarget->completeStencilAttachment()) { SkSafeSetNull(fRenderTarget->fStencilAttachment); return false; - } + } return true; } diff --git a/src/gpu/GrRenderTargetPriv.h b/src/gpu/GrRenderTargetPriv.h index c6c89336a9..e64ed57141 100644 --- a/src/gpu/GrRenderTargetPriv.h +++ b/src/gpu/GrRenderTargetPriv.h @@ -42,7 +42,7 @@ private: GrRenderTargetPriv* operator&(); GrRenderTarget* fRenderTarget; - + friend class GrRenderTarget; // to construct/copy this type. }; diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index 087e762592..96816dd63e 100644 --- a/src/gpu/GrResourceCache.cpp +++ b/src/gpu/GrResourceCache.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h index fb13dde88e..5939c51877 100644 --- a/src/gpu/GrResourceCache.h +++ b/src/gpu/GrResourceCache.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -131,7 +130,7 @@ public: GrGpuResource* findAndRefScratchResource(const GrScratchKey& scratchKey, size_t resourceSize, uint32_t flags); - + #ifdef SK_DEBUG // This is not particularly fast and only used for validation, so debug only. int countScratchEntriesForKey(const GrScratchKey& scratchKey) const { @@ -261,7 +260,7 @@ private: bool overBudget() const { return fBudgetedBytes > fMaxBytes || fBudgetedCount > fMaxCount; } bool wouldFit(size_t bytes) { - return fBudgetedBytes+bytes <= fMaxBytes && fBudgetedCount+1 <= fMaxCount; + return fBudgetedBytes+bytes <= fMaxBytes && fBudgetedCount+1 <= fMaxCount; } uint32_t getNextTimestamp(); diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp index a73bf752b0..7f6a7f1bb0 100644 --- a/src/gpu/GrResourceProvider.cpp +++ b/src/gpu/GrResourceProvider.cpp @@ -192,4 +192,3 @@ GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget( } return this->gpu()->wrapBackendTextureAsRenderTarget(desc, ownership); } - diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index b6117e344e..396d2bea9c 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -199,7 +199,7 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds, fCompressedBuffer.reset(cmpSz); fCompressionMode = kBlitter_CompressionMode; } - } + } sk_bzero(&fDraw, sizeof(fDraw)); diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h index fb5d9e86aa..d1e1265dba 100644 --- a/src/gpu/GrSWMaskHelper.h +++ b/src/gpu/GrSWMaskHelper.h @@ -67,7 +67,7 @@ public: // Convert mask generation results to a signed distance field void toSDF(unsigned char* sdf); - + // Reset the internal bitmap void clear(uint8_t alpha) { fPixels.erase(SkColorSetARGB(alpha, 0xFF, 0xFF, 0xFF)); diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 093bef7086..ca2ca64db8 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/GrSoftwarePathRenderer.h b/src/gpu/GrSoftwarePathRenderer.h index 72a95152e2..8b2f2d7932 100644 --- a/src/gpu/GrSoftwarePathRenderer.h +++ b/src/gpu/GrSoftwarePathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -26,7 +25,7 @@ private: StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override { return GrPathRenderer::kNoSupport_StencilSupport; } - + bool onCanDrawPath(const CanDrawPathArgs&) const override; bool onDrawPath(const DrawPathArgs&) override; diff --git a/src/gpu/GrStencil.cpp b/src/gpu/GrStencil.cpp index 189cc38122..ee46edb0d5 100644 --- a/src/gpu/GrStencil.cpp +++ b/src/gpu/GrStencil.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrStencil.h b/src/gpu/GrStencil.h index fa7d626a87..fc452dab1d 100644 --- a/src/gpu/GrStencil.h +++ b/src/gpu/GrStencil.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrStencilAttachment.cpp b/src/gpu/GrStencilAttachment.cpp index 9b07070b0f..bcdeec5adb 100644 --- a/src/gpu/GrStencilAttachment.cpp +++ b/src/gpu/GrStencilAttachment.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrStencilAttachment.h b/src/gpu/GrStencilAttachment.h index 2aa8e8ce55..2faa7b6b03 100644 --- a/src/gpu/GrStencilAttachment.h +++ b/src/gpu/GrStencilAttachment.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -18,7 +17,7 @@ class GrResourceKey; class GrStencilAttachment : public GrGpuResource { public: - + virtual ~GrStencilAttachment() { // TODO: allow SB to be purged and detach itself from rts diff --git a/src/gpu/GrStrokeInfo.cpp b/src/gpu/GrStrokeInfo.cpp index 3b8ecb660b..b37c660108 100644 --- a/src/gpu/GrStrokeInfo.cpp +++ b/src/gpu/GrStrokeInfo.cpp @@ -91,4 +91,3 @@ void GrStrokeInfo::asUniqueKeyFragment(uint32_t* data) const { SkASSERT(this->computeUniqueKeyFragmentData32Cnt() == i); } - diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp index f4195dfb03..5fb008dad5 100644 --- a/src/gpu/GrTessellator.cpp +++ b/src/gpu/GrTessellator.cpp @@ -1277,7 +1277,7 @@ Poly* tessellate(Vertex* vertices, SkChunkAlloc& alloc) { // This is a driver function which calls stages 2-5 in turn. -Poly* contours_to_polys(Vertex** contours, int contourCnt, const SkRect& pathBounds, +Poly* contours_to_polys(Vertex** contours, int contourCnt, const SkRect& pathBounds, SkChunkAlloc& alloc) { Comparator c; if (pathBounds.width() > pathBounds.height()) { @@ -1316,7 +1316,7 @@ Poly* contours_to_polys(Vertex** contours, int contourCnt, const SkRect& pathBou return tessellate(vertices, alloc); } -Poly* path_to_polys(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +Poly* path_to_polys(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, int contourCnt, SkChunkAlloc& alloc, bool* isLinear) { SkPath::FillType fillType = path.getFillType(); if (SkPath::IsInverseFillType(fillType)) { @@ -1328,7 +1328,7 @@ Poly* path_to_polys(const SkPath& path, SkScalar tolerance, const SkRect& clipBo return contours_to_polys(contours.get(), contourCnt, path.getBounds(), alloc); } -void get_contour_count_and_size_estimate(const SkPath& path, SkScalar tolerance, int* contourCnt, +void get_contour_count_and_size_estimate(const SkPath& path, SkScalar tolerance, int* contourCnt, int* sizeEstimate) { int maxPts = GrPathUtils::worstCasePointCount(path, contourCnt, tolerance); if (maxPts <= 0) { @@ -1363,7 +1363,7 @@ namespace GrTessellator { // Stage 6: Triangulate the monotone polygons into a vertex buffer. -int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, VertexAllocator* vertexAllocator, bool* isLinear) { int contourCnt; int sizeEstimate; @@ -1398,7 +1398,7 @@ int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBo return actualCount; } -int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, GrTessellator::WindingVertex** verts) { int contourCnt; int sizeEstimate; diff --git a/src/gpu/GrTessellator.h b/src/gpu/GrTessellator.h index 9e7d5f0b13..7cc4311aa5 100644 --- a/src/gpu/GrTessellator.h +++ b/src/gpu/GrTessellator.h @@ -37,10 +37,10 @@ struct WindingVertex { // WindingVertex entries, each of which contains the position and winding count (which is the same // for all three vertices of a triangle). The 'verts' out parameter is set to point to the resultant // vertex array. CALLER IS RESPONSIBLE for deleting this buffer to avoid a memory leak! -int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, WindingVertex** verts); -int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, VertexAllocator*, bool *isLinear); } diff --git a/src/gpu/GrTest.h b/src/gpu/GrTest.h index 75eb53ac64..53aaac34e4 100644 --- a/src/gpu/GrTest.h +++ b/src/gpu/GrTest.h @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index 28746b9305..9051c851bd 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/GrTraceMarker.cpp b/src/gpu/GrTraceMarker.cpp index f54ab83b80..c4d2ad4cef 100644 --- a/src/gpu/GrTraceMarker.cpp +++ b/src/gpu/GrTraceMarker.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -101,4 +100,3 @@ GrTraceMarkerSet::Iter GrTraceMarkerSet::begin() const { GrTraceMarkerSet::Iter GrTraceMarkerSet::end() const { return Iter(this, this->fMarkerArray.count()); } - diff --git a/src/gpu/GrTraceMarker.h b/src/gpu/GrTraceMarker.h index 3182b3948e..a0e9625a51 100644 --- a/src/gpu/GrTraceMarker.h +++ b/src/gpu/GrTraceMarker.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp index 01534a3adb..3e2ffaa660 100644 --- a/src/gpu/GrXferProcessor.cpp +++ b/src/gpu/GrXferProcessor.cpp @@ -201,10 +201,10 @@ GrXferProcessor* GrXPFactory::createXferProcessor(const GrPipelineOptimizations& if (!caps.shaderCaps()->dstReadInShaderSupport()) { SkASSERT(dstTexture && dstTexture->texture()); } else { - SkASSERT(!dstTexture || !dstTexture->texture()); + SkASSERT(!dstTexture || !dstTexture->texture()); } } else { - SkASSERT(!dstTexture || !dstTexture->texture()); + SkASSERT(!dstTexture || !dstTexture->texture()); } SkASSERT(!hasMixedSamples || caps.shaderCaps()->dualSourceBlendingSupport()); #endif diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp index 90d553758f..3990e887b5 100644 --- a/src/gpu/GrYUVProvider.cpp +++ b/src/gpu/GrYUVProvider.cpp @@ -146,4 +146,3 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc return result.release(); } - diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index 7f9041b115..544240812b 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp index 5c5fb12421..1be2dd59bc 100644 --- a/src/gpu/SkGpuDevice_drawTexture.cpp +++ b/src/gpu/SkGpuDevice_drawTexture.cpp @@ -171,7 +171,7 @@ void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, } else { constraintMode = GrTextureAdjuster::kYes_FilterConstraint; } - + // If we have to outset for AA then we will generate texture coords outside the src rect. The // same happens for any mask filter that extends the bounds rendered in the dst. // This is conservative as a mask filter does not have to expand the bounds rendered. diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 71d9e620e3..905af81a79 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -609,7 +609,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, SkASSERT(!grPaint->getXPFactory()); SkXfermode* xfermode = skPaint.getXfermode(); if (xfermode) { - // SafeUnref in case a new xfermode is added that returns null. + // SafeUnref in case a new xfermode is added that returns null. // In such cases we will fall back to kSrcOver_Mode. SkSafeUnref(grPaint->setXPFactory(xfermode->asXPFactory())); } diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp index e21d3b9d6d..d01554b0a8 100644 --- a/src/gpu/SkGrPixelRef.cpp +++ b/src/gpu/SkGrPixelRef.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/SkGrTexturePixelRef.cpp b/src/gpu/SkGrTexturePixelRef.cpp index ae2bbddcf5..55f7aac2e4 100644 --- a/src/gpu/SkGrTexturePixelRef.cpp +++ b/src/gpu/SkGrTexturePixelRef.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp index ba19a0db85..51c1c55837 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -710,7 +709,7 @@ static void extract_verts(const GrAAConvexTessellator& tess, *reinterpret_cast(verts + i * vertexStride) = scaledColor; } else { *reinterpret_cast(verts + i * vertexStride) = color; - *reinterpret_cast(verts + i * vertexStride + sizeof(GrColor)) = + *reinterpret_cast(verts + i * vertexStride + sizeof(GrColor)) = tess.coverage(i); } } @@ -755,7 +754,7 @@ public: const char* name() const override { return "AAConvexBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrAAConvexPathRenderer.h b/src/gpu/batches/GrAAConvexPathRenderer.h index 5d51d6c98a..420ca60139 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.h +++ b/src/gpu/batches/GrAAConvexPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/batches/GrAAConvexTessellator.cpp b/src/gpu/batches/GrAAConvexTessellator.cpp index c3d25948de..7e28d24e93 100644 --- a/src/gpu/batches/GrAAConvexTessellator.cpp +++ b/src/gpu/batches/GrAAConvexTessellator.cpp @@ -36,7 +36,7 @@ static SkScalar intersect(const SkPoint& p0, const SkPoint& n0, return (v.fX * n1.fY - v.fY * n1.fX) / perpDot; } -// This is a special case version of intersect where we have the vector +// This is a special case version of intersect where we have the vector // perpendicular to the second line rather than the vector parallel to it. static SkScalar perp_intersect(const SkPoint& p0, const SkPoint& n0, const SkPoint& p1, const SkPoint& perp) { @@ -142,7 +142,7 @@ void GrAAConvexTessellator::computeBisectors() { SkVector other; other.setOrthog(fNorms[prev], fSide); fBisectors[cur] += other; - SkAssertResult(fBisectors[cur].normalize()); + SkAssertResult(fBisectors[cur].normalize()); } else { fBisectors[cur].negate(); // make the bisector face in } @@ -154,7 +154,7 @@ void GrAAConvexTessellator::computeBisectors() { // Create as many rings as we need to (up to a predefined limit) to reach the specified target // depth. If we are in fill mode, the final ring will automatically be fanned. bool GrAAConvexTessellator::createInsetRings(Ring& previousRing, SkScalar initialDepth, - SkScalar initialCoverage, SkScalar targetDepth, + SkScalar initialCoverage, SkScalar targetDepth, SkScalar targetCoverage, Ring** finalRing) { static const int kMaxNumRings = 8; @@ -167,7 +167,7 @@ bool GrAAConvexTessellator::createInsetRings(Ring& previousRing, SkScalar initia Ring* nextRing = this->getNextRing(currentRing); SkASSERT(nextRing != currentRing); - bool done = this->createInsetRing(*currentRing, nextRing, initialDepth, initialCoverage, + bool done = this->createInsetRing(*currentRing, nextRing, initialDepth, initialCoverage, targetDepth, targetCoverage, i == 0); currentRing = nextRing; if (done) { @@ -203,11 +203,11 @@ bool GrAAConvexTessellator::tessellate(const SkMatrix& m, const SkPath& path) { SkScalar coverage = 1.0f; SkScalar scaleFactor = 0.0f; if (fStrokeWidth >= 0.0f) { - SkASSERT(m.isSimilarity()); + SkASSERT(m.isSimilarity()); scaleFactor = m.getMaxScale(); // x and y scale are the same SkScalar effectiveStrokeWidth = scaleFactor * fStrokeWidth; Ring outerStrokeRing; - this->createOuterRing(fInitialRing, effectiveStrokeWidth / 2 - kAntialiasingRadius, + this->createOuterRing(fInitialRing, effectiveStrokeWidth / 2 - kAntialiasingRadius, coverage, &outerStrokeRing); outerStrokeRing.init(*this); Ring outerAARing; @@ -223,10 +223,10 @@ bool GrAAConvexTessellator::tessellate(const SkMatrix& m, const SkPath& path) { SkScalar effectiveStrokeWidth = scaleFactor * fStrokeWidth; Ring* insetStrokeRing; SkScalar strokeDepth = effectiveStrokeWidth / 2 - kAntialiasingRadius; - if (this->createInsetRings(fInitialRing, 0.0f, coverage, strokeDepth, coverage, + if (this->createInsetRings(fInitialRing, 0.0f, coverage, strokeDepth, coverage, &insetStrokeRing)) { Ring* insetAARing; - this->createInsetRings(*insetStrokeRing, strokeDepth, coverage, strokeDepth + + this->createInsetRings(*insetStrokeRing, strokeDepth, coverage, strokeDepth + kAntialiasingRadius * 2, 0.0f, &insetAARing); } } else { @@ -373,7 +373,7 @@ bool GrAAConvexTessellator::extractFromPath(const SkMatrix& m, const SkPath& pat this->computeBisectors(); } else if (this->numPts() == 2) { - // We've got two points, so we're degenerate. + // We've got two points, so we're degenerate. if (fStrokeWidth < 0.0f) { // it's a fill, so we don't need to worry about degenerate paths return false; @@ -429,7 +429,7 @@ void GrAAConvexTessellator::fanRing(const Ring& ring) { } } -void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar outset, +void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar outset, SkScalar coverage, Ring* nextRing) { const int numPts = previousRing.numPts(); if (numPts == 0) { @@ -444,9 +444,9 @@ void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar o miterLimitSq = SkScalarMul(miterLimitSq, miterLimitSq); for (int cur = 0; cur < numPts; ++cur) { int originalIdx = previousRing.index(cur); - // For each vertex of the original polygon we add at least two points to the + // For each vertex of the original polygon we add at least two points to the // outset polygon - one extending perpendicular to each impinging edge. Connecting these - // two points yields a bevel join. We need one additional point for a mitered join, and + // two points yields a bevel join. We need one additional point for a mitered join, and // a round join requires one or more points depending upon curvature. // The perpendicular point for the last edge @@ -532,7 +532,7 @@ void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar o this->addTri(originalIdx, perp1Idx, perp2Idx); break; default: - // kRound_Join is unsupported for now. GrAALinearizingConvexPathRenderer is + // kRound_Join is unsupported for now. GrAALinearizingConvexPathRenderer is // only willing to draw mitered or beveled, so we should never get here. SkASSERT(false); } @@ -574,20 +574,20 @@ void GrAAConvexTessellator::terminate(const Ring& ring) { } } -static SkScalar compute_coverage(SkScalar depth, SkScalar initialDepth, SkScalar initialCoverage, +static SkScalar compute_coverage(SkScalar depth, SkScalar initialDepth, SkScalar initialCoverage, SkScalar targetDepth, SkScalar targetCoverage) { if (SkScalarNearlyEqual(initialDepth, targetDepth)) { return targetCoverage; } - SkScalar result = (depth - initialDepth) / (targetDepth - initialDepth) * + SkScalar result = (depth - initialDepth) / (targetDepth - initialDepth) * (targetCoverage - initialCoverage) + initialCoverage; return SkScalarClampMax(result, 1.0f); } // return true when processing is complete -bool GrAAConvexTessellator::createInsetRing(const Ring& lastRing, Ring* nextRing, - SkScalar initialDepth, SkScalar initialCoverage, - SkScalar targetDepth, SkScalar targetCoverage, +bool GrAAConvexTessellator::createInsetRing(const Ring& lastRing, Ring* nextRing, + SkScalar initialDepth, SkScalar initialCoverage, + SkScalar targetDepth, SkScalar targetCoverage, bool forceNew) { bool done = false; @@ -699,9 +699,9 @@ bool GrAAConvexTessellator::createInsetRing(const Ring& lastRing, Ring* nextRing for (int i = 0; i < fCandidateVerts.numPts(); ++i) { int newIdx; if (fCandidateVerts.needsToBeNew(i) || forceNew) { - // if the originating index is still valid then this point wasn't + // if the originating index is still valid then this point wasn't // fused (and is thus movable) - SkScalar coverage = compute_coverage(depth, initialDepth, initialCoverage, + SkScalar coverage = compute_coverage(depth, initialDepth, initialCoverage, targetDepth, targetCoverage); newIdx = this->addPt(fCandidateVerts.point(i), depth, coverage, fCandidateVerts.originatingIdx(i) != -1, false); @@ -829,7 +829,7 @@ void GrAAConvexTessellator::lineTo(SkPoint p, bool isCurve) { } SkASSERT(fPts.count() <= 1 || fPts.count() == fNorms.count()+1); - if (this->numPts() >= 2 && + if (this->numPts() >= 2 && abs_dist_from_line(fPts.top(), fNorms.top(), p) < kClose) { // The old last point is on the line from the second to last to the new point this->popLastPt(); @@ -862,7 +862,7 @@ void GrAAConvexTessellator::quadTo(SkPoint pts[3]) { int maxCount = GrPathUtils::quadraticPointCount(pts, kQuadTolerance); fPointBuffer.setReserve(maxCount); SkPoint* target = fPointBuffer.begin(); - int count = GrPathUtils::generateQuadraticPoints(pts[0], pts[1], pts[2], + int count = GrPathUtils::generateQuadraticPoints(pts[0], pts[1], pts[2], kQuadTolerance, &target, maxCount); fPointBuffer.setCount(count); for (int i = 0; i < count; i++) { @@ -884,7 +884,7 @@ void GrAAConvexTessellator::cubicTo(const SkMatrix& m, SkPoint pts[4]) { int maxCount = GrPathUtils::cubicPointCount(pts, kCubicTolerance); fPointBuffer.setReserve(maxCount); SkPoint* target = fPointBuffer.begin(); - int count = GrPathUtils::generateCubicPoints(pts[0], pts[1], pts[2], pts[3], + int count = GrPathUtils::generateCubicPoints(pts[0], pts[1], pts[2], pts[3], kCubicTolerance, &target, maxCount); fPointBuffer.setCount(count); for (int i = 0; i < count; i++) { @@ -933,7 +933,7 @@ static void draw_point(SkCanvas* canvas, const SkPoint& p, SkScalar paramValue, stroke.setColor(SK_ColorYELLOW); stroke.setStyle(SkPaint::kStroke_Style); stroke.setStrokeWidth(kPointRadius/3.0f); - canvas->drawCircle(p.fX, p.fY, kPointRadius, stroke); + canvas->drawCircle(p.fX, p.fY, kPointRadius, stroke); } } @@ -985,7 +985,7 @@ void GrAAConvexTessellator::Ring::draw(SkCanvas* canvas, const GrAAConvexTessell draw_arrow(canvas, tess.point(fPts[cur].fIndex), fPts[cur].fBisector, kArrowLength, SK_ColorBLUE); } - } + } } void GrAAConvexTessellator::draw(SkCanvas* canvas) const { @@ -1012,7 +1012,7 @@ void GrAAConvexTessellator::draw(SkCanvas* canvas) const { for (int i = 0; i < this->numPts(); ++i) { draw_point(canvas, - this->point(i), 0.5f + (this->depth(i)/(2 * kAntialiasingRadius)), + this->point(i), 0.5f + (this->depth(i)/(2 * kAntialiasingRadius)), !this->movable(i)); SkPaint paint; @@ -1024,11 +1024,10 @@ void GrAAConvexTessellator::draw(SkCanvas* canvas) const { SkString num; num.printf("%d", i); - canvas->drawText(num.c_str(), num.size(), - this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f), + canvas->drawText(num.c_str(), num.size(), + this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f), paint); } } #endif - diff --git a/src/gpu/batches/GrAAConvexTessellator.h b/src/gpu/batches/GrAAConvexTessellator.h index f3d84dc8ad..faa251e2a8 100644 --- a/src/gpu/batches/GrAAConvexTessellator.h +++ b/src/gpu/batches/GrAAConvexTessellator.h @@ -31,8 +31,8 @@ class GrAAConvexTessellator; // computeDepthFromEdge requests. class GrAAConvexTessellator { public: - GrAAConvexTessellator(SkScalar strokeWidth = -1.0f, - SkPaint::Join join = SkPaint::Join::kBevel_Join, + GrAAConvexTessellator(SkScalar strokeWidth = -1.0f, + SkPaint::Join join = SkPaint::Join::kBevel_Join, SkScalar miterLimit = 0.0f) : fSide(SkPoint::kOn_Side) , fStrokeWidth(strokeWidth) @@ -61,7 +61,7 @@ public: void rewind(); private: - // CandidateVerts holds the vertices for the next ring while they are + // CandidateVerts holds the vertices for the next ring while they are // being generated. Its main function is to de-dup the points. class CandidateVerts { public: @@ -213,14 +213,14 @@ private: Ring* getNextRing(Ring* lastRing); - void createOuterRing(const Ring& previousRing, SkScalar outset, SkScalar coverage, + void createOuterRing(const Ring& previousRing, SkScalar outset, SkScalar coverage, Ring* nextRing); - bool createInsetRings(Ring& previousRing, SkScalar initialDepth, SkScalar initialCoverage, + bool createInsetRings(Ring& previousRing, SkScalar initialDepth, SkScalar initialCoverage, SkScalar targetDepth, SkScalar targetCoverage, Ring** finalRing); - bool createInsetRing(const Ring& lastRing, Ring* nextRing, - SkScalar initialDepth, SkScalar initialCoverage, SkScalar targetDepth, + bool createInsetRing(const Ring& lastRing, Ring* nextRing, + SkScalar initialDepth, SkScalar initialCoverage, SkScalar targetDepth, SkScalar targetCoverage, bool forceNew); void validate() const; @@ -237,7 +237,7 @@ private: // needed for exterior ring creation and then handed off to the initial ring. SkTDArray fBisectors; - // Tracks whether a given point is interior to a curve. Such points are + // Tracks whether a given point is interior to a curve. Such points are // assumed to have shallow curvature. SkTDArray fIsCurve; @@ -267,4 +267,3 @@ private: #endif - diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index 6a8ec2ff85..f10d3b8bbe 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -96,7 +95,7 @@ bool GrAADistanceFieldPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c if (args.fViewMatrix->hasPerspective()) { return false; } - + // only support paths with bounds within kMediumMIP by kMediumMIP, // scaled to have bounds within 2.0f*kLargeMIP by 2.0f*kLargeMIP // the goal is to accelerate rendering of lots of small paths that may be scaling @@ -155,7 +154,7 @@ public: const char* name() const override { return "AADistanceFieldPathBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { color->setKnownFourComponents(fGeoData[0].fColor); @@ -570,7 +569,7 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) { // generated due to stroking it is important that the original path's id is used // for caching. geometry.fGenID = args.fPath->getGenerationID(); - + SkAutoTUnref batch(AADistanceFieldPathBatch::Create(geometry, *args.fViewMatrix, fAtlas, &fPathCache, &fPathList)); diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.h b/src/gpu/batches/GrAADistanceFieldPathRenderer.h index c0e68268de..200d315a97 100755 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.h +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -37,7 +36,7 @@ private: public: // default ctor needed for new of uninitialized PathData // since fStroke has no default ctor - Key() + Key() : fGenID(0) , fDimension(0) , fStroke(SkStrokeRec::kFill_InitStyle) {} @@ -45,12 +44,12 @@ private: : fGenID(genID) , fDimension(dim) , fStroke(stroke) {} - + bool operator==(const Key& other) const { return other.fGenID == fGenID && other.fDimension == fDimension && fStroke.hasEqualEffect(other.fStroke); } - + private: uint32_t fGenID; // rendered size for stored path (32x32 max, 64x64 max, 128x128 max) @@ -64,11 +63,11 @@ private: SkRect fBounds; SkIPoint16 fAtlasLocation; SK_DECLARE_INTERNAL_LLIST_INTERFACE(PathData); - + static inline const Key& GetKey(const PathData& data) { return data.fKey; } - + static inline uint32_t Hash(Key key) { return SkChecksum::Murmur3(reinterpret_cast(&key), sizeof(key)); } @@ -78,11 +77,11 @@ private: typedef SkTDynamicHash PathCache; typedef SkTInternalLList PathDataList; - + GrBatchAtlas* fAtlas; PathCache fPathCache; PathDataList fPathList; - + typedef GrPathRenderer INHERITED; friend class AADistanceFieldPathBatch; diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp index 890a18b576..859328af3b 100644 --- a/src/gpu/batches/GrAAFillRectBatch.cpp +++ b/src/gpu/batches/GrAAFillRectBatch.cpp @@ -250,7 +250,7 @@ public: static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo, const GrXPOverridesForBatch& overrides) { generate_aa_fill_rect_geometry(vertices, vertexStride, - geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, + geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, overrides, nullptr); } }; @@ -298,7 +298,7 @@ public: static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo, const GrXPOverridesForBatch& overrides) { generate_aa_fill_rect_geometry(vertices, vertexStride, - geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, + geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, overrides, &geo.fLocalMatrix); } }; diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index 2cc91f9740..9056e3cb05 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -682,7 +682,7 @@ public: const char* name() const override { return "AAHairlineBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.h b/src/gpu/batches/GrAAHairLinePathRenderer.h index db2d16fd6e..e2406a5c01 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.h +++ b/src/gpu/batches/GrAAHairLinePathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp index 1cd8daf881..bd4353e951 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -134,7 +133,7 @@ public: const char* name() const override { return "AAConvexBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.h b/src/gpu/batches/GrAALinearizingConvexPathRenderer.h index 57d21e0c1e..afee5db4d4 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.h +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp index 2ce5eca7a6..90f8165762 100644 --- a/src/gpu/batches/GrAAStrokeRectBatch.cpp +++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp @@ -62,7 +62,7 @@ public: const char* name() const override { return "AAStrokeRect"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp index 654643d339..0bbf8c06d6 100644 --- a/src/gpu/batches/GrAtlasTextBatch.cpp +++ b/src/gpu/batches/GrAtlasTextBatch.cpp @@ -43,7 +43,7 @@ SkString GrAtlasTextBatch::dumpInfo() const { return str; } -void GrAtlasTextBatch::computePipelineOptimizations(GrInitInvariantOutput* color, +void GrAtlasTextBatch::computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const { if (kColorBitmapMask_MaskType == fMaskType) { diff --git a/src/gpu/batches/GrAtlasTextBatch.h b/src/gpu/batches/GrAtlasTextBatch.h index 01d799233e..82d3115ba8 100644 --- a/src/gpu/batches/GrAtlasTextBatch.h +++ b/src/gpu/batches/GrAtlasTextBatch.h @@ -90,7 +90,7 @@ public: SkString dumpInfo() const override; protected: - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override; diff --git a/src/gpu/batches/GrBatch.h b/src/gpu/batches/GrBatch.h index aae726eba9..278c826a73 100644 --- a/src/gpu/batches/GrBatch.h +++ b/src/gpu/batches/GrBatch.h @@ -96,11 +96,11 @@ public: uint32_t classID() const { SkASSERT(kIllegalBatchID != fClassID); return fClassID; } // We lazily initialize the uniqueID because currently the only user is GrAuditTrail - uint32_t uniqueID() const { + uint32_t uniqueID() const { if (kIllegalBatchID == fUniqueID) { fUniqueID = GenBatchID(); } - return fUniqueID; + return fUniqueID; } SkDEBUGCODE(bool isUsed() const { return fUsed; }) diff --git a/src/gpu/batches/GrDashLinePathRenderer.h b/src/gpu/batches/GrDashLinePathRenderer.h index f21c73b688..af8324d6f0 100644 --- a/src/gpu/batches/GrDashLinePathRenderer.h +++ b/src/gpu/batches/GrDashLinePathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 0a3dcd6a14..cda522efd0 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -228,7 +228,7 @@ public: const char* name() const override { return "DefaultPathBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp index f3b497a132..3884ef200f 100644 --- a/src/gpu/batches/GrDrawAtlasBatch.cpp +++ b/src/gpu/batches/GrDrawAtlasBatch.cpp @@ -45,7 +45,7 @@ static const GrGeometryProcessor* set_vertex_attributes(bool hasColors, if (hasColors) { gpColor.fType = Color::kAttribute_Type; } - + Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_Type); LocalCoords localCoords(LocalCoords::kHasExplicit_Type); return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewMatrix); @@ -57,14 +57,14 @@ void GrDrawAtlasBatch::onPrepareDraws(Target* target) const { this->color(), this->viewMatrix(), this->coverageIgnored())); - + target->initDraw(gp); - + int instanceCount = fGeoData.count(); size_t vertexStride = gp->getVertexStride(); SkASSERT(vertexStride == sizeof(SkPoint) + sizeof(SkPoint) + (this->hasColors() ? sizeof(GrColor) : 0)); - + QuadHelper helper; int numQuads = this->quadCount(); void* verts = helper.init(target, vertexStride, numQuads); @@ -72,11 +72,11 @@ void GrDrawAtlasBatch::onPrepareDraws(Target* target) const { SkDebugf("Could not allocate vertices\n"); return; } - + uint8_t* vertPtr = reinterpret_cast(verts); for (int i = 0; i < instanceCount; i++) { const Geometry& args = fGeoData[i]; - + size_t allocSize = args.fVerts.count(); memcpy(vertPtr, args.fVerts.begin(), allocSize); vertPtr += allocSize; @@ -90,10 +90,10 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie : INHERITED(ClassID()) { SkASSERT(xforms); SkASSERT(rects); - + fViewMatrix = viewMatrix; Geometry& installedGeo = fGeoData.push_back(geometry); - + // Figure out stride and offsets // Order within the vertex is: position [color] texCoord size_t texOffset = sizeof(SkPoint); @@ -103,13 +103,13 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie texOffset += sizeof(GrColor); vertexStride += sizeof(GrColor); } - + // Compute buffer size and alloc buffer fQuadCount = spriteCount; int allocSize = static_cast(4*vertexStride*spriteCount); installedGeo.fVerts.reset(allocSize); uint8_t* currVertex = installedGeo.fVerts.begin(); - + SkRect bounds; bounds.setLargestInverted(); int paintAlpha = GrColorUnpackA(installedGeo.fColor); @@ -118,7 +118,7 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie SkPoint quad[4]; const SkRect& currRect = rects[spriteIndex]; xforms[spriteIndex].toQuad(currRect.width(), currRect.height(), quad); - + // Copy colors if necessary if (colors) { // convert to GrColor @@ -127,13 +127,13 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie color = SkColorSetA(color, SkMulDiv255Round(SkColorGetA(color), paintAlpha)); } GrColor grColor = SkColorToPremulGrColor(color); - + *(reinterpret_cast(currVertex+sizeof(SkPoint))) = grColor; *(reinterpret_cast(currVertex+vertexStride+sizeof(SkPoint))) = grColor; *(reinterpret_cast(currVertex+2*vertexStride+sizeof(SkPoint))) = grColor; *(reinterpret_cast(currVertex+3*vertexStride+sizeof(SkPoint))) = grColor; } - + // Copy position and uv to verts *(reinterpret_cast(currVertex)) = quad[0]; *(reinterpret_cast(currVertex+texOffset)) = SkPoint::Make(currRect.fLeft, @@ -146,26 +146,26 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie currRect.fTop); bounds.growToInclude(quad[1].fX, quad[1].fY); currVertex += vertexStride; - + *(reinterpret_cast(currVertex)) = quad[2]; *(reinterpret_cast(currVertex+texOffset)) = SkPoint::Make(currRect.fRight, currRect.fBottom); bounds.growToInclude(quad[2].fX, quad[2].fY); currVertex += vertexStride; - + *(reinterpret_cast(currVertex)) = quad[3]; *(reinterpret_cast(currVertex+texOffset)) = SkPoint::Make(currRect.fLeft, currRect.fBottom); bounds.growToInclude(quad[3].fX, quad[3].fY); currVertex += vertexStride; } - + viewMatrix.mapRect(&bounds); // Outset for a half pixel in each direction to account for snapping in non-AA case bounds.outset(0.5f, 0.5f); this->setBounds(bounds); } - + bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) { GrDrawAtlasBatch* that = t->cast(); @@ -178,21 +178,21 @@ bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) { if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { return false; } - + if (this->hasColors() != that->hasColors()) { return false; } - + if (!this->hasColors() && this->color() != that->color()) { return false; } - + if (this->color() != that->color()) { fColor = GrColor_ILLEGAL; } fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin()); fQuadCount += that->quadCount(); - + this->joinBounds(that->bounds()); return true; } @@ -219,7 +219,7 @@ static SkRSXform random_xform(SkRandom* random) { static SkRect random_texRect(SkRandom* random) { static const SkScalar kMinCoord = 0.0f; static const SkScalar kMaxCoord = 1024.f; - + SkRect texRect = SkRect::MakeLTRB(random->nextRangeScalar(kMinCoord, kMaxCoord), random->nextRangeScalar(kMinCoord, kMaxCoord), random->nextRangeScalar(kMinCoord, kMaxCoord), @@ -243,21 +243,21 @@ static void randomize_params(uint32_t count, SkRandom* random, DRAW_BATCH_TEST_DEFINE(GrDrawAtlasBatch) { uint32_t spriteCount = random->nextRangeU(1, 100); - + SkTArray xforms(spriteCount); SkTArray texRects(spriteCount); SkTArray colors; - + bool hasColors = random->nextBool(); - + randomize_params(spriteCount, random, &xforms, &texRects, &colors, hasColors); - + SkMatrix viewMatrix = GrTest::TestMatrix(random); - + GrDrawAtlasBatch::Geometry geometry; geometry.fColor = GrRandomColor(random); return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.begin(), diff --git a/src/gpu/batches/GrDrawAtlasBatch.h b/src/gpu/batches/GrDrawAtlasBatch.h index b70f19043b..0a3d6136be 100644 --- a/src/gpu/batches/GrDrawAtlasBatch.h +++ b/src/gpu/batches/GrDrawAtlasBatch.h @@ -26,10 +26,10 @@ public: const SkColor* colors) { return new GrDrawAtlasBatch(geometry, viewMatrix, spriteCount, xforms, rects, colors); } - + const char* name() const override { return "DrawAtlasBatch"; } - - void computePipelineOptimizations(GrInitInvariantOutput* color, + + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -57,10 +57,10 @@ private: bool hasColors() const { return fHasColors; } int quadCount() const { return fQuadCount; } bool coverageIgnored() const { return fCoverageIgnored; } - + bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; SkSTArray<1, Geometry, true> fGeoData; - + SkMatrix fViewMatrix; GrColor fColor; int fQuadCount; diff --git a/src/gpu/batches/GrDrawBatch.h b/src/gpu/batches/GrDrawBatch.h index 4d4209ab40..d1083b30b6 100644 --- a/src/gpu/batches/GrDrawBatch.h +++ b/src/gpu/batches/GrDrawBatch.h @@ -88,7 +88,7 @@ public: } protected: - virtual void computePipelineOptimizations(GrInitInvariantOutput* color, + virtual void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const = 0; diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h index 618bc5edc5..d29d046de3 100644 --- a/src/gpu/batches/GrDrawPathBatch.h +++ b/src/gpu/batches/GrDrawPathBatch.h @@ -19,7 +19,7 @@ class GrDrawPathBatchBase : public GrDrawBatch { public: - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { color->setKnownFourComponents(fColor); diff --git a/src/gpu/batches/GrDrawVerticesBatch.cpp b/src/gpu/batches/GrDrawVerticesBatch.cpp index 20d9f79290..d3c9f5e32f 100644 --- a/src/gpu/batches/GrDrawVerticesBatch.cpp +++ b/src/gpu/batches/GrDrawVerticesBatch.cpp @@ -65,7 +65,7 @@ GrDrawVerticesBatch::GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveTy this->setBounds(bounds); } -void GrDrawVerticesBatch::computePipelineOptimizations(GrInitInvariantOutput* color, +void GrDrawVerticesBatch::computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h index 9b2faf3d3d..f2b1ea9f8a 100644 --- a/src/gpu/batches/GrDrawVerticesBatch.h +++ b/src/gpu/batches/GrDrawVerticesBatch.h @@ -42,7 +42,7 @@ public: const char* name() const override { return "DrawVerticesBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override; diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp index 17ab6c1c30..45c33d771c 100644 --- a/src/gpu/batches/GrNinePatch.cpp +++ b/src/gpu/batches/GrNinePatch.cpp @@ -74,7 +74,7 @@ public: return str; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { color->setUnknownFourComponents(); diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp index 3e5311f7b9..8c32c8339d 100644 --- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp +++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp @@ -54,7 +54,7 @@ public: const char* name() const override { return "GrStrokeRectBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp index 28ad2069bf..ee0316a255 100644 --- a/src/gpu/batches/GrPLSPathRenderer.cpp +++ b/src/gpu/batches/GrPLSPathRenderer.cpp @@ -36,7 +36,7 @@ GrPLSPathRenderer::GrPLSPathRenderer() { struct PLSVertex { SkPoint fPos; // for triangles, these are the three triangle vertices - // for quads, vert1 is the texture UV coords, and vert2 and vert3 are the line segment + // for quads, vert1 is the texture UV coords, and vert2 and vert3 are the line segment // comprising the flat edge of the quad SkPoint fVert1; SkPoint fVert2; @@ -56,7 +56,7 @@ static const float kBloatLimit = 640000.0f; #define kQuadNumVertices 5 static void add_quad(SkPoint pts[3], PLSVertices& vertices) { - SkPoint normal = SkPoint::Make(pts[0].fY - pts[2].fY, + SkPoint normal = SkPoint::Make(pts[0].fY - pts[2].fY, pts[2].fX - pts[0].fX); normal.setLength(kBloatSize); SkScalar cross = (pts[1] - pts[0]).cross(pts[2] - pts[0]); @@ -132,7 +132,7 @@ static bool bloat_tri(SkPoint pts[3]) { return true; } -static bool get_geometry(const SkPath& path, const SkMatrix& m, PLSVertices& triVertices, +static bool get_geometry(const SkPath& path, const SkMatrix& m, PLSVertices& triVertices, PLSVertices& quadVertices, GrResourceProvider* resourceProvider, SkRect bounds) { SkScalar screenSpaceTol = GrPathUtils::kDefaultTolerance; @@ -292,48 +292,48 @@ public: GrGLSLVertToFrag v1(kVec2f_GrSLType); varyingHandler->addVarying("Vertex1", &v1, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", + vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", v1.vsOut(), - te.inVertex1()->fName, + te.inVertex1()->fName, te.inVertex1()->fName); GrGLSLVertToFrag v2(kVec2f_GrSLType); varyingHandler->addVarying("Vertex2", &v2, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", + vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", v2.vsOut(), - te.inVertex2()->fName, + te.inVertex2()->fName, te.inVertex2()->fName); GrGLSLVertToFrag v3(kVec2f_GrSLType); varyingHandler->addVarying("Vertex3", &v3, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", + vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", v3.vsOut(), - te.inVertex3()->fName, + te.inVertex3()->fName, te.inVertex3()->fName); GrGLSLVertToFrag delta1(kVec2f_GrSLType); varyingHandler->addVarying("delta1", &delta1, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", + vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", delta1.vsOut(), v1.vsOut(), v2.vsOut(), v2.vsOut(), v1.vsOut()); GrGLSLVertToFrag delta2(kVec2f_GrSLType); varyingHandler->addVarying("delta2", &delta2, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", + vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", delta2.vsOut(), v2.vsOut(), v3.vsOut(), v3.vsOut(), v2.vsOut()); GrGLSLVertToFrag delta3(kVec2f_GrSLType); varyingHandler->addVarying("delta3", &delta3, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", + vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", delta3.vsOut(), v3.vsOut(), v1.vsOut(), v1.vsOut(), v3.vsOut()); GrGLSLVertToFrag windings(kInt_GrSLType); varyingHandler->addFlatVarying("windings", &windings, kLow_GrSLPrecision); - vsBuilder->codeAppendf("%s = %s;", + vsBuilder->codeAppendf("%s = %s;", windings.vsOut(), te.inWindings()->fName); // emit transforms - this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, - te.inPosition()->fName, te.localMatrix(), args.fTransformsIn, + this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, + te.inPosition()->fName, te.localMatrix(), args.fTransformsIn, args.fTransformsOut); GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder; @@ -342,11 +342,11 @@ public: SkAssertResult(fsBuilder->enableFeature( GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); fsBuilder->declAppendf(GR_GL_PLS_PATH_DATA_DECL); - // Compute four subsamples, each shifted a quarter pixel along x and y from - // gl_FragCoord. The oriented box positioning of the subsamples is of course not + // Compute four subsamples, each shifted a quarter pixel along x and y from + // gl_FragCoord. The oriented box positioning of the subsamples is of course not // optimal, but it greatly simplifies the math and this simplification is necessary for // performance reasons. - fsBuilder->codeAppendf("highp vec2 firstSample = %s.xy - vec2(0.25);", + fsBuilder->codeAppendf("highp vec2 firstSample = %s.xy - vec2(0.25);", fsBuilder->fragmentPosition()); fsBuilder->codeAppendf("highp vec2 delta1 = %s;", delta1.fsIn()); fsBuilder->codeAppendf("highp vec2 delta2 = %s;", delta2.fsIn()); @@ -355,11 +355,11 @@ public: // all are < 0, we're inside. The first vector in each case is half of what it is // "supposed" to be, because we re-use them later as adjustment factors for which half // is the correct value, so we multiply the dots by two to compensate. - fsBuilder->codeAppendf("highp float d1 = dot(delta1, (firstSample - %s).yx) * 2.0;", + fsBuilder->codeAppendf("highp float d1 = dot(delta1, (firstSample - %s).yx) * 2.0;", v1.fsIn()); - fsBuilder->codeAppendf("highp float d2 = dot(delta2, (firstSample - %s).yx) * 2.0;", + fsBuilder->codeAppendf("highp float d2 = dot(delta2, (firstSample - %s).yx) * 2.0;", v2.fsIn()); - fsBuilder->codeAppendf("highp float d3 = dot(delta3, (firstSample - %s).yx) * 2.0;", + fsBuilder->codeAppendf("highp float d3 = dot(delta3, (firstSample - %s).yx) * 2.0;", v3.fsIn()); fsBuilder->codeAppend("highp float dmax = max(d1, max(d2, d3));"); fsBuilder->codeAppendf("pls.windings[0] += (dmax <= 0.0) ? %s : 0;", windings.fsIn()); @@ -420,15 +420,15 @@ private: : fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, + fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInVertex1 = &this->addVertexAttrib(Attribute("inVertex1", kVec2f_GrVertexAttribType, + fInVertex1 = &this->addVertexAttrib(Attribute("inVertex1", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInVertex2 = &this->addVertexAttrib(Attribute("inVertex2", kVec2f_GrVertexAttribType, + fInVertex2 = &this->addVertexAttrib(Attribute("inVertex2", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInVertex3 = &this->addVertexAttrib(Attribute("inVertex3", kVec2f_GrVertexAttribType, + fInVertex3 = &this->addVertexAttrib(Attribute("inVertex3", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, + fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, kLow_GrSLPrecision)); this->setWillReadFragmentPosition(); } @@ -440,7 +440,7 @@ private: const Attribute* fInWindings; SkMatrix fLocalMatrix; bool fUsesLocalCoords; - + GR_DECLARE_GEOMETRY_PROCESSOR_TEST; typedef GrGeometryProcessor INHERITED; @@ -497,31 +497,31 @@ public: GrGLSLVertToFrag ep1(kVec2f_GrSLType); varyingHandler->addVarying("endpoint1", &ep1, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", ep1.vsOut(), + vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", ep1.vsOut(), qe.inEndpoint1()->fName, qe.inEndpoint1()->fName); GrGLSLVertToFrag ep2(kVec2f_GrSLType); varyingHandler->addVarying("endpoint2", &ep2, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", ep2.vsOut(), + vsBuilder->codeAppendf("%s = vec2(%s.x, %s.y);", ep2.vsOut(), qe.inEndpoint2()->fName, qe.inEndpoint2()->fName); GrGLSLVertToFrag delta(kVec2f_GrSLType); varyingHandler->addVarying("delta", &delta, kHigh_GrSLPrecision); - vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", - delta.vsOut(), ep1.vsOut(), ep2.vsOut(), ep2.vsOut(), + vsBuilder->codeAppendf("%s = vec2(%s.x - %s.x, %s.y - %s.y) * 0.5;", + delta.vsOut(), ep1.vsOut(), ep2.vsOut(), ep2.vsOut(), ep1.vsOut()); GrGLSLVertToFrag windings(kInt_GrSLType); varyingHandler->addFlatVarying("windings", &windings, kLow_GrSLPrecision); - vsBuilder->codeAppendf("%s = %s;", + vsBuilder->codeAppendf("%s = %s;", windings.vsOut(), qe.inWindings()->fName); // Setup position this->setupPosition(vsBuilder, gpArgs, qe.inPosition()->fName); // emit transforms - this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, - qe.inPosition()->fName, qe.localMatrix(), args.fTransformsIn, + this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, + qe.inPosition()->fName, qe.localMatrix(), args.fTransformsIn, args.fTransformsOut); GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder; @@ -541,7 +541,7 @@ public: "} else {" "return false;" "}"; - fsBuilder->emitFunction(kBool_GrSLType, "in_quad", QUAD_ARGS, inQuadArgs, inQuadCode, + fsBuilder->emitFunction(kBool_GrSLType, "in_quad", QUAD_ARGS, inQuadArgs, inQuadCode, &inQuadName); fsBuilder->declAppendf(GR_GL_PLS_PATH_DATA_DECL); // keep the derivative instructions outside the conditional @@ -549,25 +549,25 @@ public: fsBuilder->codeAppendf("highp vec2 uvdY = dFdy(%s);", uv.fsIn()); fsBuilder->codeAppend("highp vec2 uvIncX = uvdX * 0.45 + uvdY * -0.1;"); fsBuilder->codeAppend("highp vec2 uvIncY = uvdX * 0.1 + uvdY * 0.55;"); - fsBuilder->codeAppendf("highp vec2 uv = %s.xy - uvdX * 0.35 - uvdY * 0.25;", + fsBuilder->codeAppendf("highp vec2 uv = %s.xy - uvdX * 0.35 - uvdY * 0.25;", uv.fsIn()); fsBuilder->codeAppendf("highp vec2 firstSample = %s.xy - vec2(0.25);", fsBuilder->fragmentPosition()); - fsBuilder->codeAppendf("highp float d = dot(%s, (firstSample - %s).yx) * 2.0;", + fsBuilder->codeAppendf("highp float d = dot(%s, (firstSample - %s).yx) * 2.0;", delta.fsIn(), ep1.fsIn()); - fsBuilder->codeAppendf("pls.windings[0] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), + fsBuilder->codeAppendf("pls.windings[0] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), windings.fsIn()); fsBuilder->codeAppend("uv += uvIncX;"); fsBuilder->codeAppendf("d += %s.x;", delta.fsIn()); - fsBuilder->codeAppendf("pls.windings[1] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), + fsBuilder->codeAppendf("pls.windings[1] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), windings.fsIn()); fsBuilder->codeAppend("uv += uvIncY;"); fsBuilder->codeAppendf("d += %s.y;", delta.fsIn()); - fsBuilder->codeAppendf("pls.windings[2] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), + fsBuilder->codeAppendf("pls.windings[2] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), windings.fsIn()); fsBuilder->codeAppend("uv -= uvIncX;"); fsBuilder->codeAppendf("d -= %s.x;", delta.fsIn()); - fsBuilder->codeAppendf("pls.windings[3] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), + fsBuilder->codeAppendf("pls.windings[3] += %s(d, uv) ? %s : 0;", inQuadName.c_str(), windings.fsIn()); } @@ -609,15 +609,15 @@ private: : fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, + fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInUV = &this->addVertexAttrib(Attribute("inUV", kVec2f_GrVertexAttribType, + fInUV = &this->addVertexAttrib(Attribute("inUV", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInEndpoint1 = &this->addVertexAttrib(Attribute("inEndpoint1", kVec2f_GrVertexAttribType, + fInEndpoint1 = &this->addVertexAttrib(Attribute("inEndpoint1", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInEndpoint2 = &this->addVertexAttrib(Attribute("inEndpoint2", kVec2f_GrVertexAttribType, + fInEndpoint2 = &this->addVertexAttrib(Attribute("inEndpoint2", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); - fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, + fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, kLow_GrSLPrecision)); this->setWillReadFragmentPosition(); } @@ -629,7 +629,7 @@ private: const Attribute* fInWindings; SkMatrix fLocalMatrix; bool fUsesLocalCoords; - + GR_DECLARE_GEOMETRY_PROCESSOR_TEST; typedef GrGeometryProcessor INHERITED; @@ -652,13 +652,13 @@ public: bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } const SkMatrix& localMatrix() const { return fLocalMatrix; } bool usesLocalCoords() const { return fUsesLocalCoords; } - - GrPixelLocalStorageState getPixelLocalStorageState() const override { + + GrPixelLocalStorageState getPixelLocalStorageState() const override { return GrPixelLocalStorageState::kFinish_GrPixelLocalStorageState; } const char* getDestColorOverride() const override { - return GR_GL_PLS_DSTCOLOR_NAME; + return GR_GL_PLS_DSTCOLOR_NAME; } class GLSLProcessor : public GrGLSLGeometryProcessor { @@ -672,14 +672,14 @@ public: GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; fUseEvenOdd = uniformHandler->addUniform(kFragment_GrShaderFlag, - kFloat_GrSLType, kLow_GrSLPrecision, + kFloat_GrSLType, kLow_GrSLPrecision, "useEvenOdd"); const char* useEvenOdd = uniformHandler->getUniformCStr(fUseEvenOdd); varyingHandler->emitAttributes(fe); this->setupPosition(vsBuilder, gpArgs, fe.inPosition()->fName); - this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, - fe.inPosition()->fName, fe.localMatrix(), args.fTransformsIn, + this->emitTransforms(vsBuilder, varyingHandler, uniformHandler, gpArgs->fPositionVar, + fe.inPosition()->fName, fe.localMatrix(), args.fTransformsIn, args.fTransformsOut); GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder; @@ -699,7 +699,7 @@ public: fsBuilder->codeAppend("coverage += pls.windings[3] != 0 ? 0.25 : 0.0;"); fsBuilder->codeAppend("}"); if (!fe.colorIgnored()) { - this->setupUniformColor(fsBuilder, uniformHandler, args.fOutputColor, + this->setupUniformColor(fsBuilder, uniformHandler, args.fOutputColor, &fColorUniform); } fsBuilder->codeAppendf("%s = vec4(coverage);", args.fOutputCoverage); @@ -752,14 +752,14 @@ public: } private: - PLSFinishEffect(GrColor color, bool useEvenOdd, const SkMatrix& localMatrix, + PLSFinishEffect(GrColor color, bool useEvenOdd, const SkMatrix& localMatrix, bool usesLocalCoords) : fColor(color) , fUseEvenOdd(useEvenOdd) , fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, + fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision)); } @@ -797,7 +797,7 @@ public: const char* name() const override { return "PLSBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -911,10 +911,10 @@ public: } SkAutoTUnref finishProcessor( - PLSFinishEffect::Create(this->color(), - pathPtr->getFillType() == + PLSFinishEffect::Create(this->color(), + pathPtr->getFillType() == SkPath::FillType::kEvenOdd_FillType, - invert, + invert, this->usesLocalCoords())); const GrBuffer* rectVertexBuffer; size_t finishStride = finishProcessor->getVertexStride(); diff --git a/src/gpu/batches/GrPLSPathRenderer.h b/src/gpu/batches/GrPLSPathRenderer.h index d701f62a91..39f21ba68c 100644 --- a/src/gpu/batches/GrPLSPathRenderer.h +++ b/src/gpu/batches/GrPLSPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -13,26 +12,26 @@ /* * Renders arbitrary antialiased paths using pixel local storage as a scratch buffer. The overall - * technique is very similar to the approach presented in "Resolution independent rendering of + * technique is very similar to the approach presented in "Resolution independent rendering of * deformable vector objects using graphics hardware" by Kokojima et al. * We first render the straight-line portions of the path (essentially pretending as if all segments - * were kLine_Verb) as a triangle fan, using a fragment shader which updates the winding counts - * appropriately. We then render the curved portions of the path using a Loop-Blinn shader which + * were kLine_Verb) as a triangle fan, using a fragment shader which updates the winding counts + * appropriately. We then render the curved portions of the path using a Loop-Blinn shader which * calculates which portion of the triangle is covered by the quad (conics and cubics are split down - * to quads). Where we diverge from Kokojima is that, instead of rendering into the stencil buffer + * to quads). Where we diverge from Kokojima is that, instead of rendering into the stencil buffer * and using built-in MSAA to handle straight-line antialiasing, we use the pixel local storage area - * and calculate the MSAA ourselves in the fragment shader. Essentially, we manually evaluate the + * and calculate the MSAA ourselves in the fragment shader. Essentially, we manually evaluate the * coverage of each pixel four times, storing four winding counts into the pixel local storage area, * and compute the final coverage based on those winding counts. * - * Our approach is complicated by the need to perform antialiasing on straight edges as well, - * without relying on hardware MSAA. We instead bloat the triangles to ensure complete coverage, - * pass the original (un-bloated) vertices in to the fragment shader, and then have the fragment - * shader use these vertices to evaluate whether a given sample is located within the triangle or + * Our approach is complicated by the need to perform antialiasing on straight edges as well, + * without relying on hardware MSAA. We instead bloat the triangles to ensure complete coverage, + * pass the original (un-bloated) vertices in to the fragment shader, and then have the fragment + * shader use these vertices to evaluate whether a given sample is located within the triangle or * not. This gives us MSAA4 edges on triangles which line up nicely with no seams. We similarly face - * problems on the back (flat) edges of quads, where we have to ensure that the back edge is - * antialiased in the same way. Similar to the triangle case, we pass in the two (unbloated) + * problems on the back (flat) edges of quads, where we have to ensure that the back edge is + * antialiased in the same way. Similar to the triangle case, we pass in the two (unbloated) * vertices defining the back edge of the quad and the fragment shader uses these vertex coordinates * to discard samples falling on the other side of the quad's back edge. */ diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index cf431732fd..d50111be47 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -28,7 +27,7 @@ GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resour } GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider* resourceProvider) - : fResourceProvider(resourceProvider) { + : fResourceProvider(resourceProvider) { } bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.h b/src/gpu/batches/GrStencilAndCoverPathRenderer.h index bb8cdb0dd7..8fec6c6342 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.h +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/batches/GrTInstanceBatch.h b/src/gpu/batches/GrTInstanceBatch.h index fdd0662d06..726903edd1 100644 --- a/src/gpu/batches/GrTInstanceBatch.h +++ b/src/gpu/batches/GrTInstanceBatch.h @@ -59,7 +59,7 @@ public: return str; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle @@ -89,7 +89,7 @@ private: GrTInstanceBatch() : INHERITED(ClassID()) {} void onPrepareDraws(Target* target) const override { - SkAutoTUnref gp(Impl::CreateGP(this->seedGeometry(), + SkAutoTUnref gp(Impl::CreateGP(this->seedGeometry(), fOverrides)); if (!gp) { SkDebugf("Couldn't create GrGeometryProcessor\n"); diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 4ba01884dc..8185a85e47 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -23,7 +23,7 @@ /* * This path renderer tessellates the path into triangles using GrTessellator, uploads the triangles - * to a vertex buffer, and renders them with a single draw call. It does not currently do + * to a vertex buffer, and renders them with a single draw call. It does not currently do * antialiasing, so it must be used in conjunction with multisampling. */ namespace { @@ -124,7 +124,7 @@ public: const char* name() const override { return "TessellatingPathBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { color->setKnownFourComponents(fColor); diff --git a/src/gpu/batches/GrTestBatch.h b/src/gpu/batches/GrTestBatch.h index c28f98d716..5da65f81ea 100644 --- a/src/gpu/batches/GrTestBatch.h +++ b/src/gpu/batches/GrTestBatch.h @@ -25,7 +25,7 @@ public: virtual const char* name() const override = 0; - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index ae1a8d361d..075ce16434 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -727,4 +727,3 @@ const GrGeometryProcessor* GrCubicEffect::TestCreate(GrProcessorTestData* d) { } while (nullptr == gp); return gp; } - diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp index 8c98c6c843..c1c9425bb7 100644 --- a/src/gpu/effects/GrCoverageSetOpXP.cpp +++ b/src/gpu/effects/GrCoverageSetOpXP.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -113,7 +112,7 @@ CoverageSetOpXP::onGetOptimizations(const GrPipelineOptimizations& optimizations GrColor* color, const GrCaps& caps) const { // We never look at the color input - return GrXferProcessor::kIgnoreColor_OptFlag; + return GrXferProcessor::kIgnoreColor_OptFlag; } void CoverageSetOpXP::onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const { @@ -168,10 +167,10 @@ public: bool invertCoverage() const { return fInvertCoverage; } private: - GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&, bool, GrColor*, + GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&, bool, GrColor*, const GrCaps&) const override { // We never look at the color input - return GrXferProcessor::kIgnoreColor_OptFlag; + return GrXferProcessor::kIgnoreColor_OptFlag; } void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; @@ -342,4 +341,3 @@ const GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(GrProcessorTestData* d) bool invertCoverage = !d->fRenderTarget->hasMixedSamples() && d->fRandom->nextBool(); return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); } - diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index 344c125f7e..344b93ff85 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -267,7 +267,7 @@ public: const char* name() const override { return "DashBatch"; } - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { // When this is called on a batch, there is only one geometry bundle diff --git a/src/gpu/effects/GrDashingEffect.h b/src/gpu/effects/GrDashingEffect.h index eaa0d0d5b5..d67a63eb4b 100644 --- a/src/gpu/effects/GrDashingEffect.h +++ b/src/gpu/effects/GrDashingEffect.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp index 937bea8c35..7d776e72ea 100644 --- a/src/gpu/effects/GrDisableColorXP.cpp +++ b/src/gpu/effects/GrDisableColorXP.cpp @@ -107,4 +107,3 @@ GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); const GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) { return GrDisableColorXPFactory::Create(); } - diff --git a/src/gpu/effects/GrDisableColorXP.h b/src/gpu/effects/GrDisableColorXP.h index 21e69327f6..3182eef64d 100644 --- a/src/gpu/effects/GrDisableColorXP.h +++ b/src/gpu/effects/GrDisableColorXP.h @@ -47,4 +47,3 @@ private: }; #endif - diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index 2182a11758..7d474a16e1 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -95,7 +95,7 @@ public: vertBuilder->codeAppendf("%s = vec2(%d, %d) * %s;", st.vsOut(), atlas->width(), atlas->height(), dfTexEffect.inTextureCoords()->fName); - + // Use highp to work around aliasing issues fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, kHigh_GrSLPrecision)); @@ -116,7 +116,7 @@ public: fragBuilder->codeAppend("float afwidth;"); if (isUniformScale) { // For uniform scale, we adjust for the effect of the transformation on the distance - // by using the length of the gradient of the t coordinate in the y direction. + // by using the length of the gradient of the t coordinate in the y direction. // We use st coordinates to ensure we're mapping 1:1 from texel space to pixel space. // We use the y gradient because there is a bug in the Mali 400 in the x direction. @@ -356,7 +356,7 @@ public: bool isSimilarity = SkToBool(dfTexEffect.getFlags() & kSimilarity_DistanceFieldEffectFlag); if (isUniformScale) { // For uniform scale, we adjust for the effect of the transformation on the distance - // by using the length of the gradient of the t coordinate in the y direction. + // by using the length of the gradient of the t coordinate in the y direction. // We use st coordinates to ensure we're mapping 1:1 from texel space to pixel space. // We use the y gradient because there is a bug in the Mali 400 in the x direction. @@ -403,7 +403,7 @@ public: SkASSERT(fTextureSizeUni.isValid()); GrTexture* texture = proc.texture(0); - if (texture->width() != fTextureSize.width() || + if (texture->width() != fTextureSize.width() || texture->height() != fTextureSize.height()) { fTextureSize = SkISize::Make(texture->width(), texture->height()); pdman.set2f(fTextureSizeUni, @@ -645,8 +645,8 @@ public: // trade-off between quality and speed. fragBuilder->codeAppend("float afwidth;"); if (isSimilarity) { - // For similarity transform (uniform scale-only is a subset of this), we adjust for the - // effect of the transformation on the distance by using the length of the gradient of + // For similarity transform (uniform scale-only is a subset of this), we adjust for the + // effect of the transformation on the distance by using the length of the gradient of // the texture coordinates. We use st coordinates to ensure we're mapping 1:1 from texel // space to pixel space. diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h index 765a531c94..05fffa58d6 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.h +++ b/src/gpu/effects/GrDistanceFieldGeoProc.h @@ -24,7 +24,7 @@ enum GrDistanceFieldEffectFlags { kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet) kInvalid_DistanceFieldEffectFlag = 0x80, // invalid state (for initialization) - + kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | kScaleOnly_DistanceFieldEffectFlag, // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 1dd96a4aad..21af5351c7 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -76,7 +76,7 @@ void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) { GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); int offset = y*kWidth + x; - fragBuilder->codeAppendf("float k = %s[%d]%s;", kernel, offset / 4, + fragBuilder->codeAppendf("float k = %s[%d]%s;", kernel, offset / 4, kVecSuffix[offset & 0x3]); SkString coord; coord.printf("coord + vec2(%d, %d) * %s", x, y, imgInc); diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp index d1059c7c7b..733e552eea 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -519,7 +519,7 @@ public: SkXfermode::Mode getXfermode() const { return fXfermode; } private: - GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&, bool, GrColor*, + GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&, bool, GrColor*, const GrCaps&) const override { return kNone_OptFlags; } @@ -755,7 +755,7 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps, } blendFormula = get_lcd_blend_formula(optimizations.fCoveragePOI, fXfermode); } else { - blendFormula = get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, + blendFormula = get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, fXfermode); } @@ -804,7 +804,7 @@ bool GrPorterDuffXPFactory::onWillReadDstColor(const GrCaps& caps, if (caps.shaderCaps()->dualSourceBlendingSupport()) { return false; } - + // When we have four channel coverage we always need to read the dst in order to correctly // blend. The one exception is when we are using srcover mode and we know the input color into // the XP. @@ -818,7 +818,7 @@ bool GrPorterDuffXPFactory::onWillReadDstColor(const GrCaps& caps, } // We fallback on the shader XP when the blend formula would use dual source blending but we // don't have support for it. - return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, + return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, fXfermode).hasSecondaryOutput(); } @@ -884,7 +884,7 @@ GrXferProcessor* GrPorterDuffXPFactory::CreateSrcOverXferProcessor( } blendFormula = get_lcd_blend_formula(optimizations.fCoveragePOI, SkXfermode::kSrcOver_Mode); } else { - blendFormula = get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, + blendFormula = get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, SkXfermode::kSrcOver_Mode); } @@ -912,7 +912,7 @@ bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps, !caps.shaderCaps()->dstReadInShaderSupport()) { return false; } - return get_lcd_blend_formula(optimizations.fCoveragePOI, + return get_lcd_blend_formula(optimizations.fCoveragePOI, SkXfermode::kSrcOver_Mode).hasSecondaryOutput(); } // We fallback on the shader XP when the blend formula would use dual source blending but we @@ -920,4 +920,3 @@ bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps, return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, SkXfermode::kSrcOver_Mode).hasSecondaryOutput(); } - diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index 77ce39e7a9..d3850a31c2 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -102,7 +102,7 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder, builder->appendTextureLookupAndModulate(inModulateColor, sampler, inCoords.c_str()); builder->codeAppend(";"); - + builder->codeAppend(GrGLSLShaderVar::PrecisionString(glslCaps, kHigh_GrSLPrecision)); builder->codeAppendf("float x = (%s).x;", inCoords.c_str()); diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h index 891ce10b38..e88f5d5fd0 100644 --- a/src/gpu/effects/GrTextureDomain.h +++ b/src/gpu/effects/GrTextureDomain.h @@ -179,7 +179,7 @@ public: SkString dumpInfo() const override { SkString str; - str.appendf("Domain: [L: %.2f, T: %.2f, R: %.2f, B: %.2f] ", + str.appendf("Domain: [L: %.2f, T: %.2f, R: %.2f, B: %.2f] ", fTextureDomain.domain().fLeft, fTextureDomain.domain().fTop, fTextureDomain.domain().fRight, fTextureDomain.domain().fBottom); str.append(INHERITED::dumpInfo()); diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index d1b2fb63fb..91aa045458 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/GrGLAssembleInterface.h b/src/gpu/gl/GrGLAssembleInterface.h index 2a4835be38..3882f71ee2 100644 --- a/src/gpu/gl/GrGLAssembleInterface.h +++ b/src/gpu/gl/GrGLAssembleInterface.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 18e68e9dd8..7319164913 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -117,7 +117,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, fSampleLocationsSupport = version >= GR_GL_VER(3,1); } - // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED + // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED // and GL_RG on FBO textures. if (kMesa_GrGLDriver != ctxInfo.driver()) { if (kGL_GrGLStandard == standard) { @@ -245,7 +245,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, // We're assuming that on Windows Chromium we're using ANGLE. bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() || kChromium_GrGLDriver == ctxInfo.driver(); - // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA). + // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA). fRGBA8888PixelsOpsAreSlow = isANGLE; // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is still true and // check DX11 ANGLE. @@ -300,7 +300,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, if (ctxInfo.hasExtension("GL_EXT_shader_pixel_local_storage")) { #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 - GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, + GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, &glslCaps->fPixelLocalStorageSize); glslCaps->fPLSPathRenderingSupport = glslCaps->fFBFetchSupport; } @@ -388,7 +388,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, if (kGL_GrGLStandard == standard) { if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_pixel_buffer_object")) { fTransferBufferType = kPBO_TransferBufferType; - } + } } else { if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_NV_pixel_buffer_object")) { fTransferBufferType = kPBO_TransferBufferType; @@ -1092,7 +1092,7 @@ SkString GrGLCaps::dump() const { r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSupport ? "YES" : "NO")); r.appendf("Rectangle texture support: %s\n", (fRectangleTextureSupport? "YES" : "NO")); r.appendf("Texture swizzle support: %s\n", (fTextureSwizzleSupport ? "YES" : "NO")); - r.appendf("BGRA to RGBA readback conversions are slow: %s\n", + r.appendf("BGRA to RGBA readback conversions are slow: %s\n", (fRGBAToBGRAReadbackConversionsAreSlow ? "YES" : "NO")); r.append("Configs\n-------\n"); @@ -1141,7 +1141,7 @@ static GrGLenum shader_type_to_gl_shader(GrShaderType type) { } void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, - const GrGLInterface* intf, + const GrGLInterface* intf, GrGLSLCaps* glslCaps) { if (kGLES_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(4, 1) || ctxInfo.hasExtension("GL_ARB_ES2_compatibility")) { @@ -1165,7 +1165,7 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, first = &glslCaps->fFloatPrecisions[s][p]; } else if (!glslCaps->fShaderPrecisionVaries) { - glslCaps->fShaderPrecisionVaries = + glslCaps->fShaderPrecisionVaries = (*first != glslCaps->fFloatPrecisions[s][p]); } } @@ -1192,7 +1192,7 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, // are recommended against. if (glslCaps->fGeometryShaderSupport) { for (int p = 0; p < kGrSLPrecisionCount; ++p) { - glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = + glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = glslCaps->fFloatPrecisions[kVertex_GrShaderType][p]; } } @@ -1833,7 +1833,7 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa // This extension GL_BGRA as an unsized internal format. However, it is written against ES // 2.0 and therefore doesn't define a value for GL_BGRA8 as ES 2.0 uses unsized internal // formats. - // GL_APPLE_texture_format_BGRA8888: + // GL_APPLE_texture_format_BGRA8888: // ES 2.0: the extension makes BGRA an external format but not an internal format. // ES 3.0: the extension explicitly states GL_BGRA8 is not a valid internal format for // glTexImage (just for glTexStorage). diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index e9a29693de..e2bc100cae 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -428,7 +428,7 @@ private: /** The external format and type are to be used when uploading/downloading data using this config where both the CPU data and GrSurface are the same config. To get the external format and type when converting between configs while copying to/from memory use - getExternalFormat(). + getExternalFormat(). The kTexImage external format is usually the same as kOther except for kSRGBA on some GL contexts. */ GrGLenum fExternalFormat[kExternalFormatUsageCnt]; diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index 1768a26c69..b9a29fb742 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -13,7 +13,7 @@ // added to suppress 'no previous prototype' warning and because this code is duplicated in // SkNullGLContext.cpp -namespace { +namespace { class BufferObj { public: diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index e09b1f4623..2fe22bd0a3 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -116,7 +116,7 @@ #define GR_GL_PIXEL_PACK_BUFFER 0x88EB #define GR_GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GR_GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM 0x78EC +#define GR_GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM 0x78EC #define GR_GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM 0x78ED #define GR_GL_STREAM_DRAW 0x88E0 @@ -168,7 +168,7 @@ #define GR_GL_FRAMEBUFFER_SRGB 0x8DB9 #define GR_GL_SHADER_PIXEL_LOCAL_STORAGE 0x8F64 #define GR_GL_SAMPLE_SHADING 0x8C36 - + /* ErrorCode */ #define GR_GL_NO_ERROR 0 #define GR_GL_INVALID_ENUM 0x0500 diff --git a/src/gpu/gl/GrGLGLSL.cpp b/src/gpu/gl/GrGLGLSL.cpp index 60f0c276f7..e5aed03557 100755 --- a/src/gpu/gl/GrGLGLSL.cpp +++ b/src/gpu/gl/GrGLGLSL.cpp @@ -50,4 +50,3 @@ bool GrGLGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation return false; } } - diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 6accc59f9d..d3c4ec363e 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -297,7 +297,7 @@ void GrGLGpu::createPLSSetupProgram() { GrGLSLShaderVar uPosXform("u_posXform", kVec4f_GrSLType, GrShaderVar::kUniform_TypeModifier); GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUniform_TypeModifier); GrGLSLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier); - + SkString vshaderTxt(version); if (glslCaps->noperspectiveInterpolationSupport()) { if (const char* extension = glslCaps->noperspectiveInterpolationExtensionString()) { @@ -313,7 +313,7 @@ void GrGLGpu::createPLSSetupProgram() { vshaderTxt.append(";"); vTexCoord.appendDecl(glslCaps, &vshaderTxt); vshaderTxt.append(";"); - + vshaderTxt.append( "// PLS Setup Program VS\n" "void main() {" @@ -2621,8 +2621,8 @@ bool GrGLGpu::onReadPixels(GrSurface* surface, void GrGLGpu::finishDrawTarget() { if (fPLSHasBeenUsed) { - /* There is an ARM driver bug where if we use PLS, and then draw a frame which does not - * use PLS, it leaves garbage all over the place. As a workaround, we use PLS in a + /* There is an ARM driver bug where if we use PLS, and then draw a frame which does not + * use PLS, it leaves garbage all over the place. As a workaround, we use PLS in a * trivial way every frame. And since we use it every frame, there's never a point at which * it becomes safe to stop using this workaround once we start. */ @@ -2632,9 +2632,9 @@ void GrGLGpu::finishDrawTarget() { SkASSERT(!fHWPLSEnabled); SkASSERT(fMSAAEnabled != kYes_TriState); GL_CALL(Enable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); - this->stampRectUsingProgram(fPLSSetupProgram.fProgram, - SkRect::MakeXYWH(-100.0f, -100.0f, 0.01f, 0.01f), - fPLSSetupProgram.fPosXformUniform, + this->stampRectUsingProgram(fPLSSetupProgram.fProgram, + SkRect::MakeXYWH(-100.0f, -100.0f, 0.01f, 0.01f), + fPLSSetupProgram.fPosXformUniform, fPLSSetupProgram.fArrayBuffer); GL_CALL(Disable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); } @@ -2803,7 +2803,7 @@ void GrGLGpu::onDraw(const GrPipeline& pipeline, #endif } -void GrGLGpu::stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint posXformUniform, +void GrGLGpu::stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint posXformUniform, GrGLuint arrayBuffer) { GL_CALL(UseProgram(program)); this->fHWGeometryState.setVertexArrayID(this, 0); @@ -2813,7 +2813,7 @@ void GrGLGpu::stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGL attribs->set(this, 0, arrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat), 0); attribs->disableUnusedArrays(this, 0x1); - GL_CALL(Uniform4f(posXformUniform, bounds.width(), bounds.height(), bounds.left(), + GL_CALL(Uniform4f(posXformUniform, bounds.width(), bounds.height(), bounds.left(), bounds.top())); GrXferProcessor::BlendInfo blendInfo; @@ -2834,7 +2834,7 @@ void GrGLGpu::stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGL void GrGLGpu::setupPixelLocalStorage(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc) { fPLSHasBeenUsed = true; - const SkRect& bounds = + const SkRect& bounds = static_cast(primProc).getBounds(); // setup pixel local storage -- this means capturing and storing the current framebuffer color // and initializing the winding counts to zero @@ -2849,9 +2849,9 @@ void GrGLGpu::setupPixelLocalStorage(const GrPipeline& pipeline, GrGLfloat dy0 = -2.0f * (bounds.top() - 1) / height + 1.0f; GrGLfloat dy1 = -2.0f * (bounds.bottom() + 1) / height + 1.0f; SkRect deviceBounds = SkRect::MakeXYWH(dx0, dy0, dx1 - dx0, dy1 - dy0); - + GL_CALL(Enable(GR_GL_FETCH_PER_SAMPLE_ARM)); - this->stampRectUsingProgram(fPLSSetupProgram.fProgram, deviceBounds, + this->stampRectUsingProgram(fPLSSetupProgram.fProgram, deviceBounds, fPLSSetupProgram.fPosXformUniform, fPLSSetupProgram.fArrayBuffer); } diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 09f0ae4379..4a70fb7acd 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -245,7 +245,7 @@ private: const SkIRect& srcRect, const SkIPoint& dstPoint); - void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint posXformUniform, + void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint posXformUniform, GrGLuint arrayBuffer); void setupPixelLocalStorage(const GrPipeline&, const GrPrimitiveProcessor&); @@ -503,7 +503,7 @@ private: const GrGLBuffer* vbuffer, const GrGLBuffer* ibuffer); - /** Variants of the above that takes GL buffer IDs. Note that 0 does not imply that a + /** Variants of the above that takes GL buffer IDs. Note that 0 does not imply that a buffer won't be bound. The "default buffer" will be bound, which is used for client-side array rendering. */ GrGLAttribArrayState* bindArrayAndBufferToDraw(GrGLGpu* gpu, GrGLuint vbufferID); diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp index dc449f8159..f6e0eaa940 100644 --- a/src/gpu/gl/GrGLGpuProgramCache.cpp +++ b/src/gpu/gl/GrGLGpuProgramCache.cpp @@ -23,7 +23,7 @@ SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; struct GrGLGpu::ProgramCache::Entry { - + Entry() : fProgram(nullptr), fLRUStamp(0) {} SkAutoTUnref fProgram; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 7f741f90ce..9cd7e68647 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -570,14 +570,14 @@ bool GrGLInterface::validate() const { nullptr == fFunctions.fDrawElementsInstanced) { RETURN_FALSE_INTERFACE } - } + } } else if (kGLES_GrGLStandard == fStandard) { if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_draw_instanced")) { if (nullptr == fFunctions.fDrawArraysInstanced || nullptr == fFunctions.fDrawElementsInstanced) { RETURN_FALSE_INTERFACE } - } + } } if (kGL_GrGLStandard == fStandard) { @@ -585,13 +585,13 @@ bool GrGLInterface::validate() const { if (nullptr == fFunctions.fVertexAttribDivisor) { RETURN_FALSE_INTERFACE } - } + } } else if (kGLES_GrGLStandard == fStandard) { if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_instanced_arrays")) { if (nullptr == fFunctions.fVertexAttribDivisor) { RETURN_FALSE_INTERFACE } - } + } } if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp index c15a1a2d62..46006558b9 100644 --- a/src/gpu/gl/GrGLPath.cpp +++ b/src/gpu/gl/GrGLPath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/GrGLPath.h b/src/gpu/gl/GrGLPath.h index e8642f3468..1ef1346133 100644 --- a/src/gpu/gl/GrGLPath.h +++ b/src/gpu/gl/GrGLPath.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp index 4714b924ab..cc660ed2bb 100644 --- a/src/gpu/gl/GrGLPathRange.cpp +++ b/src/gpu/gl/GrGLPathRange.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/GrGLPathRange.h b/src/gpu/gl/GrGLPathRange.h index c9d4845c44..ed9766d958 100644 --- a/src/gpu/gl/GrGLPathRange.h +++ b/src/gpu/gl/GrGLPathRange.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 8ef188bf2b..aa828a24c4 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -89,7 +89,7 @@ void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, this->setFragmentData(primProc, pipeline, textureBindings); - if (primProc.getPixelLocalStorageState() != + if (primProc.getPixelLocalStorageState() != GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { const GrXferProcessor& xp = pipeline.getXferProcessor(); fXferProcessor->setData(fProgramDataManager, xp); diff --git a/src/gpu/gl/GrGLTestInterface.h b/src/gpu/gl/GrGLTestInterface.h index 6af71feee2..c5f91ee195 100644 --- a/src/gpu/gl/GrGLTestInterface.h +++ b/src/gpu/gl/GrGLTestInterface.h @@ -113,7 +113,7 @@ public: virtual GrGLvoid* mapBufferRange(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length, GrGLbitfield access) { return nullptr; } virtual GrGLvoid* mapBufferSubData(GrGLuint target, GrGLintptr offset, GrGLsizeiptr size, GrGLenum access) { return nullptr; } virtual GrGLvoid* mapTexSubImage2D(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access) { return nullptr; } - virtual GrGLvoid minSampleShading(GrGLfloat value) {} + virtual GrGLvoid minSampleShading(GrGLfloat value) {} virtual GrGLvoid pixelStorei(GrGLenum pname, GrGLint param) {} virtual GrGLvoid popGroupMarker() {} virtual GrGLvoid pushGroupMarker(GrGLsizei length, const char* marker) {} diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp index 7f6f106964..94da1f1776 100644 --- a/src/gpu/gl/GrGLUniformHandler.cpp +++ b/src/gpu/gl/GrGLUniformHandler.cpp @@ -86,5 +86,3 @@ const GrGLGpu* GrGLUniformHandler::glGpu() const { GrGLProgramBuilder* glPB = (GrGLProgramBuilder*) fProgramBuilder; return glPB->gpu(); } - - diff --git a/src/gpu/gl/GrGLUniformHandler.h b/src/gpu/gl/GrGLUniformHandler.h index 9ef5c579ee..1dac8d959e 100644 --- a/src/gpu/gl/GrGLUniformHandler.h +++ b/src/gpu/gl/GrGLUniformHandler.h @@ -55,7 +55,7 @@ private: friend class GrGLProgramBuilder; - typedef GrGLSLUniformHandler INHERITED; + typedef GrGLSLUniformHandler INHERITED; }; #endif diff --git a/src/gpu/gl/GrGLVaryingHandler.h b/src/gpu/gl/GrGLVaryingHandler.h index c4e5ba457e..e08a6c6151 100644 --- a/src/gpu/gl/GrGLVaryingHandler.h +++ b/src/gpu/gl/GrGLVaryingHandler.h @@ -30,8 +30,7 @@ private: friend class GrGLProgramBuilder; - typedef GrGLSLVaryingHandler INHERITED; + typedef GrGLSLVaryingHandler INHERITED; }; #endif - diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp index d49846db55..564a91a1b6 100644 --- a/src/gpu/gl/GrGLVertexArray.cpp +++ b/src/gpu/gl/GrGLVertexArray.cpp @@ -117,7 +117,7 @@ GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) { GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint ibufferID) { GrGLAttribArrayState* state = this->bind(gpu); if (state) { - if (!fIndexBufferIDIsValid || ibufferID != fIndexBufferID) { + if (!fIndexBufferIDIsValid || ibufferID != fIndexBufferID) { GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, ibufferID)); fIndexBufferIDIsValid = true; fIndexBufferID = ibufferID; diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp index ebe5032827..1f9011fbd9 100644 --- a/src/gpu/gl/SkGLContext.cpp +++ b/src/gpu/gl/SkGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * @@ -177,7 +176,7 @@ GrGLint SkGLContext::createTextureRectangle(int width, int height, GrGLenum inte GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_MIN_FILTER, GR_GL_NEAREST)); GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_S, - GR_GL_CLAMP_TO_EDGE)); + GR_GL_CLAMP_TO_EDGE)); GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_T, GR_GL_CLAMP_TO_EDGE)); GR_GL_CALL(fGL, TexImage2D(GR_GL_TEXTURE_RECTANGLE, 0, internalFormat, width, height, 0, diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp index 95b0e5ef47..a2c5066273 100644 --- a/src/gpu/gl/SkNullGLContext.cpp +++ b/src/gpu/gl/SkNullGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp index 58a98090d5..f5949175f7 100644 --- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp +++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp index d7ba2cd82a..48f9d8c8ff 100644 --- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp +++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp index a6b4e8670c..c6ea44381f 100644 --- a/src/gpu/gl/angle/SkANGLEGLContext.cpp +++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp index 30df7a79af..fe617fbaee 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp @@ -239,4 +239,3 @@ GrGLProgram* GrGLProgramBuilder::createProgram(GrGLuint programID) { fFragmentProcessors, &fSamplerUniforms); } - diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h index f2714f378a..481d63b215 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.h +++ b/src/gpu/gl/builders/GrGLProgramBuilder.h @@ -47,7 +47,7 @@ private: bool compileAndAttachShaders(GrGLSLShaderBuilder& shader, GrGLuint programId, GrGLenum type, - SkTDArray* shaderIds); + SkTDArray* shaderIds); GrGLProgram* finalize(); void bindProgramResourceLocations(GrGLuint programID); bool checkLinkStatus(GrGLuint programID); @@ -67,6 +67,6 @@ private: GrGLVaryingHandler fVaryingHandler; GrGLUniformHandler fUniformHandler; - typedef GrGLSLProgramBuilder INHERITED; + typedef GrGLSLProgramBuilder INHERITED; }; #endif diff --git a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp index b14debda57..516c155fcc 100644 --- a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp +++ b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/gpu/gl/debug/GrBufferObj.cpp b/src/gpu/gl/debug/GrBufferObj.cpp index 37d4438ef6..ee0993d6da 100644 --- a/src/gpu/gl/debug/GrBufferObj.cpp +++ b/src/gpu/gl/debug/GrBufferObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrBufferObj.h b/src/gpu/gl/debug/GrBufferObj.h index 65b1caf820..5b5015be96 100644 --- a/src/gpu/gl/debug/GrBufferObj.h +++ b/src/gpu/gl/debug/GrBufferObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrFBBindableObj.h b/src/gpu/gl/debug/GrFBBindableObj.h index e2b43a6a1b..2d490ef08b 100644 --- a/src/gpu/gl/debug/GrFBBindableObj.h +++ b/src/gpu/gl/debug/GrFBBindableObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrFrameBufferObj.cpp b/src/gpu/gl/debug/GrFrameBufferObj.cpp index 7dc12acafb..a8acc3de23 100644 --- a/src/gpu/gl/debug/GrFrameBufferObj.cpp +++ b/src/gpu/gl/debug/GrFrameBufferObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrFrameBufferObj.h b/src/gpu/gl/debug/GrFrameBufferObj.h index 42a0effe07..40e123e49f 100644 --- a/src/gpu/gl/debug/GrFrameBufferObj.h +++ b/src/gpu/gl/debug/GrFrameBufferObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 43fc8dfad9..02b5cf704d 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrProgramObj.cpp b/src/gpu/gl/debug/GrProgramObj.cpp index d6cc36bd74..d45bd1c113 100644 --- a/src/gpu/gl/debug/GrProgramObj.cpp +++ b/src/gpu/gl/debug/GrProgramObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrProgramObj.h b/src/gpu/gl/debug/GrProgramObj.h index a25341a215..6e5ec65d9d 100644 --- a/src/gpu/gl/debug/GrProgramObj.h +++ b/src/gpu/gl/debug/GrProgramObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrRenderBufferObj.h b/src/gpu/gl/debug/GrRenderBufferObj.h index 8231ef58df..dae08f5c78 100644 --- a/src/gpu/gl/debug/GrRenderBufferObj.h +++ b/src/gpu/gl/debug/GrRenderBufferObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrShaderObj.cpp b/src/gpu/gl/debug/GrShaderObj.cpp index 8d3caa1e3f..67cca3ed72 100644 --- a/src/gpu/gl/debug/GrShaderObj.cpp +++ b/src/gpu/gl/debug/GrShaderObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrShaderObj.h b/src/gpu/gl/debug/GrShaderObj.h index 977920fe0f..871494ac8d 100644 --- a/src/gpu/gl/debug/GrShaderObj.h +++ b/src/gpu/gl/debug/GrShaderObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrTextureObj.cpp b/src/gpu/gl/debug/GrTextureObj.cpp index 86063fbc99..62cb399245 100644 --- a/src/gpu/gl/debug/GrTextureObj.cpp +++ b/src/gpu/gl/debug/GrTextureObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrTextureObj.h b/src/gpu/gl/debug/GrTextureObj.h index fcf851db86..bc649f3b38 100644 --- a/src/gpu/gl/debug/GrTextureObj.h +++ b/src/gpu/gl/debug/GrTextureObj.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/GrTextureUnitObj.cpp b/src/gpu/gl/debug/GrTextureUnitObj.cpp index 316dcecd93..8de0b092cd 100644 --- a/src/gpu/gl/debug/GrTextureUnitObj.cpp +++ b/src/gpu/gl/debug/GrTextureUnitObj.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/SkDebugGLContext.cpp b/src/gpu/gl/debug/SkDebugGLContext.cpp index 531e6c3ab8..ecb27db95d 100644 --- a/src/gpu/gl/debug/SkDebugGLContext.cpp +++ b/src/gpu/gl/debug/SkDebugGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/debug/SkDebugGLContext.h b/src/gpu/gl/debug/SkDebugGLContext.h index 113a254e0b..1ea7b62931 100644 --- a/src/gpu/gl/debug/SkDebugGLContext.h +++ b/src/gpu/gl/debug/SkDebugGLContext.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * diff --git a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp index fef4f0276f..4f427820b1 100644 --- a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp +++ b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp index 86e2ebc4cd..1644254c09 100644 --- a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp +++ b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -332,4 +331,3 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s } return ctx; } - diff --git a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp index b91262f4ef..d0bd1de428 100644 --- a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp +++ b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp index c85f05c07e..c7eb46b736 100644 --- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp +++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -39,7 +38,7 @@ public: GrGLFuncPtr getProc(const char name[]) const { return (GrGLFuncPtr) dlsym(fLoader.handle(), name); } - + private: GLLoader fLoader; }; diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp index 83e559339a..c843d0e8ca 100644 --- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp index c6eb34b8df..0ca62ad1cc 100644 --- a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp +++ b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp index 734c1fea0c..6a04d4f387 100644 --- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp +++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp index 8b3666c497..eeccbd64ae 100644 --- a/src/gpu/gl/mesa/SkMesaGLContext.cpp +++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/mesa/SkMesaGLContext.h b/src/gpu/gl/mesa/SkMesaGLContext.h index a9c77a81da..7f700b6536 100644 --- a/src/gpu/gl/mesa/SkMesaGLContext.h +++ b/src/gpu/gl/mesa/SkMesaGLContext.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/mesa/osmesa_wrapper.h b/src/gpu/gl/mesa/osmesa_wrapper.h index 70de99376d..4bb70a4739 100644 --- a/src/gpu/gl/mesa/osmesa_wrapper.h +++ b/src/gpu/gl/mesa/osmesa_wrapper.h @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp index e064aec726..855f0dc124 100644 --- a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp +++ b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -11,5 +10,3 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s SkASSERT(!shareContext); return nullptr; } - - diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index b3766d9a82..1eae5d7502 100644 --- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp index da13ee739e..e99aa15eb7 100644 --- a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp +++ b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -199,4 +198,3 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s } return ctx; } - diff --git a/src/gpu/glsl/GrGLSLBlend.cpp b/src/gpu/glsl/GrGLSLBlend.cpp index 6937977a94..d2c364035b 100644 --- a/src/gpu/glsl/GrGLSLBlend.cpp +++ b/src/gpu/glsl/GrGLSLBlend.cpp @@ -479,4 +479,3 @@ void GrGLSLBlend::AppendRegionOp(GrGLSLFragmentBuilder* fsBuilder, const char* s } fsBuilder->codeAppend(";"); } - diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp index f14274143b..c2404c6e52 100755 --- a/src/gpu/glsl/GrGLSLCaps.cpp +++ b/src/gpu/glsl/GrGLSLCaps.cpp @@ -94,4 +94,3 @@ SkString GrGLSLCaps::dump() const { void GrGLSLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { } - diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h index f54c61d933..7b0868ea92 100755 --- a/src/gpu/glsl/GrGLSLCaps.h +++ b/src/gpu/glsl/GrGLSLCaps.h @@ -15,7 +15,7 @@ class GrGLSLCaps : public GrShaderCaps { public: - + /** * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires @@ -77,7 +77,7 @@ public: bool mustEnableSpecificAdvBlendEqs() const { return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction; } - + bool mustDeclareFragmentShaderOutput() const { return fGLSLGeneration > k110_GrGLSLGeneration; } @@ -173,7 +173,7 @@ private: void onApplyOptionsOverrides(const GrContextOptions& options) override; GrGLSLGeneration fGLSLGeneration; - + bool fDropsTileOnZeroDivide : 1; bool fFBFetchSupport : 1; bool fFBFetchNeedsCustomOutput : 1; diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp index 166e474434..a52b1a6386 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp @@ -176,7 +176,7 @@ const char* GrGLSLFragmentShaderBuilder::fragmentPosition() { // The Adreno compiler seems to be very touchy about access to "gl_FragCoord". // Accessing glFragCoord.zw can cause a program to fail to link. Additionally, // depending on the surrounding code, accessing .xy with a uniform involved can - // do the same thing. Copying gl_FragCoord.xy into a temp vec2 beforehand + // do the same thing. Copying gl_FragCoord.xy into a temp vec2 beforehand // (and only accessing .xy) seems to "fix" things. const char* precision = glslCaps->usesPrecisionModifiers() ? "highp " : ""; this->codePrependf("\t%svec4 %s = vec4(%s.x, %s - %s.y, 1.0, 1.0);\n", @@ -264,7 +264,7 @@ const char* GrGLSLFragmentShaderBuilder::dstColor() { return fbFetchColorName; } else { return kDstTextureColorName; - } + } } void GrGLSLFragmentShaderBuilder::enableAdvancedBlendEquationIfNeeded(GrBlendEquation equation) { @@ -322,7 +322,7 @@ void GrGLSLFragmentBuilder::declAppendf(const char* fmt, ...) { va_list argp; va_start(argp, fmt); inputs().appendVAList(fmt, argp); - va_end(argp); + va_end(argp); } const char* GrGLSLFragmentShaderBuilder::getSecondaryColorOutputName() const { @@ -392,4 +392,3 @@ void GrGLSLFragmentShaderBuilder::onAfterChildProcEmitCode() { int removeAt = fMangleString.findLastOf('_'); fMangleString.remove(removeAt, fMangleString.size() - removeAt); } - diff --git a/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp b/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp index 25e9f9e320..eddd69f7cd 100644 --- a/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp @@ -17,4 +17,3 @@ GrGLSLGeometryBuilder::GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program) void GrGLSLGeometryBuilder::onFinalize() { fProgramBuilder->varyingHandler()->getGeomDecls(&this->inputs(), &this->outputs()); } - diff --git a/src/gpu/glsl/GrGLSLPLSPathRendering.h b/src/gpu/glsl/GrGLSLPLSPathRendering.h index 9a1625d43e..60889e98d2 100644 --- a/src/gpu/glsl/GrGLSLPLSPathRendering.h +++ b/src/gpu/glsl/GrGLSLPLSPathRendering.h @@ -10,4 +10,3 @@ " layout(rgba8i) ivec4 windings;\n"\ " layout(rgba8) vec4 dstColor;\n"\ "} pls;\n" - diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp index 83b50ad534..512d9d14d9 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp +++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp @@ -69,9 +69,9 @@ bool GrGLSLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentProcessors(), inputColor); this->emitAndInstallFragProcs(this->pipeline().numColorFragmentProcessors(), numProcs, inputCoverage); - if (primProc.getPixelLocalStorageState() != + if (primProc.getPixelLocalStorageState() != GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { - this->emitAndInstallXferProc(this->pipeline().getXferProcessor(), *inputColor, + this->emitAndInstallXferProc(this->pipeline().getXferProcessor(), *inputColor, *inputCoverage, this->pipeline().ignoresCoverage(), primProc.getPixelLocalStorageState()); this->emitFSOutputSwizzle(this->pipeline().getXferProcessor().hasSecondaryOutput()); diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h index 67d1eb653b..952db7e09b 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.h +++ b/src/gpu/glsl/GrGLSLProgramBuilder.h @@ -53,7 +53,7 @@ public: // Used to add a uniform in the vertex shader for transforming into normalized device space. void addRTAdjustmentUniform(GrSLPrecision precision, const char* name, const char** outName); const char* rtAdjustment() const { return "rtAdjustment"; } - + // Used to add a uniform for the RenderTarget height (used for frag position) without mangling // the name of the uniform inside of a stage. void addRTHeightUniform(const char* name, const char** outName); diff --git a/src/gpu/glsl/GrGLSLProgramDataManager.cpp b/src/gpu/glsl/GrGLSLProgramDataManager.cpp index 8d3d3cea80..0c98e08edd 100644 --- a/src/gpu/glsl/GrGLSLProgramDataManager.cpp +++ b/src/gpu/glsl/GrGLSLProgramDataManager.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * @@ -24,4 +23,3 @@ void GrGLSLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matr }; this->setMatrix3f(u, mt); } - diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp index 30bf86d210..93b9f8a57a 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp @@ -174,4 +174,3 @@ void GrGLSLShaderBuilder::finalize(uint32_t visibility) { fFinalized = true; } - diff --git a/src/gpu/glsl/GrGLSLUniformHandler.h b/src/gpu/glsl/GrGLSLUniformHandler.h index 14835fbd26..a2f70532ad 100644 --- a/src/gpu/glsl/GrGLSLUniformHandler.h +++ b/src/gpu/glsl/GrGLSLUniformHandler.h @@ -70,4 +70,3 @@ private: }; #endif - diff --git a/src/gpu/glsl/GrGLSLVarying.cpp b/src/gpu/glsl/GrGLSLVarying.cpp index d124e77b67..f3b0405ff5 100644 --- a/src/gpu/glsl/GrGLSLVarying.cpp +++ b/src/gpu/glsl/GrGLSLVarying.cpp @@ -157,4 +157,3 @@ void GrGLSLVaryingHandler::getFragDecls(SkString* inputDecls, SkString* outputDe this->appendDecls(fFragInputs, inputDecls); this->appendDecls(fFragOutputs, outputDecls); } - diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp index 005b2725ff..4931e0f256 100644 --- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp @@ -53,4 +53,3 @@ void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& po void GrGLSLVertexBuilder::onFinalize() { fProgramBuilder->varyingHandler()->getVertexDecls(&this->inputs(), &this->outputs()); } - diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.h b/src/gpu/glsl/GrGLSLVertexShaderBuilder.h index 7c624cee65..af8d10c2cb 100644 --- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.h @@ -23,7 +23,7 @@ public: void transformToNormalizedDeviceSpace(const GrShaderVar& posVar); private: void onFinalize() override; - + const char* fRtAdjustName; friend class GrGLProgramBuilder; diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp index 1a77810306..ec9e40cbae 100644 --- a/src/gpu/text/GrAtlasTextContext.cpp +++ b/src/gpu/text/GrAtlasTextContext.cpp @@ -397,7 +397,7 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) { int yInt = (random->nextU() % kMaxTrans) * yPos; SkScalar x = SkIntToScalar(xInt); SkScalar y = SkIntToScalar(yInt); - + // right now we don't handle textblobs, nor do we handle drawPosText. Since we only // intend to test the batch with this unit test, that is okay. SkAutoTUnref blob( diff --git a/src/gpu/text/GrFontScaler.cpp b/src/gpu/text/GrFontScaler.cpp index c8412027c0..0fb768e1db 100644 --- a/src/gpu/text/GrFontScaler.cpp +++ b/src/gpu/text/GrFontScaler.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/gpu/text/GrFontScaler.h b/src/gpu/text/GrFontScaler.h index e42c7a1da0..f6b67706e3 100644 --- a/src/gpu/text/GrFontScaler.h +++ b/src/gpu/text/GrFontScaler.h @@ -17,37 +17,37 @@ class SkGlyph; class SkPath; /* - * Wrapper class to turn a font cache descriptor into a key + * Wrapper class to turn a font cache descriptor into a key * for GrFontScaler-related lookups */ class GrFontDescKey : public SkRefCnt { public: explicit GrFontDescKey(const SkDescriptor& desc) : fDesc(desc), fHash(desc.getChecksum()) {} - + uint32_t getHash() const { return fHash; } bool operator==(const GrFontDescKey& rh) const { return fHash == rh.fHash && fDesc.getDesc()->equals(*rh.fDesc.getDesc()); } - + private: SkAutoDescriptor fDesc; uint32_t fHash; - + typedef SkRefCnt INHERITED; }; /* * This is Gr's interface to the host platform's font scaler. * - * The client is responsible for instantiating this. The instance is created + * The client is responsible for instantiating this. The instance is created * for a specific font+size+matrix. */ class GrFontScaler : public SkRefCnt { public: explicit GrFontScaler(SkGlyphCache* strike); virtual ~GrFontScaler(); - + const GrFontDescKey* getKey(); GrMaskFormat getMaskFormat() const; GrMaskFormat getPackedGlyphMaskFormat(const SkGlyph&) const; @@ -58,11 +58,11 @@ public: bool getPackedGlyphDFImage(const SkGlyph&, int width, int height, void* image); const SkPath* getGlyphPath(const SkGlyph&); const SkGlyph& grToSkGlyph(GrGlyph::PackedID); - + private: SkGlyphCache* fStrike; GrFontDescKey* fKey; - + typedef SkRefCnt INHERITED; }; diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp index 6aae6a21f8..1ca56e8647 100644 --- a/src/gpu/vk/GrVkBackendContext.cpp +++ b/src/gpu/vk/GrVkBackendContext.cpp @@ -167,7 +167,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { // query to get the physical device properties VkPhysicalDeviceFeatures deviceFeatures; vkGetPhysicalDeviceFeatures(physDev, &deviceFeatures); - // this looks like it would slow things down, + // this looks like it would slow things down, // and we can't depend on it on all platforms deviceFeatures.robustBufferAccess = VK_FALSE; @@ -225,7 +225,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { ctx->fExtensions = extensionFlags; ctx->fFeatures = featureFlags; ctx->fInterface.reset(GrVkCreateInterface(inst, device, extensionFlags)); - + return ctx; } diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp index 24a593a9a7..679132873b 100644 --- a/src/gpu/vk/GrVkBuffer.cpp +++ b/src/gpu/vk/GrVkBuffer.cpp @@ -195,4 +195,3 @@ void GrVkBuffer::validate() const { || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType || kUniform_Type == fDesc.fType); } - diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index 41bf1ad9e4..8f46408706 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -280,4 +280,3 @@ void GrVkCaps::initStencilFormats(const GrVkInterface* interface, VkPhysicalDevi SET_CONFIG_CAN_STENCIL(gS8); SET_CONFIG_CAN_STENCIL(gD24S8); } - diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h index 2137251d29..5834b151fd 100644 --- a/src/gpu/vk/GrVkCaps.h +++ b/src/gpu/vk/GrVkCaps.h @@ -19,7 +19,7 @@ class GrGLSLCaps; * Stores some capabilities of a Vk backend. */ class GrVkCaps : public GrCaps { -public: +public: typedef GrVkStencilAttachment::Format StencilFormat; /** diff --git a/src/gpu/vk/GrVkCommandBuffer.cpp b/src/gpu/vk/GrVkCommandBuffer.cpp index ea2b1bee0b..cd97337956 100644 --- a/src/gpu/vk/GrVkCommandBuffer.cpp +++ b/src/gpu/vk/GrVkCommandBuffer.cpp @@ -63,7 +63,7 @@ void GrVkCommandBuffer::freeGPUData(const GrVkGpu* gpu) const { for (int i = 0; i < fTrackedResources.count(); ++i) { fTrackedResources[i]->unref(gpu); } - + // Destroy the fence, if any if (VK_NULL_HANDLE != fSubmitFence) { GR_VK_CALL(gpu->vkInterface(), DestroyFence(gpu->device(), fSubmitFence, nullptr)); @@ -126,7 +126,7 @@ void GrVkCommandBuffer::endRenderPass(const GrVkGpu* gpu) { void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu::SyncQueue sync) { SkASSERT(!fIsActive); - + VkResult err; VkFenceCreateInfo fenceInfo; memset(&fenceInfo, 0, sizeof(VkFenceCreateInfo)); @@ -148,7 +148,7 @@ void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu GR_VK_CALL_ERRCHECK(gpu->vkInterface(), QueueSubmit(queue, 1, &submitInfo, fSubmitFence)); if (GrVkGpu::kForce_SyncQueue == sync) { - err = GR_VK_CALL(gpu->vkInterface(), + err = GR_VK_CALL(gpu->vkInterface(), WaitForFences(gpu->device(), 1, &fSubmitFence, true, UINT64_MAX)); if (VK_TIMEOUT == err) { SkDebugf("Fence failed to signal: %d\n", err); diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h index c3d2978d36..99a3563e8b 100644 --- a/src/gpu/vk/GrVkCommandBuffer.h +++ b/src/gpu/vk/GrVkCommandBuffer.h @@ -160,7 +160,7 @@ public: uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const; - + // Add ref-counted resource that will be tracked and released when this // command buffer finishes execution void addResource(const GrVkResource* resource) { @@ -213,4 +213,3 @@ private: #endif - diff --git a/src/gpu/vk/GrVkDescriptorPool.cpp b/src/gpu/vk/GrVkDescriptorPool.cpp index 43ffe951e2..b89145a731 100644 --- a/src/gpu/vk/GrVkDescriptorPool.cpp +++ b/src/gpu/vk/GrVkDescriptorPool.cpp @@ -13,7 +13,7 @@ GrVkDescriptorPool::GrVkDescriptorPool(const GrVkGpu* gpu, VkDescriptorType type, uint32_t count) : INHERITED() - , fType (type) + , fType (type) , fCount(count) { VkDescriptorPoolSize poolSize; memset(&poolSize, 0, sizeof(VkDescriptorPoolSize)); diff --git a/src/gpu/vk/GrVkDescriptorPool.h b/src/gpu/vk/GrVkDescriptorPool.h index 19f778c03e..bb5697c26f 100644 --- a/src/gpu/vk/GrVkDescriptorPool.h +++ b/src/gpu/vk/GrVkDescriptorPool.h @@ -15,7 +15,7 @@ class GrVkGpu; /** - * We require that all descriptor sets are of a single descriptor type. We also use a pool to only + * We require that all descriptor sets are of a single descriptor type. We also use a pool to only * make one type of descriptor set. Thus a single VkDescriptorPool will only allocated space for * for one type of descriptor. */ diff --git a/src/gpu/vk/GrVkExtensions.cpp b/src/gpu/vk/GrVkExtensions.cpp index 73cd8091a8..2bec2354f6 100644 --- a/src/gpu/vk/GrVkExtensions.cpp +++ b/src/gpu/vk/GrVkExtensions.cpp @@ -91,7 +91,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { layerCount = fInstanceLayerStrings->count(); for (uint32_t layerIndex = 0; layerIndex < layerCount; ++layerIndex) { uint32_t extensionCount = 0; - res = EnumerateInstanceExtensionProperties((*fInstanceLayerStrings)[layerIndex].c_str(), + res = EnumerateInstanceExtensionProperties((*fInstanceLayerStrings)[layerIndex].c_str(), &extensionCount, nullptr); if (VK_SUCCESS != res) { return false; @@ -107,7 +107,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { if (specVersion >= extensions[i].specVersion && find_string(*fInstanceExtensionStrings, extensions[i].extensionName) < 0) { fInstanceExtensionStrings->push_back() = extensions[i].extensionName; - SkTQSort(&fInstanceExtensionStrings->front(), &fInstanceExtensionStrings->back(), + SkTQSort(&fInstanceExtensionStrings->front(), &fInstanceExtensionStrings->back(), cmp); } } diff --git a/src/gpu/vk/GrVkExtensions.h b/src/gpu/vk/GrVkExtensions.h index 93b258e73a..6c395fdddd 100644 --- a/src/gpu/vk/GrVkExtensions.h +++ b/src/gpu/vk/GrVkExtensions.h @@ -13,7 +13,7 @@ #include "vk/GrVkDefines.h" /** - * This helper queries the Vulkan driver for available extensions and layers, remembers them, + * This helper queries the Vulkan driver for available extensions and layers, remembers them, * and can be queried. It supports queries for both instance and device extensions and layers. */ class SK_API GrVkExtensions { @@ -22,7 +22,7 @@ public: , fDeviceExtensionStrings(new SkTArray) , fInstanceLayerStrings(new SkTArray) , fDeviceLayerStrings(new SkTArray) {} - + bool initInstance(uint32_t specVersion); bool initDevice(uint32_t specVersion, VkInstance, VkPhysicalDevice); diff --git a/src/gpu/vk/GrVkFramebuffer.cpp b/src/gpu/vk/GrVkFramebuffer.cpp index d79895ce8e..49c6e414fc 100644 --- a/src/gpu/vk/GrVkFramebuffer.cpp +++ b/src/gpu/vk/GrVkFramebuffer.cpp @@ -20,7 +20,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, // At the very least we need a renderPass and a colorAttachment SkASSERT(renderPass); SkASSERT(colorAttachment); - + VkImageView attachments[3]; attachments[0] = colorAttachment->imageView(); int numAttachments = 1; @@ -30,7 +30,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, if (stencilAttachment) { attachments[numAttachments++] = stencilAttachment->imageView(); } - + VkFramebufferCreateInfo createInfo; memset(&createInfo, 0, sizeof(VkFramebufferCreateInfo)); createInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; @@ -42,7 +42,7 @@ GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, createInfo.width = width; createInfo.height = height; createInfo.layers = 1; - + VkFramebuffer framebuffer; VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateFramebuffer(gpu->device(), &createInfo, @@ -59,5 +59,3 @@ void GrVkFramebuffer::freeGPUData(const GrVkGpu* gpu) const { SkASSERT(fFramebuffer); GR_VK_CALL(gpu->vkInterface(), DestroyFramebuffer(gpu->device(), fFramebuffer, nullptr)); } - - diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 496f38c3df..de1e9052fa 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -79,7 +79,7 @@ GrGpu* GrVkGpu::Create(GrBackendContext backendContext, const GrContextOptions& //////////////////////////////////////////////////////////////////////////////// -GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, +GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, const GrVkBackendContext* backendCtx) : INHERITED(context) , fVkInstance(backendCtx->fInstance) @@ -122,7 +122,7 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // CmdPoolCreateFlags backendCtx->fQueueFamilyIndex, // queueFamilyIndex }; - GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateCommandPool(fDevice, &cmdPoolInfo, nullptr, + GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateCommandPool(fDevice, &cmdPoolInfo, nullptr, &fCmdPool)); // must call this after creating the CommandPool @@ -141,7 +141,7 @@ GrVkGpu::~GrVkGpu() { SkDEBUGCODE(VkResult res =) VK_CALL(QueueWaitIdle(fQueue)); // VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec) SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); - + // must call this just before we destroy the VkDevice fResourceProvider.destroyResources(); @@ -208,7 +208,7 @@ bool GrVkGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, } if (dstSurface->config() != srcConfig) { - // TODO: This should fall back to drawing or copying to change config of dstSurface to + // TODO: This should fall back to drawing or copying to change config of dstSurface to // match that of srcConfig. return false; } @@ -319,7 +319,7 @@ bool GrVkGpu::uploadTexData(GrVkTexture* tex, VkDeviceSize offset = texTop*layout.rowPitch + left*bpp; VkDeviceSize size = height*layout.rowPitch; void* mapPtr; - err = GR_VK_CALL(interface, MapMemory(fDevice, tex->textureMemory(), offset, size, 0, + err = GR_VK_CALL(interface, MapMemory(fDevice, tex->textureMemory(), offset, size, 0, &mapPtr)); if (err) { return false; @@ -556,11 +556,11 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, GrVkTexture* texture = nullptr; if (renderTarget) { - texture = GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(this, surfDesc, + texture = GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(this, surfDesc, lifeCycle, format, info); } else { - texture = GrVkTexture::CreateWrappedTexture(this, surfDesc, lifeCycle, format, + texture = GrVkTexture::CreateWrappedTexture(this, surfDesc, lifeCycle, format, info); } if (!texture) { @@ -572,7 +572,7 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc, GrWrapOwnership ownership) { - + const GrVkTextureInfo* info = reinterpret_cast(wrapDesc.fRenderTargetHandle); if (VK_NULL_HANDLE == info->fImage || @@ -594,7 +594,7 @@ GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe desc.fOrigin = resolve_origin(wrapDesc.fOrigin); GrVkRenderTarget* tgt = GrVkRenderTarget::CreateWrappedRenderTarget(this, desc, - lifeCycle, + lifeCycle, info); if (tgt && wrapDesc.fStencilBits) { if (!createStencilAttachmentForRenderTarget(tgt, desc.fWidth, desc.fHeight)) { @@ -975,7 +975,7 @@ void GrVkGpu::onClear(GrRenderTarget* target, const SkIRect& rect, GrColor color VkClearColorValue vkColor; GrColorToRGBAFloat(color, vkColor.float32); - + GrVkRenderTarget* vkRT = static_cast(target); VkImageLayout origDstLayout = vkRT->currentLayout(); @@ -1045,7 +1045,7 @@ void GrVkGpu::onClear(GrRenderTarget* target, const SkIRect& rect, GrColor color subRange.baseArrayLayer = 0; subRange.layerCount = 1; - // In the future we may not actually be doing this type of clear at all. If we are inside a + // In the future we may not actually be doing this type of clear at all. If we are inside a // render pass or doing a non full clear then we will use CmdClearColorAttachment. The more // common use case will be clearing an attachment at the start of a render pass, in which case // we will use the clear load ops. @@ -1091,7 +1091,7 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, // the cache is flushed since it is only being written to. VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(origDstLayout);; VkAccessFlags dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; - + dstTex->setImageLayout(this, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, srcAccessMask, @@ -1099,7 +1099,7 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst, srcStageMask, dstStageMask, false); - + srcStageMask = GrVkMemory::LayoutToPipelineStageFlags(origSrcLayout); dstStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT; @@ -1225,7 +1225,7 @@ bool GrVkGpu::onReadPixels(GrSurface* surface, dstStageMask, false); - GrVkTransferBuffer* transferBuffer = + GrVkTransferBuffer* transferBuffer = static_cast(this->createBuffer(kXferGpuToCpu_GrBufferType, rowBytes * height, kStream_GrAccessPattern)); @@ -1441,4 +1441,3 @@ void GrVkGpu::onDraw(const GrPipeline& pipeline, #endif #endif } - diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 91a67b6deb..99c03bd4e8 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -106,7 +106,7 @@ public: VkPipelineStageFlags dstStageMask, bool byRegion, VkImageMemoryBarrier* barrier) const; - + shaderc_compiler_t shadercCompiler() const { return fCompiler; } @@ -169,7 +169,7 @@ private: void bindGeometry(const GrPrimitiveProcessor&, const GrNonInstancedMesh&); // Ends and submits the current command buffer to the queue and then creates a new command - // buffer and begins it. If sync is set to kForce_SyncQueue, the function will wait for all + // buffer and begins it. If sync is set to kForce_SyncQueue, the function will wait for all // work in the queue to finish before returning. void submitCommandBuffer(SyncQueue sync); diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp index 729c62794d..f91c6a9ee6 100644 --- a/src/gpu/vk/GrVkImage.cpp +++ b/src/gpu/vk/GrVkImage.cpp @@ -24,7 +24,7 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout, if (newLayout == fCurrentLayout) { return; } - + VkImageMemoryBarrier imageMemoryBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType NULL, // pNext @@ -44,7 +44,7 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout, fCurrentLayout = newLayout; } -const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu, +const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu, const ImageDesc& imageDesc) { VkImage image = 0; VkDeviceMemory alloc; diff --git a/src/gpu/vk/GrVkImageView.cpp b/src/gpu/vk/GrVkImageView.cpp index 70e6106879..1ab2475f1c 100644 --- a/src/gpu/vk/GrVkImageView.cpp +++ b/src/gpu/vk/GrVkImageView.cpp @@ -12,7 +12,7 @@ const GrVkImageView* GrVkImageView::Create(GrVkGpu* gpu, VkImage image, VkFormat format, Type viewType) { VkImageView imageView; - + // Create the VkImageView VkImageViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, // sType @@ -32,18 +32,16 @@ const GrVkImageView* GrVkImageView::Create(GrVkGpu* gpu, VkImage image, VkFormat viewInfo.components.a = VK_COMPONENT_SWIZZLE_ZERO; viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT; } - + VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateImageView(gpu->device(), &viewInfo, nullptr, &imageView)); if (err) { return nullptr; } - + return new GrVkImageView(imageView); } void GrVkImageView::freeGPUData(const GrVkGpu* gpu) const { GR_VK_CALL(gpu->vkInterface(), DestroyImageView(gpu->device(), fImageView, nullptr)); } - - diff --git a/src/gpu/vk/GrVkImageView.h b/src/gpu/vk/GrVkImageView.h index ab988c065a..f70080852d 100644 --- a/src/gpu/vk/GrVkImageView.h +++ b/src/gpu/vk/GrVkImageView.h @@ -20,7 +20,7 @@ public: kColor_Type, kStencil_Type }; - + static const GrVkImageView* Create(GrVkGpu* gpu, VkImage image, VkFormat format, Type viewType); VkImageView imageView() const { return fImageView; } diff --git a/src/gpu/vk/GrVkIndexBuffer.cpp b/src/gpu/vk/GrVkIndexBuffer.cpp index 6cec856cd4..7342e939e1 100644 --- a/src/gpu/vk/GrVkIndexBuffer.cpp +++ b/src/gpu/vk/GrVkIndexBuffer.cpp @@ -72,4 +72,3 @@ GrVkGpu* GrVkIndexBuffer::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp index bc6b87edb8..37e3570e48 100644 --- a/src/gpu/vk/GrVkInterface.cpp +++ b/src/gpu/vk/GrVkInterface.cpp @@ -16,7 +16,7 @@ GrVkInterface::GrVkInterface() { #define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcAddr(inst, "vk" #F) #define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(device, "vk" #F) -const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, +const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, uint32_t extensionFlags) { GrVkInterface* interface = new GrVkInterface(); @@ -373,4 +373,3 @@ bool GrVkInterface::validate() const { } return true; } - diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp index 7e8c57733a..30a38066c2 100644 --- a/src/gpu/vk/GrVkMemory.cpp +++ b/src/gpu/vk/GrVkMemory.cpp @@ -154,4 +154,3 @@ VkAccessFlags GrVkMemory::LayoutToSrcAccessMask(const VkImageLayout layout) { } return flags; } - diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp index 794acb077c..53e9dba08f 100644 --- a/src/gpu/vk/GrVkPipeline.cpp +++ b/src/gpu/vk/GrVkPipeline.cpp @@ -203,7 +203,7 @@ void setup_viewport_scissor_state(const GrVkGpu* gpu, SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount); } -void setup_multisample_state(const GrPipeline& pipeline, +void setup_multisample_state(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, const GrCaps* caps, VkPipelineMultisampleStateCreateInfo* multisampleInfo) { @@ -469,8 +469,8 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline, VkPipeline vkPipeline; VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->device(), - cache, 1, - &pipelineCreateInfo, + cache, 1, + &pipelineCreateInfo, nullptr, &vkPipeline)); if (err) { return nullptr; @@ -493,7 +493,7 @@ void set_dynamic_scissor_state(GrVkGpu* gpu, if (scissorState.enabled() && !scissorState.rect().contains(0, 0, target.width(), target.height())) { // This all assumes the scissorState has previously been clipped to the device space render - // target. + // target. scissor.offset.x = scissorState.rect().fLeft; scissor.extent.width = scissorState.rect().width(); if (kTopLeft_GrSurfaceOrigin == target.origin()) { diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h index be422e1f3d..0e818edadc 100644 --- a/src/gpu/vk/GrVkPipeline.h +++ b/src/gpu/vk/GrVkPipeline.h @@ -23,7 +23,7 @@ class GrVkRenderPass; class GrVkPipeline : public GrVkResource { public: - static GrVkPipeline* Create(GrVkGpu* gpu, + static GrVkPipeline* Create(GrVkGpu* gpu, const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, VkPipelineShaderStageCreateInfo* shaderStageInfo, diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp index 996ce4a13c..dacd66b0e7 100644 --- a/src/gpu/vk/GrVkPipelineState.cpp +++ b/src/gpu/vk/GrVkPipelineState.cpp @@ -489,7 +489,7 @@ void GrVkPipelineState::BuildStateKey(const GrPipeline& pipeline, GrPrimitiveTyp b.add32(primitiveType); - // Set key length + // Set key length int keyLength = key->count(); SkASSERT(0 == (keyLength % 4)); *reinterpret_cast(key->begin()) = SkToU32(keyLength); diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp index f4bb566de1..871e94e1d3 100644 --- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp +++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp @@ -36,9 +36,9 @@ GrVkPipelineStateBuilder::GrVkPipelineStateBuilder(GrVkGpu* gpu, const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, const GrVkProgramDesc& desc) - : INHERITED(pipeline, primProc, desc) + : INHERITED(pipeline, primProc, desc) , fGpu(gpu) - , fVaryingHandler(this) + , fVaryingHandler(this) , fUniformHandler(this) { } diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp index 76ad483405..86066abe0b 100644 --- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp +++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp @@ -15,7 +15,7 @@ GrVkPipelineStateDataManager::GrVkPipelineStateDataManager(const UniformInfoArra uint32_t fragmentUniformSize) : fVertexUniformSize(vertexUniformSize) , fFragmentUniformSize(fragmentUniformSize) - , fVertexUniformsDirty(false) + , fVertexUniformsDirty(false) , fFragmentUniformsDirty(false) { fVertexUniformData.reset(vertexUniformSize); fFragmentUniformData.reset(fragmentUniformSize); @@ -279,4 +279,3 @@ void GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu, fFragmentUniformsDirty = false; } } - diff --git a/src/gpu/vk/GrVkRenderPass.cpp b/src/gpu/vk/GrVkRenderPass.cpp index 35387761d3..1aedab4cfa 100644 --- a/src/gpu/vk/GrVkRenderPass.cpp +++ b/src/gpu/vk/GrVkRenderPass.cpp @@ -187,7 +187,7 @@ void GrVkRenderPass::getBeginInfo(const GrVkRenderTarget& target, beginInfo->clearValueCount = 0; beginInfo->pClearValues = nullptr; - // Currently just assuming no secondary cmd buffers. This value will need to be update if we + // Currently just assuming no secondary cmd buffers. This value will need to be update if we // have them. *contents = VK_SUBPASS_CONTENTS_INLINE; } @@ -235,4 +235,3 @@ void GrVkRenderPass::genKey(GrProcessorKeyBuilder* b) const { b->add32(fAttachmentsDescriptor.fStencil.fSamples); } } - diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp index c04cca3d69..486f2f52b9 100644 --- a/src/gpu/vk/GrVkRenderTarget.cpp +++ b/src/gpu/vk/GrVkRenderTarget.cpp @@ -120,7 +120,7 @@ GrVkRenderTarget::Create(GrVkGpu* gpu, const GrVkImage::Resource* imageResource) { VkFormat pixelFormat; GrPixelConfigToVkFormat(desc.fConfig, &pixelFormat); - + VkImage colorImage; // create msaa surface if necessary @@ -211,7 +211,7 @@ GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, SkASSERT(VK_NULL_HANDLE != info->fImage); SkASSERT(VK_NULL_HANDLE != info->fAlloc || kAdopted_LifeCycle != lifeCycle); - GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTiling) + GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTiling) ? Resource::kLinearTiling_Flag : Resource::kNo_Flags; const GrVkImage::Resource* imageResource; @@ -410,4 +410,3 @@ GrVkGpu* GrVkRenderTarget::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h index 21c5788aa1..f8c08e6b98 100644 --- a/src/gpu/vk/GrVkRenderTarget.h +++ b/src/gpu/vk/GrVkRenderTarget.h @@ -63,7 +63,7 @@ public: // Returns the total number of attachments void getAttachmentsDescriptor(GrVkRenderPass::AttachmentsDescriptor* desc, GrVkRenderPass::AttachmentFlags* flags) const; - + void addResources(GrVkCommandBuffer& commandBuffer) const; protected: @@ -130,7 +130,7 @@ private: const GrVkImage::Resource* fMSAAImageResource; const GrVkImageView* fResolveAttachmentView; int fColorValuesPerPixel; - + // This is a cached pointer to a simple render pass. The render target should unref it // once it is done with it. const GrVkRenderPass* fCachedSimpleRenderPass; diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h index 8387c4ef96..6c08f4ee55 100644 --- a/src/gpu/vk/GrVkResource.h +++ b/src/gpu/vk/GrVkResource.h @@ -80,7 +80,7 @@ public: return false; } - /** Increment the reference count. + /** Increment the reference count. Must be balanced by a call to unref() or unrefAndFreeResources(). */ void ref() const { @@ -122,13 +122,13 @@ public: #endif private: - /** Must be implemented by any subclasses. - * Deletes any Vk data associated with this resource + /** Must be implemented by any subclasses. + * Deletes any Vk data associated with this resource */ virtual void freeGPUData(const GrVkGpu* gpu) const = 0; - /** Must be overridden by subclasses that themselves store GrVkResources. - * Will unrefAndAbandon those resources without deleting the underlying Vk data + /** Must be overridden by subclasses that themselves store GrVkResources. + * Will unrefAndAbandon those resources without deleting the underlying Vk data */ virtual void abandonSubResources() const {} diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp index 8bb3911c76..7def55d555 100644 --- a/src/gpu/vk/GrVkResourceProvider.cpp +++ b/src/gpu/vk/GrVkResourceProvider.cpp @@ -61,9 +61,9 @@ GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPipeline& pipeline, // To create framebuffers, we first need to create a simple RenderPass that is -// only used for framebuffer creation. When we actually render we will create +// only used for framebuffer creation. When we actually render we will create // RenderPasses as needed that are compatible with the framebuffer. -const GrVkRenderPass* +const GrVkRenderPass* GrVkResourceProvider::findOrCreateCompatibleRenderPass(const GrVkRenderTarget& target) { for (int i = 0; i < fSimpleRenderPasses.count(); ++i) { GrVkRenderPass* renderPass = fSimpleRenderPasses[i]; diff --git a/src/gpu/vk/GrVkSampler.cpp b/src/gpu/vk/GrVkSampler.cpp index 9938340a84..fb8dacae87 100644 --- a/src/gpu/vk/GrVkSampler.cpp +++ b/src/gpu/vk/GrVkSampler.cpp @@ -74,7 +74,7 @@ void GrVkSampler::freeGPUData(const GrVkGpu* gpu) const { uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { uint8_t key = params.filterMode(); - + SkASSERT(params.filterMode() <= 3); key |= (params.getTileModeX() << 2); @@ -83,4 +83,3 @@ uint8_t GrVkSampler::GenerateKey(const GrTextureParams& params) { return key; } - diff --git a/src/gpu/vk/GrVkSampler.h b/src/gpu/vk/GrVkSampler.h index 3e08745779..ec97751cbb 100644 --- a/src/gpu/vk/GrVkSampler.h +++ b/src/gpu/vk/GrVkSampler.h @@ -40,4 +40,3 @@ private: }; #endif - diff --git a/src/gpu/vk/GrVkStencilAttachment.cpp b/src/gpu/vk/GrVkStencilAttachment.cpp index a632700d02..97597fc511 100644 --- a/src/gpu/vk/GrVkStencilAttachment.cpp +++ b/src/gpu/vk/GrVkStencilAttachment.cpp @@ -62,7 +62,7 @@ GrVkStencilAttachment* GrVkStencilAttachment::Create(GrVkGpu* gpu, imageResource, imageView); imageResource->unref(gpu); imageView->unref(gpu); - + return stencil; } diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp index 058dfbdc0a..b297b60c11 100644 --- a/src/gpu/vk/GrVkTexture.cpp +++ b/src/gpu/vk/GrVkTexture.cpp @@ -76,7 +76,7 @@ GrVkTexture* GrVkTexture::CreateNewTexture(GrVkGpu* gpu, const GrSurfaceDesc& de GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu, const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle, - VkFormat format, + VkFormat format, const GrVkTextureInfo* info) { SkASSERT(info); // Wrapped textures require both image and allocation (because they can be mapped) @@ -145,4 +145,3 @@ GrVkGpu* GrVkTexture::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast(this->getGpu()); } - diff --git a/src/gpu/vk/GrVkTexture.h b/src/gpu/vk/GrVkTexture.h index 48ec7305e4..7c476ca542 100644 --- a/src/gpu/vk/GrVkTexture.h +++ b/src/gpu/vk/GrVkTexture.h @@ -21,7 +21,7 @@ public: static GrVkTexture* CreateNewTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, const GrVkImage::ImageDesc&); - + static GrVkTexture* CreateWrappedTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, VkFormat, const GrVkTextureInfo*); @@ -47,7 +47,7 @@ protected: GrGpuResource::LifeCycle, VkFormat, const GrVkImage::Resource* texImpl); - GrVkGpu* getVkGpu() const; + GrVkGpu* getVkGpu() const; void onAbandon() override; void onRelease() override; diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp index 43e213fc50..bd028d2536 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.cpp +++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp @@ -129,7 +129,7 @@ GrVkTextureRenderTarget::CreateNewTextureRenderTarget(GrVkGpu* gpu, return nullptr; } - GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, lifeCycle, + GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, lifeCycle, imageDesc.fFormat, imageRsrc); // Create() will increment the refCount of the image resource if it succeeds imageRsrc->unref(gpu); @@ -141,7 +141,7 @@ GrVkTextureRenderTarget* GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu, const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle, - VkFormat format, + VkFormat format, const GrVkTextureInfo* info) { SkASSERT(info); // Wrapped textures require both image and allocation (because they can be mapped) @@ -170,4 +170,3 @@ GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu, return trt; } - diff --git a/src/gpu/vk/GrVkTextureRenderTarget.h b/src/gpu/vk/GrVkTextureRenderTarget.h index a7aff009d3..f2580ebf51 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.h +++ b/src/gpu/vk/GrVkTextureRenderTarget.h @@ -28,7 +28,7 @@ public: GrGpuResource::LifeCycle, const GrVkImage::ImageDesc&); - static GrVkTextureRenderTarget* CreateWrappedTextureRenderTarget(GrVkGpu*, + static GrVkTextureRenderTarget* CreateWrappedTextureRenderTarget(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, VkFormat, diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp index ac6da190d7..fac955d874 100644 --- a/src/gpu/vk/GrVkUniformHandler.cpp +++ b/src/gpu/vk/GrVkUniformHandler.cpp @@ -201,4 +201,3 @@ void GrVkUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkString* out->appendf("%s\n};\n", uniformsString.c_str()); } } - diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp index ec3ec234d4..5ab7966d1a 100644 --- a/src/gpu/vk/GrVkUtil.cpp +++ b/src/gpu/vk/GrVkUtil.cpp @@ -91,4 +91,3 @@ bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSam return false; } } - diff --git a/src/gpu/vk/GrVkUtil.h b/src/gpu/vk/GrVkUtil.h index a3064c8329..4e03c751a8 100644 --- a/src/gpu/vk/GrVkUtil.h +++ b/src/gpu/vk/GrVkUtil.h @@ -33,4 +33,3 @@ bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format); bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples); #endif - diff --git a/src/gpu/vk/GrVkVertexBuffer.cpp b/src/gpu/vk/GrVkVertexBuffer.cpp index 1d3eadb42c..c2c2df0d8f 100644 --- a/src/gpu/vk/GrVkVertexBuffer.cpp +++ b/src/gpu/vk/GrVkVertexBuffer.cpp @@ -71,4 +71,3 @@ GrVkGpu* GrVkVertexBuffer::getVkGpu() const { SkASSERT(!this->wasDestroyed()); return static_cast(this->getGpu()); } - diff --git a/src/images/SkGIFMovie.cpp b/src/images/SkGIFMovie.cpp index 103107961b..00df53d237 100644 --- a/src/images/SkGIFMovie.cpp +++ b/src/images/SkGIFMovie.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/images/SkImageEncoder_Factory.cpp b/src/images/SkImageEncoder_Factory.cpp index 8d4cc6541b..887ce55dda 100644 --- a/src/images/SkImageEncoder_Factory.cpp +++ b/src/images/SkImageEncoder_Factory.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2009 The Android Open Source Project * diff --git a/src/images/SkJPEGWriteUtility.h b/src/images/SkJPEGWriteUtility.h index c84465289c..91d07a3616 100644 --- a/src/images/SkJPEGWriteUtility.h +++ b/src/images/SkJPEGWriteUtility.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/images/SkKTXImageEncoder.cpp b/src/images/SkKTXImageEncoder.cpp index 79f0293c2a..5dc347ad66 100644 --- a/src/images/SkKTXImageEncoder.cpp +++ b/src/images/SkKTXImageEncoder.cpp @@ -59,7 +59,7 @@ bool SkKTXImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap, int) if (SkKTXFile::is_ktx(bytes)) { return stream->write(bytes, data->size()); } - + // If it's neither a KTX nor a PKM, then we need to // get at the actual pixels, so fall through and decompress... } diff --git a/src/images/SkMovie.cpp b/src/images/SkMovie.cpp index 9749011a81..bf94f281c8 100644 --- a/src/images/SkMovie.cpp +++ b/src/images/SkMovie.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/images/SkMovie_FactoryDefault.cpp b/src/images/SkMovie_FactoryDefault.cpp index ef8ddda830..84ae78a880 100644 --- a/src/images/SkMovie_FactoryDefault.cpp +++ b/src/images/SkMovie_FactoryDefault.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/images/transform_scanline.h b/src/images/transform_scanline.h index 36efdd84ea..4baf6b6c6b 100644 --- a/src/images/transform_scanline.h +++ b/src/images/transform_scanline.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/src/pdf/SkDeflate.cpp b/src/pdf/SkDeflate.cpp index 3ae0d46068..ebf203a264 100644 --- a/src/pdf/SkDeflate.cpp +++ b/src/pdf/SkDeflate.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/pdf/SkJpegInfo.cpp b/src/pdf/SkJpegInfo.cpp index 3c52a102db..5e5ec792ea 100644 --- a/src/pdf/SkJpegInfo.cpp +++ b/src/pdf/SkJpegInfo.cpp @@ -117,5 +117,3 @@ bool SkIsJFIF(const SkData* skdata, SkJFIFInfo* info) { } return true; } - - diff --git a/src/pdf/SkJpegInfo.h b/src/pdf/SkJpegInfo.h index 1b03e45b10..39de99455a 100644 --- a/src/pdf/SkJpegInfo.h +++ b/src/pdf/SkJpegInfo.h @@ -19,7 +19,7 @@ struct SkJFIFInfo { } fType; }; -/** Returns true iff the data seems to be a valid JFIF JPEG image. +/** Returns true iff the data seems to be a valid JFIF JPEG image. If so and if info is not nullptr, populate info. JPEG/JFIF References: diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 4adc4dae4a..df6a8f8fe2 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -1988,7 +1988,7 @@ static SkSize rect_to_size(const SkRect& r) { static sk_sp color_filter(const SkImageBitmap& imageBitmap, SkColorFilter* colorFilter) { - auto surface = + auto surface = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(imageBitmap.dimensions())); SkASSERT(surface); SkCanvas* canvas = surface->getCanvas(); diff --git a/src/pdf/SkPDFFont.h b/src/pdf/SkPDFFont.h index e410e3ee00..397cc7f2a4 100644 --- a/src/pdf/SkPDFFont.h +++ b/src/pdf/SkPDFFont.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -70,7 +69,7 @@ private: reference to each instantiated class. */ class SkPDFFont : public SkPDFDict { - + public: virtual ~SkPDFFont(); diff --git a/src/pdf/SkPDFFontImpl.h b/src/pdf/SkPDFFontImpl.h index 71f78bd4a6..0dfa19189c 100644 --- a/src/pdf/SkPDFFontImpl.h +++ b/src/pdf/SkPDFFontImpl.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp index 39d75a5a94..99617e9c01 100644 --- a/src/pdf/SkPDFFormXObject.cpp +++ b/src/pdf/SkPDFFormXObject.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/pdf/SkPDFFormXObject.h b/src/pdf/SkPDFFormXObject.h index 32d9e40904..5dda459202 100644 --- a/src/pdf/SkPDFFormXObject.h +++ b/src/pdf/SkPDFFormXObject.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h index 31848e8cac..06f1e119f0 100644 --- a/src/pdf/SkPDFGraphicState.h +++ b/src/pdf/SkPDFGraphicState.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 The Android Open Source Project * @@ -23,7 +22,7 @@ class SkPDFFormXObject; once, we want to canonicalize them. */ class SkPDFGraphicState final : public SkPDFObject { - + public: enum SkPDFSMaskMode { kAlpha_SMaskMode, diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index ef47cf7e7b..5dd94e2c68 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/pdf/SkPDFShader.h b/src/pdf/SkPDFShader.h index 921d574fff..5a5aee486d 100644 --- a/src/pdf/SkPDFShader.h +++ b/src/pdf/SkPDFShader.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp index 5b7cd57ca2..10fc77b587 100644 --- a/src/pdf/SkPDFStream.cpp +++ b/src/pdf/SkPDFStream.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/pdf/SkPDFStream.h b/src/pdf/SkPDFStream.h index e1fe539e74..cf8cda543b 100644 --- a/src/pdf/SkPDFStream.h +++ b/src/pdf/SkPDFStream.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * @@ -23,7 +22,7 @@ class SkPDFObjNumMap; SkObjRef). */ class SkPDFStream : public SkPDFDict { - + public: /** Create a PDF stream. A Length entry is automatically added to the * stream dictionary. diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h index 0dec80077c..3340089ef8 100644 --- a/src/pdf/SkPDFUtils.h +++ b/src/pdf/SkPDFUtils.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/ports/SkDebug_win.cpp b/src/ports/SkDebug_win.cpp index 6e0576652f..b0c5725a79 100644 --- a/src/ports/SkDebug_win.cpp +++ b/src/ports/SkDebug_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index 0755b647ba..53d5610575 100644 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/ports/SkImageEncoder_WIC.cpp b/src/ports/SkImageEncoder_WIC.cpp index 7911a403b6..5523ea2e11 100644 --- a/src/ports/SkImageEncoder_WIC.cpp +++ b/src/ports/SkImageEncoder_WIC.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -50,7 +49,7 @@ class SkImageEncoder_WIC : public SkImageEncoder { public: SkImageEncoder_WIC(Type t) : fType(t) {} - + // DO NOT USE this constructor. This exists only so SkForceLinking can // link the WIC image encoder. SkImageEncoder_WIC() {} diff --git a/src/ports/SkImageEncoder_none.cpp b/src/ports/SkImageEncoder_none.cpp index 33e07acea6..c7d4b92425 100644 --- a/src/ports/SkImageEncoder_none.cpp +++ b/src/ports/SkImageEncoder_none.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/ports/SkImageGeneratorCG.cpp b/src/ports/SkImageGeneratorCG.cpp index 9be0b8c6f2..c54eebf9c7 100644 --- a/src/ports/SkImageGeneratorCG.cpp +++ b/src/ports/SkImageGeneratorCG.cpp @@ -33,7 +33,7 @@ SkImageGenerator* SkImageGeneratorCG::NewFromEncodedCG(SkData* data) { if (!imageSrc) { return nullptr; } - + // Make sure we call CFRelease to free the imageSrc. Since CFRelease actually takes // a const void*, we must cast the imageSrc to a const void*. SkAutoTCallVProc autoImageSrc(imageSrc); @@ -42,7 +42,7 @@ SkImageGenerator* SkImageGeneratorCG::NewFromEncodedCG(SkData* data) { if (!properties) { return nullptr; } - + CFNumberRef widthRef = (CFNumberRef) (CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth)); CFNumberRef heightRef = (CFNumberRef) (CFDictionaryGetValue(properties, @@ -58,7 +58,7 @@ SkImageGenerator* SkImageGeneratorCG::NewFromEncodedCG(SkData* data) { !CFNumberGetValue(heightRef, kCFNumberIntType, &height)) { return nullptr; } - + SkAlphaType alphaType = hasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType; SkImageInfo info = SkImageInfo::Make(width, height, kN32_SkColorType, alphaType); @@ -85,7 +85,7 @@ bool SkImageGeneratorCG::onGetPixels(const SkImageInfo& info, void* pixels, size // FIXME: Support other colorTypes. return false; } - + switch (info.alphaType()) { case kOpaque_SkAlphaType: if (kOpaque_SkAlphaType != this->getInfo().alphaType()) { @@ -97,7 +97,7 @@ bool SkImageGeneratorCG::onGetPixels(const SkImageInfo& info, void* pixels, size default: return false; } - + CGImageRef image = CGImageSourceCreateImageAtIndex((CGImageSourceRef) fImageSrc.get(), 0, nullptr); if (!image) { diff --git a/src/ports/SkImageGeneratorCG.h b/src/ports/SkImageGeneratorCG.h index cdfeae02b6..53102eaf8c 100644 --- a/src/ports/SkImageGeneratorCG.h +++ b/src/ports/SkImageGeneratorCG.h @@ -36,7 +36,7 @@ private: SkAutoTCallVProc fImageSrc; SkAutoTUnref fData; - + typedef SkImageGenerator INHERITED; }; diff --git a/src/ports/SkImageGeneratorWIC.h b/src/ports/SkImageGeneratorWIC.h index 1366333350..6f661ef695 100644 --- a/src/ports/SkImageGeneratorWIC.h +++ b/src/ports/SkImageGeneratorWIC.h @@ -56,7 +56,7 @@ private: SkTScopedComPtr fImagingFactory; SkTScopedComPtr fImageSource; SkAutoTUnref fData; - + typedef SkImageGenerator INHERITED; }; diff --git a/src/ports/SkOSEnvironment.cpp b/src/ports/SkOSEnvironment.cpp index ab98e397a0..ec2cc3647d 100644 --- a/src/ports/SkOSEnvironment.cpp +++ b/src/ports/SkOSEnvironment.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -17,4 +16,3 @@ void sk_setenv(const char* key, const char* value) { setenv(key, value, 1); #endif } - diff --git a/src/ports/SkOSEnvironment.h b/src/ports/SkOSEnvironment.h index fdbce7a826..33cbd3ecf9 100644 --- a/src/ports/SkOSEnvironment.h +++ b/src/ports/SkOSEnvironment.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -12,4 +11,3 @@ void sk_setenv(const char* key, const char* value); #endif - diff --git a/src/ports/SkOSLibrary.h b/src/ports/SkOSLibrary.h index 7de2b902e3..ea1378f8b0 100644 --- a/src/ports/SkOSLibrary.h +++ b/src/ports/SkOSLibrary.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * @@ -13,4 +12,3 @@ void* DynamicLoadLibrary(const char* libraryName); void* GetProcedureAddress(void* library, const char* functionName); #endif - diff --git a/src/ports/SkOSLibrary_posix.cpp b/src/ports/SkOSLibrary_posix.cpp index 1571e20085..901ee22f3c 100644 --- a/src/ports/SkOSLibrary_posix.cpp +++ b/src/ports/SkOSLibrary_posix.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/ports/SkOSLibrary_win.cpp b/src/ports/SkOSLibrary_win.cpp index 9defb7ef15..63d8d2d383 100644 --- a/src/ports/SkOSLibrary_win.cpp +++ b/src/ports/SkOSLibrary_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/src/svg/parser/SkSVG.cpp b/src/svg/parser/SkSVG.cpp index 8ee7d0286a..6c2796bb98 100644 --- a/src/svg/parser/SkSVG.cpp +++ b/src/svg/parser/SkSVG.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGCircle.cpp b/src/svg/parser/SkSVGCircle.cpp index e34e17959e..9b129625fd 100644 --- a/src/svg/parser/SkSVGCircle.cpp +++ b/src/svg/parser/SkSVGCircle.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGCircle.h b/src/svg/parser/SkSVGCircle.h index 1185162727..edd306a08a 100644 --- a/src/svg/parser/SkSVGCircle.h +++ b/src/svg/parser/SkSVGCircle.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGClipPath.cpp b/src/svg/parser/SkSVGClipPath.cpp index 86dc2df7f1..4860fe7c97 100644 --- a/src/svg/parser/SkSVGClipPath.cpp +++ b/src/svg/parser/SkSVGClipPath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGClipPath.h b/src/svg/parser/SkSVGClipPath.h index 9ba4fbc757..3ab1a24514 100644 --- a/src/svg/parser/SkSVGClipPath.h +++ b/src/svg/parser/SkSVGClipPath.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGDefs.cpp b/src/svg/parser/SkSVGDefs.cpp index 3b9bc201fe..c65aafd827 100644 --- a/src/svg/parser/SkSVGDefs.cpp +++ b/src/svg/parser/SkSVGDefs.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGDefs.h b/src/svg/parser/SkSVGDefs.h index daa68940e3..8bebccbd58 100644 --- a/src/svg/parser/SkSVGDefs.h +++ b/src/svg/parser/SkSVGDefs.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGElements.cpp b/src/svg/parser/SkSVGElements.cpp index dc8ec940c5..3f8bc5783c 100644 --- a/src/svg/parser/SkSVGElements.cpp +++ b/src/svg/parser/SkSVGElements.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGElements.h b/src/svg/parser/SkSVGElements.h index d00e434742..2266a0b171 100644 --- a/src/svg/parser/SkSVGElements.h +++ b/src/svg/parser/SkSVGElements.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGEllipse.cpp b/src/svg/parser/SkSVGEllipse.cpp index 281e4e925b..344faaddbf 100644 --- a/src/svg/parser/SkSVGEllipse.cpp +++ b/src/svg/parser/SkSVGEllipse.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGEllipse.h b/src/svg/parser/SkSVGEllipse.h index c039c83028..2cdf683722 100644 --- a/src/svg/parser/SkSVGEllipse.h +++ b/src/svg/parser/SkSVGEllipse.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGFeColorMatrix.cpp b/src/svg/parser/SkSVGFeColorMatrix.cpp index 4e2d32a181..179f9c467e 100644 --- a/src/svg/parser/SkSVGFeColorMatrix.cpp +++ b/src/svg/parser/SkSVGFeColorMatrix.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGFeColorMatrix.h b/src/svg/parser/SkSVGFeColorMatrix.h index 389995ac97..233eceeda2 100644 --- a/src/svg/parser/SkSVGFeColorMatrix.h +++ b/src/svg/parser/SkSVGFeColorMatrix.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGFilter.cpp b/src/svg/parser/SkSVGFilter.cpp index 207f176b4f..e0df15671d 100644 --- a/src/svg/parser/SkSVGFilter.cpp +++ b/src/svg/parser/SkSVGFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGFilter.h b/src/svg/parser/SkSVGFilter.h index f615bd06a3..6a70718470 100644 --- a/src/svg/parser/SkSVGFilter.h +++ b/src/svg/parser/SkSVGFilter.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGG.cpp b/src/svg/parser/SkSVGG.cpp index 21a7aa868e..d155ed4afb 100644 --- a/src/svg/parser/SkSVGG.cpp +++ b/src/svg/parser/SkSVGG.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGG.h b/src/svg/parser/SkSVGG.h index 4fa27d297c..94cddc7601 100644 --- a/src/svg/parser/SkSVGG.h +++ b/src/svg/parser/SkSVGG.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGGradient.cpp b/src/svg/parser/SkSVGGradient.cpp index 0f7c6bab7e..8b54ff774b 100644 --- a/src/svg/parser/SkSVGGradient.cpp +++ b/src/svg/parser/SkSVGGradient.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGGradient.h b/src/svg/parser/SkSVGGradient.h index 286ff185dd..ba89d10d39 100644 --- a/src/svg/parser/SkSVGGradient.h +++ b/src/svg/parser/SkSVGGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGGroup.cpp b/src/svg/parser/SkSVGGroup.cpp index cbd8c4ea71..22d4cae16c 100644 --- a/src/svg/parser/SkSVGGroup.cpp +++ b/src/svg/parser/SkSVGGroup.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGGroup.h b/src/svg/parser/SkSVGGroup.h index f579a98019..5da3185b5d 100644 --- a/src/svg/parser/SkSVGGroup.h +++ b/src/svg/parser/SkSVGGroup.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGImage.cpp b/src/svg/parser/SkSVGImage.cpp index 97b8df8698..54a37b78c4 100644 --- a/src/svg/parser/SkSVGImage.cpp +++ b/src/svg/parser/SkSVGImage.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGImage.h b/src/svg/parser/SkSVGImage.h index b63beef515..22342c3469 100644 --- a/src/svg/parser/SkSVGImage.h +++ b/src/svg/parser/SkSVGImage.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGLine.cpp b/src/svg/parser/SkSVGLine.cpp index 9158c99b2c..64a0eb413b 100644 --- a/src/svg/parser/SkSVGLine.cpp +++ b/src/svg/parser/SkSVGLine.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGLine.h b/src/svg/parser/SkSVGLine.h index 3e437e0185..1db5b6575f 100644 --- a/src/svg/parser/SkSVGLine.h +++ b/src/svg/parser/SkSVGLine.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGLinearGradient.cpp b/src/svg/parser/SkSVGLinearGradient.cpp index f89ee53492..5e552c1e42 100644 --- a/src/svg/parser/SkSVGLinearGradient.cpp +++ b/src/svg/parser/SkSVGLinearGradient.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGLinearGradient.h b/src/svg/parser/SkSVGLinearGradient.h index 8eda065075..a8df805c94 100644 --- a/src/svg/parser/SkSVGLinearGradient.h +++ b/src/svg/parser/SkSVGLinearGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGMask.cpp b/src/svg/parser/SkSVGMask.cpp index 7526d18e27..011943ab79 100644 --- a/src/svg/parser/SkSVGMask.cpp +++ b/src/svg/parser/SkSVGMask.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGMask.h b/src/svg/parser/SkSVGMask.h index 2e1fd5011b..7116d45124 100644 --- a/src/svg/parser/SkSVGMask.h +++ b/src/svg/parser/SkSVGMask.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGMetadata.cpp b/src/svg/parser/SkSVGMetadata.cpp index 0f8850ecb7..70a94e2882 100644 --- a/src/svg/parser/SkSVGMetadata.cpp +++ b/src/svg/parser/SkSVGMetadata.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGMetadata.h b/src/svg/parser/SkSVGMetadata.h index 2dcb3a2c42..5297542f78 100644 --- a/src/svg/parser/SkSVGMetadata.h +++ b/src/svg/parser/SkSVGMetadata.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPaintState.cpp b/src/svg/parser/SkSVGPaintState.cpp index df8ba2823f..8fa9139d0f 100644 --- a/src/svg/parser/SkSVGPaintState.cpp +++ b/src/svg/parser/SkSVGPaintState.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGParser.cpp b/src/svg/parser/SkSVGParser.cpp index 854716b6c5..6243e37e94 100644 --- a/src/svg/parser/SkSVGParser.cpp +++ b/src/svg/parser/SkSVGParser.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPath.cpp b/src/svg/parser/SkSVGPath.cpp index c9917c7b52..225d35f8d5 100644 --- a/src/svg/parser/SkSVGPath.cpp +++ b/src/svg/parser/SkSVGPath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPath.h b/src/svg/parser/SkSVGPath.h index de325a7b6e..f2f8e8af83 100644 --- a/src/svg/parser/SkSVGPath.h +++ b/src/svg/parser/SkSVGPath.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPolygon.cpp b/src/svg/parser/SkSVGPolygon.cpp index 4b458db9e7..4925fbf7b7 100644 --- a/src/svg/parser/SkSVGPolygon.cpp +++ b/src/svg/parser/SkSVGPolygon.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPolygon.h b/src/svg/parser/SkSVGPolygon.h index b2848d064b..4945c48a84 100644 --- a/src/svg/parser/SkSVGPolygon.h +++ b/src/svg/parser/SkSVGPolygon.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPolyline.cpp b/src/svg/parser/SkSVGPolyline.cpp index 83dad488a5..7062f6d295 100644 --- a/src/svg/parser/SkSVGPolyline.cpp +++ b/src/svg/parser/SkSVGPolyline.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGPolyline.h b/src/svg/parser/SkSVGPolyline.h index b8d5af45a8..2d1b7985ba 100644 --- a/src/svg/parser/SkSVGPolyline.h +++ b/src/svg/parser/SkSVGPolyline.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGRadialGradient.cpp b/src/svg/parser/SkSVGRadialGradient.cpp index 4fdf432213..49a0297f5e 100644 --- a/src/svg/parser/SkSVGRadialGradient.cpp +++ b/src/svg/parser/SkSVGRadialGradient.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGRadialGradient.h b/src/svg/parser/SkSVGRadialGradient.h index 8eba3f5e34..b699cd6f39 100644 --- a/src/svg/parser/SkSVGRadialGradient.h +++ b/src/svg/parser/SkSVGRadialGradient.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGRect.cpp b/src/svg/parser/SkSVGRect.cpp index 32a7f99c0c..d3383b02ae 100644 --- a/src/svg/parser/SkSVGRect.cpp +++ b/src/svg/parser/SkSVGRect.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGRect.h b/src/svg/parser/SkSVGRect.h index 4ae820c588..b18a1a3e7d 100644 --- a/src/svg/parser/SkSVGRect.h +++ b/src/svg/parser/SkSVGRect.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGSVG.cpp b/src/svg/parser/SkSVGSVG.cpp index 61ccb3c819..980636ba6a 100644 --- a/src/svg/parser/SkSVGSVG.cpp +++ b/src/svg/parser/SkSVGSVG.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGSVG.h b/src/svg/parser/SkSVGSVG.h index 155f9a9bab..0c5d89daba 100644 --- a/src/svg/parser/SkSVGSVG.h +++ b/src/svg/parser/SkSVGSVG.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGStop.cpp b/src/svg/parser/SkSVGStop.cpp index 0630f6124a..575feabe83 100644 --- a/src/svg/parser/SkSVGStop.cpp +++ b/src/svg/parser/SkSVGStop.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGStop.h b/src/svg/parser/SkSVGStop.h index e55936bee6..5cf480e74c 100644 --- a/src/svg/parser/SkSVGStop.h +++ b/src/svg/parser/SkSVGStop.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGSymbol.cpp b/src/svg/parser/SkSVGSymbol.cpp index ce341e6492..afdcbd9cd2 100644 --- a/src/svg/parser/SkSVGSymbol.cpp +++ b/src/svg/parser/SkSVGSymbol.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGSymbol.h b/src/svg/parser/SkSVGSymbol.h index 80fd61a190..31ce678323 100644 --- a/src/svg/parser/SkSVGSymbol.h +++ b/src/svg/parser/SkSVGSymbol.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGText.cpp b/src/svg/parser/SkSVGText.cpp index dfaba08608..cf0c10f8ef 100644 --- a/src/svg/parser/SkSVGText.cpp +++ b/src/svg/parser/SkSVGText.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGText.h b/src/svg/parser/SkSVGText.h index 5ac2fbddfb..492ed72a13 100644 --- a/src/svg/parser/SkSVGText.h +++ b/src/svg/parser/SkSVGText.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGUse.cpp b/src/svg/parser/SkSVGUse.cpp index 0496d98b99..c73176f063 100644 --- a/src/svg/parser/SkSVGUse.cpp +++ b/src/svg/parser/SkSVGUse.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/svg/parser/SkSVGUse.h b/src/svg/parser/SkSVGUse.h index b907189f51..b67c54f191 100644 --- a/src/svg/parser/SkSVGUse.h +++ b/src/svg/parser/SkSVGUse.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/utils/SkBase64.cpp b/src/utils/SkBase64.cpp index b0268921ed..cb3396ca76 100644 --- a/src/utils/SkBase64.cpp +++ b/src/utils/SkBase64.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/utils/SkBitSet.cpp b/src/utils/SkBitSet.cpp index 985bb6eed0..7d03dfc067 100755 --- a/src/utils/SkBitSet.cpp +++ b/src/utils/SkBitSet.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkBitSet.h b/src/utils/SkBitSet.h index 266fd87496..802b9e12ac 100644 --- a/src/utils/SkBitSet.h +++ b/src/utils/SkBitSet.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkBoundaryPatch.cpp b/src/utils/SkBoundaryPatch.cpp index 7ef11ee245..0cfb09c2c7 100644 --- a/src/utils/SkBoundaryPatch.cpp +++ b/src/utils/SkBoundaryPatch.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkCanvasStack.cpp b/src/utils/SkCanvasStack.cpp index 87e8f653e2..a5a483dac9 100644 --- a/src/utils/SkCanvasStack.cpp +++ b/src/utils/SkCanvasStack.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/utils/SkCanvasStack.h b/src/utils/SkCanvasStack.h index 6602110e31..300bcd38ed 100644 --- a/src/utils/SkCanvasStack.h +++ b/src/utils/SkCanvasStack.h @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index 75fa836a6a..9530f86515 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -393,7 +392,7 @@ void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons toString(*src, &ss); rs.prependf("%s ", ss.c_str()); } - + this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)", bs.c_str(), rs.c_str()); } diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp index 197d977cac..c867587399 100644 --- a/src/utils/SkInterpolator.cpp +++ b/src/utils/SkInterpolator.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2008 The Android Open Source Project * diff --git a/src/utils/SkLayer.cpp b/src/utils/SkLayer.cpp index 39032b616e..d0de1ba6b1 100644 --- a/src/utils/SkLayer.cpp +++ b/src/utils/SkLayer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkMeshUtils.cpp b/src/utils/SkMeshUtils.cpp index 5d3eefc54f..27eccc250d 100644 --- a/src/utils/SkMeshUtils.cpp +++ b/src/utils/SkMeshUtils.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp index fd5fa82aa5..4397814d04 100644 --- a/src/utils/SkNWayCanvas.cpp +++ b/src/utils/SkNWayCanvas.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp index aeb65b1e28..f4d2300dc3 100644 --- a/src/utils/SkNinePatch.cpp +++ b/src/utils/SkNinePatch.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/utils/SkParse.cpp b/src/utils/SkParse.cpp index b5a108e2cb..90c9fffe41 100644 --- a/src/utils/SkParse.cpp +++ b/src/utils/SkParse.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp index 329b304ac4..eafdc4c3d1 100644 --- a/src/utils/SkParseColor.cpp +++ b/src/utils/SkParseColor.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/utils/SkParsePath.cpp b/src/utils/SkParsePath.cpp index 8baa6611ee..8f571f9051 100644 --- a/src/utils/SkParsePath.cpp +++ b/src/utils/SkParsePath.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/SkPatchGrid.cpp b/src/utils/SkPatchGrid.cpp index b7aaa82b9b..3b7c06e954 100644 --- a/src/utils/SkPatchGrid.cpp +++ b/src/utils/SkPatchGrid.cpp @@ -36,28 +36,28 @@ bool SkPatchGrid::setPatch(int x, int y, const SkPoint cubics[12], const SkColor if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || nullptr == cubics) { return false; } - + // setup corners and colors int cornerPos = y * (fCols + 1) + x; fCornerPts[cornerPos] = cubics[SkPatchUtils::kTopP0_CubicCtrlPts]; fCornerPts[cornerPos + 1] = cubics[SkPatchUtils::kTopP3_CubicCtrlPts]; fCornerPts[cornerPos + (fCols + 1)] = cubics[SkPatchUtils::kBottomP0_CubicCtrlPts]; fCornerPts[cornerPos + (fCols + 1) + 1] = cubics[SkPatchUtils::kBottomP3_CubicCtrlPts]; - + // set horizontal control points int hrzPos = y * (fCols * 2) + (x * 2); fHrzCtrlPts[hrzPos] = cubics[SkPatchUtils::kTopP1_CubicCtrlPts]; fHrzCtrlPts[hrzPos + 1] = cubics[SkPatchUtils::kTopP2_CubicCtrlPts]; fHrzCtrlPts[hrzPos + (fCols * 2)] = cubics[SkPatchUtils::kBottomP1_CubicCtrlPts]; fHrzCtrlPts[hrzPos + (fCols * 2) + 1] = cubics[SkPatchUtils::kBottomP2_CubicCtrlPts]; - + // set vertical control points int vrtPos = (y*2) * (fCols + 1) + x; fVrtCtrlPts[vrtPos] = cubics[SkPatchUtils::kLeftP1_CubicCtrlPts]; fVrtCtrlPts[vrtPos + 1] = cubics[SkPatchUtils::kRightP1_CubicCtrlPts]; fVrtCtrlPts[vrtPos + (fCols + 1)] = cubics[SkPatchUtils::kLeftP2_CubicCtrlPts]; fVrtCtrlPts[vrtPos + (fCols + 1) + 1] = cubics[SkPatchUtils::kRightP2_CubicCtrlPts]; - + // set optional values (colors and texture coordinates) if ((fModeFlags & kColors_VertexType) && colors) { fCornerColors[cornerPos] = colors[0]; @@ -65,57 +65,57 @@ bool SkPatchGrid::setPatch(int x, int y, const SkPoint cubics[12], const SkColor fCornerColors[cornerPos + (fCols + 1)] = colors[3]; fCornerColors[cornerPos + (fCols + 1) + 1] = colors[2]; } - + if ((fModeFlags & kTexs_VertexType) && texCoords) { fTexCoords[cornerPos] = texCoords[0]; fTexCoords[cornerPos + 1] = texCoords[1]; fTexCoords[cornerPos + (fCols + 1)] = texCoords[3]; fTexCoords[cornerPos + (fCols + 1) + 1] = texCoords[2]; } - + return true; } bool SkPatchGrid::getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4], SkPoint texCoords[4]) const { - + if (x < 0 || y < 0 || x > fCols - 1 || y > fRows - 1 || nullptr == cubics) { return false; } - + // set the patch by building the array of points and colors with the corresponding values. int cornerPos = y * (fCols + 1) + x; cubics[SkPatchUtils::kTopP0_CubicCtrlPts] = fCornerPts[cornerPos]; cubics[SkPatchUtils::kTopP3_CubicCtrlPts] = fCornerPts[cornerPos + 1]; cubics[SkPatchUtils::kBottomP0_CubicCtrlPts] = fCornerPts[cornerPos + (fCols + 1)]; cubics[SkPatchUtils::kBottomP3_CubicCtrlPts] = fCornerPts[cornerPos + (fCols + 1) + 1]; - + int hrzPos = y * (fCols * 2) + (x * 2); cubics[SkPatchUtils::kTopP1_CubicCtrlPts] = fHrzCtrlPts[hrzPos]; cubics[SkPatchUtils::kTopP2_CubicCtrlPts] = fHrzCtrlPts[hrzPos + 1]; cubics[SkPatchUtils::kBottomP1_CubicCtrlPts] = fHrzCtrlPts[hrzPos + (fCols * 2)]; cubics[SkPatchUtils::kBottomP2_CubicCtrlPts] = fHrzCtrlPts[hrzPos + (fCols * 2) + 1]; - + int vrtPos = (y*2) * (fCols + 1) + x; cubics[SkPatchUtils::kLeftP1_CubicCtrlPts] = fVrtCtrlPts[vrtPos]; cubics[SkPatchUtils::kRightP1_CubicCtrlPts] = fVrtCtrlPts[vrtPos + 1]; cubics[SkPatchUtils::kLeftP2_CubicCtrlPts] = fVrtCtrlPts[vrtPos + (fCols + 1)]; cubics[SkPatchUtils::kRightP2_CubicCtrlPts] = fVrtCtrlPts[vrtPos + (fCols + 1) + 1]; - + if ((fModeFlags & kColors_VertexType) && colors) { colors[0] = fCornerColors[cornerPos]; colors[1] = fCornerColors[cornerPos + 1]; colors[3] = fCornerColors[cornerPos + (fCols + 1)]; colors[2] = fCornerColors[cornerPos + (fCols + 1) + 1]; } - + if ((fModeFlags & kTexs_VertexType) && texCoords) { texCoords[0] = fTexCoords[cornerPos]; texCoords[1] = fTexCoords[cornerPos + 1]; texCoords[3] = fTexCoords[cornerPos + (fCols + 1)]; texCoords[2] = fTexCoords[cornerPos + (fCols + 1) + 1]; } - + return true; } @@ -137,12 +137,12 @@ void SkPatchGrid::reset(int rows, int cols, VertexType flags, SkXfermode* xMode) memset(fCornerPts, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint)); memset(fHrzCtrlPts, 0, (fRows + 1) * fCols * 2 * sizeof(SkPoint)); memset(fVrtCtrlPts, 0, fRows * 2 * (fCols + 1) * sizeof(SkPoint)); - + if (fModeFlags & kColors_VertexType) { fCornerColors = new SkColor[(fRows + 1) * (fCols + 1)]; memset(fCornerColors, 0, (fRows + 1) * (fCols + 1) * sizeof(SkColor)); } - + if (fModeFlags & kTexs_VertexType) { fTexCoords = new SkPoint[(fRows + 1) * (fCols + 1)]; memset(fTexCoords, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint)); @@ -154,7 +154,7 @@ void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) { int* maxRows = new int[fRows]; memset(maxCols, 0, fCols * sizeof(int)); memset(maxRows, 0, fRows * sizeof(int)); - + // Get the maximum level of detail per axis for each row and column for (int y = 0; y < fRows; y++) { for (int x = 0; x < fCols; x++) { diff --git a/src/utils/SkPatchGrid.h b/src/utils/SkPatchGrid.h index 5bc2e65df0..ca2a35b912 100644 --- a/src/utils/SkPatchGrid.h +++ b/src/utils/SkPatchGrid.h @@ -13,12 +13,12 @@ #include "SkXfermode.h" /** - * Class that represents a grid of patches. Adjacent patches share their corners and a color is + * Class that represents a grid of patches. Adjacent patches share their corners and a color is * specified at each one of them. The colors are bilinearly interpolated across the patch. * - * This implementation defines a bidimensional array of patches. There are 3 arrays to store the + * This implementation defines a bidimensional array of patches. There are 3 arrays to store the * control points of the patches to avoid storing repeated data since there are several points - * shared between adjacent patches. + * shared between adjacent patches. * * The array fCornerPts stores the corner control points of the patches. * The array fHrzPts holds the intermidiate control points of the top and bottom curves of a patch. @@ -54,11 +54,11 @@ * \ / \ / * H8 H9 H10 H11 * - * When trying to get a patch at a certain position it justs builds it with the corresponding + * When trying to get a patch at a certain position it justs builds it with the corresponding * points. * When adding a patch it tries to add the points at their corresponding position trying to comply * with the adjacent points or overwriting them. - * + * * Based the idea on the SVG2 spec for mesh gradients in which a grid of patches is build as in the * the following example: * @@ -77,58 +77,58 @@ * */ class SkPatchGrid { - + public: - + enum VertexType { kNone_VertexType = 0X00, kColors_VertexType = 0x01, kTexs_VertexType = 0x02, kColorsAndTexs_VertexType = 0x03 }; - + SkPatchGrid(int rows = 0, int cols = 0, VertexType flags = kNone_VertexType, SkXfermode* xfer = nullptr); - + ~SkPatchGrid(); - + /** - * Add a patch at location (x,y) overwriting the previous patch and shared points so they + * Add a patch at location (x,y) overwriting the previous patch and shared points so they * mantain C0 connectivity. * The control points must be passed in a clockwise order starting at the top left corner. - * The colors and texCoords are the values at the corners of the patch which will be bilerp + * The colors and texCoords are the values at the corners of the patch which will be bilerp * across it, they must also be in counterclockwise order starting at the top left corner. */ bool setPatch(int x, int y, const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4]); - + /** * Get patch at location (x,y). If cubics, colors or texCoords is not nullptr it sets patch's * array with its corresponding values. - * The function returns false if the cubics parameter is nullptr or if the (x,y) coordinates are + * The function returns false if the cubics parameter is nullptr or if the (x,y) coordinates are * not within the range of the grid. */ bool getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4], SkPoint texCoords[4]) const; - + /** * Resets the grid of patches to contain rows and cols of patches. */ void reset(int rows, int cols, VertexType flags, SkXfermode* xMode); - + /** - * Draws the grid of patches. The patches are drawn starting at patch (0,0) drawing columns, so - * for a 2x2 grid the order would be (0,0)->(0,1)->(1,0)->(1,1). The order follows the order + * Draws the grid of patches. The patches are drawn starting at patch (0,0) drawing columns, so + * for a 2x2 grid the order would be (0,0)->(0,1)->(1,0)->(1,1). The order follows the order * of the parametric coordinates of the coons patch. */ void draw(SkCanvas* canvas, SkPaint& paint); - + /** * Get the dimensions of the grid of patches. */ SkISize getDimensions() const { return SkISize::Make(fCols, fRows); } - + private: int fRows, fCols; VertexType fModeFlags; diff --git a/src/utils/SkPatchUtils.cpp b/src/utils/SkPatchUtils.cpp index 9d095ae5cf..cbaae39e8e 100644 --- a/src/utils/SkPatchUtils.cpp +++ b/src/utils/SkPatchUtils.cpp @@ -28,20 +28,20 @@ */ class FwDCubicEvaluator { - + public: - + /** * Receives the 4 control points of the cubic bezier. */ - + explicit FwDCubicEvaluator(const SkPoint points[4]) : fCoefs(points) { memcpy(fPoints, points, 4 * sizeof(SkPoint)); - + this->restart(1); } - + /** * Restarts the forward differences evaluator to the first value of t = 0. */ @@ -58,14 +58,14 @@ public: fFwDiff[1] = to_point(fCoefs.fA * h3 + fCoefs.fB * h2 + fCoefs.fC * h); fFwDiff[0] = to_point(fCoefs.fD); } - + /** * Check if the evaluator is still within the range of 0<=t<=1 */ bool done() const { return fCurrent > fMax; } - + /** * Call next to obtain the SkPoint sampled and move to the next one. */ @@ -77,11 +77,11 @@ public: fCurrent++; return point; } - + const SkPoint* getCtrlPoints() const { return fPoints; } - + private: SkCubicCoeff fCoefs; int fMax, fCurrent, fDivisions; @@ -115,29 +115,29 @@ static SkScalar bilerp(SkScalar tx, SkScalar ty, SkScalar c00, SkScalar c10, SkS } SkISize SkPatchUtils::GetLevelOfDetail(const SkPoint cubics[12], const SkMatrix* matrix) { - + // Approximate length of each cubic. SkPoint pts[kNumPtsCubic]; SkPatchUtils::getTopCubic(cubics, pts); matrix->mapPoints(pts, kNumPtsCubic); SkScalar topLength = approx_arc_length(pts, kNumPtsCubic); - + SkPatchUtils::getBottomCubic(cubics, pts); matrix->mapPoints(pts, kNumPtsCubic); SkScalar bottomLength = approx_arc_length(pts, kNumPtsCubic); - + SkPatchUtils::getLeftCubic(cubics, pts); matrix->mapPoints(pts, kNumPtsCubic); SkScalar leftLength = approx_arc_length(pts, kNumPtsCubic); - + SkPatchUtils::getRightCubic(cubics, pts); matrix->mapPoints(pts, kNumPtsCubic); SkScalar rightLength = approx_arc_length(pts, kNumPtsCubic); - + // Level of detail per axis, based on the larger side between top and bottom or left and right int lodX = static_cast(SkMaxScalar(topLength, bottomLength) / kPartitionSize); int lodY = static_cast(SkMaxScalar(leftLength, rightLength) / kPartitionSize); - + return SkISize::Make(SkMax32(8, lodX), SkMax32(8, lodY)); } @@ -210,12 +210,12 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c } data->fColors = new uint32_t[data->fVertexCount]; } - + // if texture coordinates are not null then create array for them if (texCoords) { data->fTexCoords = new SkPoint[data->fVertexCount]; } - + SkPoint pts[kNumPtsCubic]; SkPatchUtils::getBottomCubic(cubics, pts); FwDCubicEvaluator fBottom(pts); @@ -225,10 +225,10 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c FwDCubicEvaluator fLeft(pts); SkPatchUtils::getRightCubic(cubics, pts); FwDCubicEvaluator fRight(pts); - + fBottom.restart(lodX); fTop.restart(lodX); - + SkScalar u = 0.0f; int stride = lodY + 1; for (int x = 0; x <= lodX; x++) { @@ -238,9 +238,9 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c SkScalar v = 0.f; for (int y = 0; y <= lodY; y++) { int dataIndex = x * (lodY + 1) + y; - + SkPoint left = fLeft.next(), right = fRight.next(); - + SkPoint s0 = SkPoint::Make((1.0f - v) * top.x() + v * bottom.x(), (1.0f - v) * top.y() + v * bottom.y()); SkPoint s1 = SkPoint::Make((1.0f - u) * left.x() + u * right.x(), @@ -255,7 +255,7 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c + v * ((1.0f - u) * fBottom.getCtrlPoints()[0].y() + u * fBottom.getCtrlPoints()[3].y())); data->fPoints[dataIndex] = s0 + s1 - s2; - + if (colors) { uint8_t a = uint8_t(bilerp(u, v, SkScalar(SkColorGetA(colorsPM[kTopLeft_Corner])), @@ -279,7 +279,7 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c SkScalar(SkColorGetB(colorsPM[kBottomRight_Corner])))); data->fColors[dataIndex] = SkPackARGB32(a,r,g,b); } - + if (texCoords) { data->fTexCoords[dataIndex] = SkPoint::Make( bilerp(u, v, texCoords[kTopLeft_Corner].x(), @@ -290,9 +290,9 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c texCoords[kTopRight_Corner].y(), texCoords[kBottomLeft_Corner].y(), texCoords[kBottomRight_Corner].y())); - + } - + if(x < lodX && y < lodY) { int i = 6 * (x * lodY + y); data->fIndices[i] = x * stride + y; diff --git a/src/utils/SkPatchUtils.h b/src/utils/SkPatchUtils.h index 7c231f1a3b..67ab621e8e 100644 --- a/src/utils/SkPatchUtils.h +++ b/src/utils/SkPatchUtils.h @@ -12,7 +12,7 @@ #include "SkMatrix.h" class SK_API SkPatchUtils { - + public: /** * Structure that holds the vertex data related to the tessellation of a patch. It is passed @@ -25,7 +25,7 @@ public: SkPoint* fTexCoords; uint32_t* fColors; uint16_t* fIndices; - + VertexData() : fVertexCount(0) , fIndexCount(0) @@ -33,7 +33,7 @@ public: , fTexCoords(nullptr) , fColors(nullptr) , fIndices(nullptr) { } - + ~VertexData() { delete[] fPoints; delete[] fTexCoords; @@ -41,30 +41,30 @@ public: delete[] fIndices; } }; - + // Enums for control points based on the order specified in the constructor (clockwise). enum CubicCtrlPts { kTopP0_CubicCtrlPts = 0, kTopP1_CubicCtrlPts = 1, kTopP2_CubicCtrlPts = 2, kTopP3_CubicCtrlPts = 3, - + kRightP0_CubicCtrlPts = 3, kRightP1_CubicCtrlPts = 4, kRightP2_CubicCtrlPts = 5, kRightP3_CubicCtrlPts = 6, - + kBottomP0_CubicCtrlPts = 9, kBottomP1_CubicCtrlPts = 8, kBottomP2_CubicCtrlPts = 7, kBottomP3_CubicCtrlPts = 6, - + kLeftP0_CubicCtrlPts = 0, kLeftP1_CubicCtrlPts = 11, kLeftP2_CubicCtrlPts = 10, kLeftP3_CubicCtrlPts = 9, }; - + // Enum for corner also clockwise. enum Corner { kTopLeft_Corner = 0, @@ -72,45 +72,45 @@ public: kBottomRight_Corner, kBottomLeft_Corner }; - + enum { kNumCtrlPts = 12, kNumCorners = 4, kNumPtsCubic = 4 }; - + /** - * Method that calculates a level of detail (number of subdivisions) for a patch in both axis. + * Method that calculates a level of detail (number of subdivisions) for a patch in both axis. */ static SkISize GetLevelOfDetail(const SkPoint cubics[12], const SkMatrix* matrix); - + /** * Get the points corresponding to the top cubic of cubics. */ static void getTopCubic(const SkPoint cubics[12], SkPoint points[4]); - + /** * Get the points corresponding to the bottom cubic of cubics. */ static void getBottomCubic(const SkPoint cubics[12], SkPoint points[4]); - + /** * Get the points corresponding to the left cubic of cubics. */ static void getLeftCubic(const SkPoint cubics[12], SkPoint points[4]); - + /** * Get the points corresponding to the right cubic of cubics. */ static void getRightCubic(const SkPoint cubics[12], SkPoint points[4]); - + /** * Function that evaluates the coons patch interpolation. * data refers to the pointer of the PatchData struct in which the tessellation data is set. * cubics refers to the points of the cubics. * lod refers the level of detail for each axis. * colors refers to the corner colors that will be bilerp across the patch (optional parameter) - * texCoords refers to the corner texture coordinates that will be bilerp across the patch + * texCoords refers to the corner texture coordinates that will be bilerp across the patch (optional parameter) */ static bool getVertexData(SkPatchUtils::VertexData* data, const SkPoint cubics[12], diff --git a/src/utils/SkTextBox.cpp b/src/utils/SkTextBox.cpp index ba6ef53deb..d237f4513c 100644 --- a/src/utils/SkTextBox.cpp +++ b/src/utils/SkTextBox.cpp @@ -300,4 +300,3 @@ SkTextBlob* SkTextBox::snapshotTextBlob(SkScalar* computedBottom) const { } return (SkTextBlob*)visitor.fBuilder.build(); } - diff --git a/src/utils/SkTextureCompressor_ASTC.cpp b/src/utils/SkTextureCompressor_ASTC.cpp index a6e91d66b8..02f4f17144 100644 --- a/src/utils/SkTextureCompressor_ASTC.cpp +++ b/src/utils/SkTextureCompressor_ASTC.cpp @@ -217,7 +217,7 @@ static void compress_a8_astc_block(uint8_t** dst, const uint8_t* src, size_t row // - Single plane // - Low-precision index values // - Index range 0-7 (three bits per index) - // 2. Partitions: 0b00 + // 2. Partitions: 0b00 // - One partition // 3. Color Endpoint Mode: 0b0000 // - Direct luminance -- e0=(v0,v0,v0,0xFF); e1=(v1,v1,v1,0xFF); @@ -270,7 +270,7 @@ inline void CompressA8ASTCBlockVertical(uint8_t* dst, const uint8_t* src) { // //////////////////////////////////////////////////////////////////////////////// -// Enable this to assert whenever a decoded block has invalid ASTC values. Otherwise, +// Enable this to assert whenever a decoded block has invalid ASTC values. Otherwise, // each invalid block will result in a disgusting magenta color. #define ASSERT_ASTC_DECODE_ERROR 0 @@ -369,7 +369,7 @@ static uint64_t read_astc_bits(const ASTCBlock &block, int from, int to) { SkASSERT(nBits > (64 - from)); const int nLow = 64 - from; const int nHigh = nBits - nLow; - result = + result = ((block.fLow >> from) & ((1ULL << nLow) - 1)) | ((block.fHigh & ((1ULL << nHigh) - 1)) << nLow); } @@ -452,7 +452,7 @@ static inline void decode_rgba_basescale(const int *v, SkColor *endpoints, bool v4 = v[4]; v5 = v[5]; } - + endpoints[0] = SkColorSetARGB(v4, (v[0]*v[3]) >> 8, (v[1]*v[3]) >> 8, @@ -1256,7 +1256,7 @@ struct ASTCDecompressionData { case kLDR_LuminanceAlpha_Direct_ColorEndpointMode: { const int* v = colorValues; - + endpoints[i][0] = SkColorSetARGB(v[2], v[0], v[0], v[0]); endpoints[i][1] = SkColorSetARGB(v[3], v[1], v[1], v[1]); @@ -1272,7 +1272,7 @@ struct ASTCDecompressionData { bit_transfer_signed(&v1, &v0); bit_transfer_signed(&v3, &v2); - + endpoints[i][0] = SkColorSetARGB(v2, v0, v0, v0); endpoints[i][1] = SkColorSetARGB( clamp_byte(v3+v2), @@ -1669,7 +1669,7 @@ struct ASTCDecompressionData { this->decodeDualPlane(dualPlaneBitLoc); return; - } + } // If we have more than one partition, then we need to make // room for the partition index. @@ -1691,7 +1691,7 @@ struct ASTCDecompressionData { this->decodeDualPlane(dualPlaneBitLoc); return; - } + } // Move the dual plane selector bits down based on how many // partitions the block contains. @@ -1756,7 +1756,7 @@ struct ASTCDecompressionData { // Decodes the block mode. This function determines whether or not we use // dual plane encoding, the size of the texel weight grid, and the number of - // bits, trits and quints that are used to encode it. For more information, + // bits, trits and quints that are used to encode it. For more information, // see section C.2.10 of the ASTC spec. // // For 2D blocks, the Block Mode field is laid out as follows: diff --git a/src/utils/SkTextureCompressor_Blitter.h b/src/utils/SkTextureCompressor_Blitter.h index 0c259d692a..f488707a37 100644 --- a/src/utils/SkTextureCompressor_Blitter.h +++ b/src/utils/SkTextureCompressor_Blitter.h @@ -55,7 +55,7 @@ namespace SkTextureCompressor { // // most likely be implementation dependent. The mask variable will have // // 0xFF in positions where the block should be updated and 0 in positions // // where it shouldn't. src contains an uncompressed buffer of pixels. -// static void UpdateBlock(uint8_t* dst, const uint8_t* src, int srcRowBytes, +// static void UpdateBlock(uint8_t* dst, const uint8_t* src, int srcRowBytes, // const uint8_t* mask); #endif // }; @@ -65,7 +65,7 @@ public: SkTCompressedAlphaBlitter(int width, int height, void *compressedBuffer) // 0x7FFE is one minus the largest positive 16-bit int. We use it for // debugging to make sure that we're properly setting the nextX distance - // in flushRuns(). + // in flushRuns(). #ifdef SK_DEBUG : fCalledOnceWithNonzeroY(false) , fBlitMaskCalled(false), @@ -139,7 +139,7 @@ public: this->flushRuns(); } } - + // Blit a vertical run of pixels with a constant alpha value. void blitV(int x, int y, int height, SkAlpha alpha) override { // This function is currently not implemented. It is not explicitly @@ -171,7 +171,7 @@ public: // Make sure that we're only ever bracketing calls to blitAntiH. SkASSERT((0 == y) || (!fCalledOnceWithNonzeroY && (fCalledOnceWithNonzeroY = true))); - + #if !(PEDANTIC_BLIT_RECT) for (int i = 0; i < height; ++i) { const SkAlpha kFullAlpha = 0xFF; @@ -194,7 +194,7 @@ public: const int yoff = y - startBlockY; SkASSERT((yoff + height) <= BlockDim); - + for (int j = 0; j < height; ++j) { memset(mask + (j + yoff)*BlockDim + xoff, 0xFF, width); } @@ -493,7 +493,7 @@ private: // ----------------------------------------------------------------------- // ... | | | | | ----> fBufferedRuns[3] // ----------------------------------------------------------------------- - // + // // curX -- the macro X value that we've gotten to. // c[BlockDim] -- the buffers that represent the columns of the current block // that we're operating on diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp index 3ee6b2787b..50aaf0b275 100644 --- a/src/utils/SkTextureCompressor_LATC.cpp +++ b/src/utils/SkTextureCompressor_LATC.cpp @@ -81,7 +81,7 @@ typedef uint64_t (*A84x4To64BitProc)(const uint8_t block[]); // This function is used by both R11 EAC and LATC to compress 4x4 blocks // of 8-bit alpha into 64-bit values that comprise the compressed data. -// For both formats, we need to make sure that the dimensions of the +// For both formats, we need to make sure that the dimensions of the // src pixels are divisible by 4, and copy 4x4 blocks one at a time // for compression. static bool compress_4x4_a8_to_64bit(uint8_t* dst, const uint8_t* src, @@ -284,7 +284,7 @@ static uint64_t compress_latc_block(const uint8_t pixels[]) { if (nonExtremalPixels == nUniquePixels) { // This is really just for correctness, in all of my tests we // never take this step. We don't lose too much perf here because - // most of the processing in this function is worth it for the + // most of the processing in this function is worth it for the // 1 == nUniquePixels optimization. return compress_latc_block_bb(pixels); } else { @@ -320,7 +320,7 @@ static inline uint32_t pack_index(uint32_t x) { // Converts each 8-bit byte in the integer into an LATC index, and then packs // the indices into the low 12 bits of the integer. static inline uint32_t convert_index(uint32_t x) { - // Since the palette is + // Since the palette is // 255, 0, 219, 182, 146, 109, 73, 36 // we need to map the high three bits of each byte in the integer // from @@ -346,7 +346,7 @@ static inline uint32_t convert_index(uint32_t x) { // Mask out high bits: // 9 7 6 5 4 3 2 0 --> 1 7 6 5 4 3 2 0 x &= 0x07070707; - + return pack_index(x); } diff --git a/src/utils/SkTextureCompressor_R11EAC.cpp b/src/utils/SkTextureCompressor_R11EAC.cpp index 291820b4d7..5c298dda9a 100644 --- a/src/utils/SkTextureCompressor_R11EAC.cpp +++ b/src/utils/SkTextureCompressor_R11EAC.cpp @@ -235,7 +235,7 @@ static uint64_t compress_r11eac_block(const uint8_t block[16]) { // // this gives the following formula: // clamp[0, 2047](0*8+4+(-3)*2*8) = 0 - // + // // Furthermore, it is impervious to endianness: // 0x0020000000002000ULL // Will produce one pixel with index 2, which gives: @@ -244,7 +244,7 @@ static uint64_t compress_r11eac_block(const uint8_t block[16]) { // Fully opaque? We know this encoding too... case 255: - + // -1 produces the following: // basw_cw: 255 // mod: 15, palette: {-3, -5, -7, -9, 2, 4, 6, 8} @@ -410,7 +410,7 @@ static inline uint64_t interleave6(uint64_t topRows, uint64_t bottomRows) { x = swap_shift<36>(x, 0xFC0ULL); // x: 00 00 00 00 00 00 00 00 a e i m d h l p b f j n c g k o - + x = (x & (0xFFFULL << 36)) | ((x & 0xFFFFFFULL) << 12) | ((x >> 24) & 0xFFFULL); #endif @@ -498,13 +498,13 @@ static bool compress_a8_to_r11eac_fast(uint8_t* dst, const uint8_t* src, // the least significant 12 bits of the resulting integer. static inline uint32_t pack_indices_vertical(uint32_t x) { #if defined (SK_CPU_BENDIAN) - return + return (x & 7) | ((x >> 5) & (7 << 3)) | ((x >> 10) & (7 << 6)) | ((x >> 15) & (7 << 9)); #else - return + return ((x >> 24) & 7) | ((x >> 13) & (7 << 3)) | ((x >> 2) & (7 << 6)) | @@ -664,7 +664,7 @@ void DecompressR11EAC(uint8_t* dst, int dstRowBytes, const uint8_t* src, int wid src += 8; } dst += 4 * dstRowBytes; - } + } } } // namespace SkTextureCompressor diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp index 3fd9057c35..7f15ed7090 100644 --- a/src/utils/mac/SkCreateCGImageRef.cpp +++ b/src/utils/mac/SkCreateCGImageRef.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/win/SkAutoCoInitialize.cpp b/src/utils/win/SkAutoCoInitialize.cpp index 83f23bda0b..3b7b42b74f 100644 --- a/src/utils/win/SkAutoCoInitialize.cpp +++ b/src/utils/win/SkAutoCoInitialize.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp index fdb6ce6eff..ad9bf05076 100644 --- a/src/utils/win/SkIStream.cpp +++ b/src/utils/win/SkIStream.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/win/SkWGL.h b/src/utils/win/SkWGL.h index d502eb0aa7..5322d916b5 100644 --- a/src/utils/win/SkWGL.h +++ b/src/utils/win/SkWGL.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp index 5afcae94ce..65ffaf1ecf 100644 --- a/src/utils/win/SkWGL_win.cpp +++ b/src/utils/win/SkWGL_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/SkEvent.cpp b/src/views/SkEvent.cpp index b90d03f3d0..7b658c839a 100644 --- a/src/views/SkEvent.cpp +++ b/src/views/SkEvent.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/views/SkEventSink.cpp b/src/views/SkEventSink.cpp index 003bf8c4fe..1464fa0fac 100644 --- a/src/views/SkEventSink.cpp +++ b/src/views/SkEventSink.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/views/SkTagList.cpp b/src/views/SkTagList.cpp index b1d6ff64d3..27f3916ec6 100644 --- a/src/views/SkTagList.cpp +++ b/src/views/SkTagList.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/views/SkTagList.h b/src/views/SkTagList.h index 1cff9cabe2..0b158e1abe 100644 --- a/src/views/SkTagList.h +++ b/src/views/SkTagList.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/views/SkTouchGesture.cpp b/src/views/SkTouchGesture.cpp index 676f8e9a64..5fc8d7ee90 100644 --- a/src/views/SkTouchGesture.cpp +++ b/src/views/SkTouchGesture.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * diff --git a/src/views/SkViewPriv.cpp b/src/views/SkViewPriv.cpp index 03541fd7ad..7dbe5f1cae 100644 --- a/src/views/SkViewPriv.cpp +++ b/src/views/SkViewPriv.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/SkViewPriv.h b/src/views/SkViewPriv.h index 487e379471..3b7645712c 100644 --- a/src/views/SkViewPriv.h +++ b/src/views/SkViewPriv.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/mac/SkNSView.h b/src/views/mac/SkNSView.h index 4befaeea7e..779c51b7e4 100644 --- a/src/views/mac/SkNSView.h +++ b/src/views/mac/SkNSView.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/mac/SkOptionsTableView.h b/src/views/mac/SkOptionsTableView.h index 1f9b36a1b8..8fa03d1fc5 100644 --- a/src/views/mac/SkOptionsTableView.h +++ b/src/views/mac/SkOptionsTableView.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/mac/SkSampleNSView.h b/src/views/mac/SkSampleNSView.h index d3aca9a735..b7da9fd556 100644 --- a/src/views/mac/SkSampleNSView.h +++ b/src/views/mac/SkSampleNSView.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/mac/SkTextFieldCell.h b/src/views/mac/SkTextFieldCell.h index 93d0e4dedd..dfca7ae690 100644 --- a/src/views/mac/SkTextFieldCell.h +++ b/src/views/mac/SkTextFieldCell.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp index 7833bbe2c0..7f9d168cb8 100644 --- a/src/views/unix/SkOSWindow_Unix.cpp +++ b/src/views/unix/SkOSWindow_Unix.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/unix/XkeysToSkKeys.h b/src/views/unix/XkeysToSkKeys.h index 9cc9885db8..aced74c0af 100644 --- a/src/views/unix/XkeysToSkKeys.h +++ b/src/views/unix/XkeysToSkKeys.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/unix/keysym2ucs.h b/src/views/unix/keysym2ucs.h index 255a930539..0287f02ad9 100644 --- a/src/views/unix/keysym2ucs.h +++ b/src/views/unix/keysym2ucs.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp index ee851a104f..8b0211d64b 100644 --- a/src/views/win/SkOSWindow_win.cpp +++ b/src/views/win/SkOSWindow_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -557,7 +556,7 @@ bool SkOSWindow::attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info) fCommandBuffer = SkCommandBufferGLContext::Create((HWND)fHWND, msaaSampleCount); if (!fCommandBuffer) return false; - + SkAutoTUnref intf(GrGLCreateCommandBufferInterface()); if (intf) { COMMAND_BUFFER_GL_CALL(intf, ClearStencil(0)); @@ -736,7 +735,7 @@ bool SkOSWindow::makeFullscreen() { WindowRect.left = 0; WindowRect.right = kWidth; WindowRect.top = 0; - WindowRect.bottom = kHeight; + WindowRect.bottom = kHeight; ShowCursor(FALSE); AdjustWindowRectEx(&WindowRect, WS_POPUP, FALSE, WS_EX_APPWINDOW); HWND fsHWND = CreateWindowEx( diff --git a/src/views/win/skia_win.cpp b/src/views/win/skia_win.cpp index c15846da7a..8996ddac4d 100644 --- a/src/views/win/skia_win.cpp +++ b/src/views/win/skia_win.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -131,4 +130,3 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } return 0; } - diff --git a/src/xml/SkBML_Verbs.h b/src/xml/SkBML_Verbs.h index 709764d0d4..17c34588fd 100644 --- a/src/xml/SkBML_Verbs.h +++ b/src/xml/SkBML_Verbs.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/xml/SkBML_XMLParser.cpp b/src/xml/SkBML_XMLParser.cpp index 1314608137..31d5a99a65 100644 --- a/src/xml/SkBML_XMLParser.cpp +++ b/src/xml/SkBML_XMLParser.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/xml/SkDOM.cpp b/src/xml/SkDOM.cpp index 8b55f6c980..15b458e4fb 100644 --- a/src/xml/SkDOM.cpp +++ b/src/xml/SkDOM.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/xml/SkXMLParser.cpp b/src/xml/SkXMLParser.cpp index e28365634e..11f4c6bf72 100644 --- a/src/xml/SkXMLParser.cpp +++ b/src/xml/SkXMLParser.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * diff --git a/src/xml/SkXMLPullParser.cpp b/src/xml/SkXMLPullParser.cpp index 34ad282cc7..3e831a12ee 100644 --- a/src/xml/SkXMLPullParser.cpp +++ b/src/xml/SkXMLPullParser.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp index 1ea850688d..42c320cde1 100644 --- a/tests/AAClipTest.cpp +++ b/tests/AAClipTest.cpp @@ -334,7 +334,7 @@ static void test_really_a_rect(skiatest::Reporter* reporter) { // This rect should intersect the clip, but slice-out all of the "soft" parts, // leaving just a rect. const SkIRect ir = SkIRect::MakeLTRB(10, -10, 50, 90); - + clip.op(ir, SkRegion::kIntersect_Op); REPORTER_ASSERT(reporter, clip.getBounds() == SkIRect::MakeLTRB(10, 0, 50, 90)); diff --git a/tests/AnnotationTest.cpp b/tests/AnnotationTest.cpp index 4f904bdc42..d9d971a7a0 100644 --- a/tests/AnnotationTest.cpp +++ b/tests/AnnotationTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp index 5793284e26..216e04273f 100644 --- a/tests/BitmapCopyTest.cpp +++ b/tests/BitmapCopyTest.cpp @@ -608,7 +608,7 @@ DEF_TEST(BitmapReadPixels, reporter) { gRec[i].fRequestedDstSize.height()); bool success = srcBM.readPixels(dstInfo, dstPixels, rowBytes, gRec[i].fRequestedSrcLoc.x(), gRec[i].fRequestedSrcLoc.y()); - + REPORTER_ASSERT(reporter, gRec[i].fExpectedSuccess == success); if (success) { const SkIRect srcR = gRec[i].fExpectedSrcR; @@ -695,7 +695,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BitmapCopy_Texture, reporter, ctx) { refData = (kRGBA_8888_SkColorType == dstBmp.colorType()) ? kData : swizData; #elif defined(SK_PMCOLOR_IS_BGRA) refData = (kBGRA_8888_SkColorType == dstBmp.colorType()) ? kData : swizData; -#else +#else #error "PM Color must be BGRA or RGBA to use GPU backend." #endif bool foundError = false; diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index dc3d6c76e3..8c726e9136 100644 --- a/tests/BlurTest.cpp +++ b/tests/BlurTest.cpp @@ -559,7 +559,7 @@ DEF_TEST(BlurAsABlur, reporter) { #if SK_SUPPORT_GPU -// This exercises the problem discovered in crbug.com/570232. The return value from +// This exercises the problem discovered in crbug.com/570232. The return value from // SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlurEffect::Create DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctx) { diff --git a/tests/CachedDataTest.cpp b/tests/CachedDataTest.cpp index 6c44161707..25024806de 100644 --- a/tests/CachedDataTest.cpp +++ b/tests/CachedDataTest.cpp @@ -41,22 +41,22 @@ static SkCachedData* make_data(size_t size, SkDiscardableMemoryPool* pool) { static SkCachedData* test_locking(skiatest::Reporter* reporter, size_t size, SkDiscardableMemoryPool* pool) { SkCachedData* data = make_data(size, pool); - + memset(data->writable_data(), 0x80, size); // just to use writable_data() check_data(reporter, data, 1, kNotInCache, kLocked); - + data->ref(); check_data(reporter, data, 2, kNotInCache, kLocked); data->unref(); check_data(reporter, data, 1, kNotInCache, kLocked); - + data->attachToCacheAndRef(); check_data(reporter, data, 2, kInCache, kLocked); - + data->unref(); check_data(reporter, data, 1, kInCache, kUnlocked); - + data->ref(); check_data(reporter, data, 2, kInCache, kLocked); @@ -92,4 +92,3 @@ DEF_TEST(CachedData, reporter) { data->detachFromCacheAndUnref(); } } - diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 05ce60469b..02b875eb42 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -700,7 +700,7 @@ DEF_TEST(Canvas_SaveState, reporter) { n = canvas.saveLayer(nullptr, nullptr); REPORTER_ASSERT(reporter, 2 == n); REPORTER_ASSERT(reporter, 3 == canvas.getSaveCount()); - + canvas.restore(); REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount()); canvas.restore(); diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp index b5b9cae8ba..2f9e13de5f 100644 --- a/tests/ClipBoundsTest.cpp +++ b/tests/ClipBoundsTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp index be25dc35b5..bdb5e7792e 100644 --- a/tests/CodexTest.cpp +++ b/tests/CodexTest.cpp @@ -637,7 +637,7 @@ static void test_invalid_parameters(skiatest::Reporter* r, const char path[]) { return; } SkAutoTDelete decoder(SkCodec::NewFromStream(stream.release())); - + // This should return kSuccess because kIndex8 is supported. SkPMColor colorStorage[256]; int colorCount; diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp index 822fb0bd70..cf542db9fa 100644 --- a/tests/ColorFilterTest.cpp +++ b/tests/ColorFilterTest.cpp @@ -165,17 +165,17 @@ static void get_grayscale_matrix(float amount, float matrix[20]) { matrix[1] = 0.7152f - 0.7152f * amount; matrix[2] = 1.f - (matrix[0] + matrix[1]); matrix[3] = matrix[4] = 0.f; - + matrix[5] = 0.2126f - 0.2126f * amount; matrix[6] = 0.7152f + 0.2848f * amount; matrix[7] = 1.f - (matrix[5] + matrix[6]); matrix[8] = matrix[9] = 0.f; - + matrix[10] = 0.2126f - 0.2126f * amount; matrix[11] = 0.7152f - 0.7152f * amount; matrix[12] = 1.f - (matrix[10] + matrix[11]); matrix[13] = matrix[14] = 0.f; - + matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0.f; matrix[18] = 1.f; } diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp index a474019e92..03b80fb2af 100644 --- a/tests/DataRefTest.cpp +++ b/tests/DataRefTest.cpp @@ -271,7 +271,7 @@ static void check_alphabet_stream(skiatest::Reporter* reporter, SkStream* stream static void check_alphabet_buffer(skiatest::Reporter* reporter, const SkROBuffer* reader) { size_t size = reader->size(); REPORTER_ASSERT(reporter, size % 26 == 0); - + SkAutoTMalloc storage(size); SkROBuffer::Iter iter(reader); size_t offset = 0; diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 3a8d63cae9..a20b8a2efa 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -62,7 +62,7 @@ static const float kMaxIntegerRepresentableInSPFloatingPoint = 16777216; // 2 ^ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FloatingPointTextureTest, reporter, context) { runFPTest(reporter, context, FLT_MIN, FLT_MAX, FLT_EPSILON, - kMaxIntegerRepresentableInSPFloatingPoint, + kMaxIntegerRepresentableInSPFloatingPoint, FP_CONTROL_ARRAY_SIZE, kRGBA_float_GrPixelConfig); } diff --git a/tests/FontMgrAndroidParserTest.cpp b/tests/FontMgrAndroidParserTest.cpp index a56331e87f..5f6ff06fe8 100644 --- a/tests/FontMgrAndroidParserTest.cpp +++ b/tests/FontMgrAndroidParserTest.cpp @@ -213,4 +213,3 @@ DEF_TEST(FontMgrAndroidParser, reporter) { SkDebugf("---- Resource files missing for FontConfigParser test\n"); } } - diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 6b8efeb193..03938fbb93 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/tests/GeometryTest.cpp b/tests/GeometryTest.cpp index f89914fa74..17e4644857 100644 --- a/tests/GeometryTest.cpp +++ b/tests/GeometryTest.cpp @@ -58,7 +58,7 @@ static void test_evalquadat(skiatest::Reporter* reporter) { SkEvalQuadAt(pts, t, &r0); SkPoint r1 = SkEvalQuadAt(pts, t); check_pairs(reporter, i, t, "quad-pos", r0.fX, r0.fY, r1.fX, r1.fY); - + SkVector v0; SkEvalQuadAt(pts, t, nullptr, &v0); SkVector v1 = SkEvalQuadTangentAt(pts, t); diff --git a/tests/GpuColorFilterTest.cpp b/tests/GpuColorFilterTest.cpp index 714555a626..186f8c699f 100644 --- a/tests/GpuColorFilterTest.cpp +++ b/tests/GpuColorFilterTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/tests/GrDrawTargetTest.cpp b/tests/GrDrawTargetTest.cpp index bbc2b9146b..30fc0a24aa 100644 --- a/tests/GrDrawTargetTest.cpp +++ b/tests/GrDrawTargetTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index f738c97a94..54fcfc1d42 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -286,9 +286,9 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) } static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const GrCaps& caps) { GrPipelineOptimizations optimizations; - optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, + optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, false); - optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, + optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, true); SkASSERT(!optimizations.fColorPOI.isOpaque()); @@ -482,7 +482,7 @@ static void test_color_unknown_no_coverage(skiatest::Reporter* reporter, const G GrPipelineOptimizations optimizations; optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, GrColorPackRGBA(229, 0, 154, 0), kR_GrColorComponentFlag | kB_GrColorComponentFlag, false); - optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), + optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), kRGBA_GrColorComponentFlags, true); SkASSERT(!optimizations.fColorPOI.isOpaque()); @@ -684,9 +684,9 @@ static void test_color_unknown_no_coverage(skiatest::Reporter* reporter, const G static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const GrCaps& caps) { GrPipelineOptimizations optimizations; - optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), + optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), kA_GrColorComponentFlag, false); - optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, + optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, true); SkASSERT(optimizations.fColorPOI.isOpaque()); @@ -885,7 +885,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr GrPipelineOptimizations optimizations; optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, GrColorPackRGBA(0, 82, 0, 255), kG_GrColorComponentFlag | kA_GrColorComponentFlag, false); - optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), + optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), kRGBA_GrColorComponentFlags, true); SkASSERT(optimizations.fColorPOI.isOpaque()); @@ -1098,7 +1098,7 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const TestLCDCoverageBatch() : INHERITED(ClassID()) {} private: - void computePipelineOptimizations(GrInitInvariantOutput* color, + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { color->setKnownFourComponents(GrColorPackRGBA(123, 45, 67, 221)); @@ -1186,11 +1186,11 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) { for (size_t c = 0; c < SK_ARRAY_COUNT(testColors); c++) { GrPipelineOptimizations optimizations; - optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, testColors[c], testColorFlags[c], + optimizations.fColorPOI.calcWithInitialValues(nullptr, 0, testColors[c], testColorFlags[c], false); for (int f = 0; f <= 1; f++) { if (!f) { - optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, + optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, 0, kNone_GrColorComponentFlags, true); } else { optimizations.fCoveragePOI.calcWithInitialValues(nullptr, 0, GrColorPackA4(255), @@ -1217,4 +1217,3 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) { } #endif - diff --git a/tests/GrTRecorderTest.cpp b/tests/GrTRecorderTest.cpp index cef870fa90..0be0f68db9 100644 --- a/tests/GrTRecorderTest.cpp +++ b/tests/GrTRecorderTest.cpp @@ -40,7 +40,7 @@ static void test_empty_back_and_pop(skiatest::Reporter* reporter) { for (int i = 0; i < 100; ++i) { if (data) { - REPORTER_ASSERT(reporter, i == *GrNEW_APPEND_TO_RECORDER(recorder, + REPORTER_ASSERT(reporter, i == *GrNEW_APPEND_TO_RECORDER(recorder, IntWrapper, (i))); } else { REPORTER_ASSERT(reporter, i == diff --git a/tests/GradientTest.cpp b/tests/GradientTest.cpp index 0014089322..ac55d9934e 100644 --- a/tests/GradientTest.cpp +++ b/tests/GradientTest.cpp @@ -34,7 +34,7 @@ static void test_big_grad(skiatest::Reporter* reporter) { SkMatrix matrix; matrix.setAffine(affine); c.concat(matrix); - + c.drawPaint(paint); } diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp index 89d2f8d5dd..c2cf2d9999 100644 --- a/tests/ImageCacheTest.cpp +++ b/tests/ImageCacheTest.cpp @@ -32,7 +32,7 @@ struct TestingRec : public SkResourceCache::Rec { static bool Visitor(const SkResourceCache::Rec& baseRec, void* context) { const TestingRec& rec = static_cast(baseRec); intptr_t* result = (intptr_t*)context; - + *result = rec.fValue; return true; } diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp index 938c048386..89c6dcf6aa 100644 --- a/tests/ImageFilterCacheTest.cpp +++ b/tests/ImageFilterCacheTest.cpp @@ -233,4 +233,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, context test_explicit_purging(reporter, fullImg, subsetImg); } #endif - diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 8268f959b0..e4ab1ace07 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * @@ -567,7 +566,7 @@ static void run_gpu_test(skiatest::Reporter* reporter, SkAutoTUnref device(SkGpuDevice::Create(context, SkBudgeted::kNo, - SkImageInfo::MakeN32Premul(widthHeight, + SkImageInfo::MakeN32Premul(widthHeight, widthHeight), 0, &props, diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index f08613f22e..1399bf277f 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -93,10 +93,10 @@ static void test_set9(skiatest::Reporter* reporter) { SkMatrix m; m.reset(); assert9(reporter, m, 1, 0, 0, 0, 1, 0, 0, 0, 1); - + m.setScale(2, 3); assert9(reporter, m, 2, 0, 0, 0, 3, 0, 0, 0, 1); - + m.postTranslate(4, 5); assert9(reporter, m, 2, 0, 4, 0, 3, 5, 0, 0, 1); diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp index 854b3c56eb..e1f844e05c 100644 --- a/tests/MemsetTest.cpp +++ b/tests/MemsetTest.cpp @@ -22,7 +22,7 @@ static void* simple_alloc(skiatest::Reporter* reporter, SkChunkAlloc* alloc, siz REPORTER_ASSERT(reporter, alloc->contains(ptr)); return ptr; } - + static void test_chunkalloc(skiatest::Reporter* reporter) { static const size_t kMin = 1024; SkChunkAlloc alloc(kMin); diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index 0e92e65ba3..945c8a1aff 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -367,4 +367,3 @@ DEF_TEST(Paint_nothingToDraw, r) { paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat)); REPORTER_ASSERT(r, !paint.nothingToDraw()); } - diff --git a/tests/PathOpsBattles.cpp b/tests/PathOpsBattles.cpp index 6e0d3a4177..32ba96c2b8 100644 --- a/tests/PathOpsBattles.cpp +++ b/tests/PathOpsBattles.cpp @@ -400,7 +400,7 @@ path.close(); SkPath path2(path); testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } -// ../../third_party/tcmalloc/chromium/src/free_list.h:118] Memory corruption detected. +// ../../third_party/tcmalloc/chromium/src/free_list.h:118] Memory corruption detected. static void battleOp13(skiatest::Reporter* reporter, const char* filename) { SkPath path; diff --git a/tests/PathOpsBuilderConicTest.cpp b/tests/PathOpsBuilderConicTest.cpp index 6bb5c70d36..65adcf04ff 100644 --- a/tests/PathOpsBuilderConicTest.cpp +++ b/tests/PathOpsBuilderConicTest.cpp @@ -111,7 +111,7 @@ DEF_TEST(SixtyOvals, reporter) { } } setupOne(reporter, col, row, rot, trial); - skipTest: + skipTest: ; } } @@ -403,7 +403,7 @@ path.close(); path.moveTo(306.588f, -227.984f); path.conicTo(212.465f, -262.242f, 95.5512f, 58.9764f, 0.707107f); path.lineTo(306.588f, -227.984f); -path.close(); +path.close(); testSimplify(reporter, path, __FUNCTION__); } diff --git a/tests/PathOpsConicIntersectionTest.cpp b/tests/PathOpsConicIntersectionTest.cpp index 889a41cc9d..624a68adaf 100644 --- a/tests/PathOpsConicIntersectionTest.cpp +++ b/tests/PathOpsConicIntersectionTest.cpp @@ -13,7 +13,7 @@ manually compute the intersection of a pair of circles and see if the conic intersection matches given two circles construct a line connecting their centers - + */ static const SkDConic testSet[] = { @@ -21,10 +21,10 @@ static const SkDConic testSet[] = { {{{{377.218994,-141.981003}, {40.578701,-201.339996}, {23.1854992,-102.697998}}}, 0.707107008f}, {{{{5.1114602088928223, 628.77813720703125}, - {10.834027290344238, 988.964111328125}, + {10.834027290344238, 988.964111328125}, {163.40835571289062, 988.964111328125}}}, 0.72944212f}, - {{{{163.40835571289062, 988.964111328125}, - {5, 988.964111328125}, + {{{{163.40835571289062, 988.964111328125}, + {5, 988.964111328125}, {5, 614.7423095703125}}}, 0.707106769f}, {{{{11.17222976684570312, -8.103978157043457031}, @@ -116,8 +116,8 @@ static void writePng(const SkConic& c, const SkConic ch[2], const char* name) { static void writeDPng(const SkDConic& dC, const char* name) { const int scale = 5; - SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, - {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, + SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, + {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, {dC.fPts[2].fX * scale, dC.fPts[2].fY * scale }}}, dC.fWeight }; SkBitmap bitmap; SkDRect bounds; @@ -226,7 +226,7 @@ const SkDConic frame6[] = { }; const SkDConic* frames[] = { - frame0, frame1, frame2, frame3, frame4, frame5, frame6 + frame0, frame1, frame2, frame3, frame4, frame5, frame6 }; const int frameSizes[] = { (int) SK_ARRAY_COUNT(frame0), (int) SK_ARRAY_COUNT(frame1), @@ -244,8 +244,8 @@ static void writeFrames() { int frameSize = frameSizes[index]; for (int fIndex = 0; fIndex < frameSize; ++fIndex) { const SkDConic& dC = frames[index][fIndex]; - SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, - {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, + SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, + {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, {dC.fPts[2].fX * scale, dC.fPts[2].fY * scale }}}, dC.fWeight }; SkDRect dBounds; dBounds.setBounds(dConic); @@ -273,8 +273,8 @@ static void writeFrames() { canvas.drawColor(SK_ColorWHITE); for (int fIndex = 0; fIndex < frameSize; ++fIndex) { const SkDConic& dC = frames[index][fIndex]; - SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, - {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, + SkDConic dConic = {{{ {dC.fPts[0].fX * scale, dC.fPts[0].fY * scale }, + {dC.fPts[1].fX * scale, dC.fPts[1].fY * scale }, {dC.fPts[2].fX * scale, dC.fPts[2].fY * scale }}}, dC.fWeight }; SkPath path; path.moveTo(dConic.fPts[0].asSkPoint()); diff --git a/tests/PathOpsConicLineIntersectionTest.cpp b/tests/PathOpsConicLineIntersectionTest.cpp index 2a958edf67..62195060e9 100644 --- a/tests/PathOpsConicLineIntersectionTest.cpp +++ b/tests/PathOpsConicLineIntersectionTest.cpp @@ -21,7 +21,7 @@ static struct lineConic { { {{{{30.6499996,25.6499996}, {30.6499996,20.6499996}, {25.6499996,20.6499996}}}, 0.707107008f}, {{{25.6499996,20.6499996}, {45.6500015,20.6499996}}}, - 1, + 1, {{25.6499996,20.6499996}, {0,0}} }, }; @@ -100,7 +100,7 @@ DEF_TEST(PathOpsConicLineIntersection, reporter) { const SkDLine& line = lineConicTests[index].line; SkASSERT(ValidLine(line)); SkReduceOrder reducer; - SkPoint pts[3] = { conic.fPts.fPts[0].asSkPoint(), conic.fPts.fPts[1].asSkPoint(), + SkPoint pts[3] = { conic.fPts.fPts[0].asSkPoint(), conic.fPts.fPts[1].asSkPoint(), conic.fPts.fPts[2].asSkPoint() }; SkPoint reduced[3]; SkPath::Verb order1 = SkReduceOrder::Conic(pts, conic.fWeight, reduced); diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp index 7de910cf6f..1443198bc8 100644 --- a/tests/PathOpsOpTest.cpp +++ b/tests/PathOpsOpTest.cpp @@ -3846,7 +3846,7 @@ static void cubicOp130(skiatest::Reporter* reporter, const char* filename) { static void complex_to_quads(const SkPoint pts[], SkPath* path) { SkScalar loopT; if (SkDCubic::ComplexBreak(pts, &loopT)) { - SkPoint cubicPair[7]; + SkPoint cubicPair[7]; SkChopCubicAt(pts, cubicPair, loopT); SkDCubic c1, c2; c1.set(cubicPair); diff --git a/tests/PathOpsTSectDebug.h b/tests/PathOpsTSectDebug.h index 68ef4b7db1..4e04db794b 100644 --- a/tests/PathOpsTSectDebug.h +++ b/tests/PathOpsTSectDebug.h @@ -195,7 +195,7 @@ void SkTSpan::dumpBounds() const { dumpID(); SkDebugf(" bounds=(%1.9g,%1.9g, %1.9g,%1.9g) boundsMax=%1.9g%s\n", fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom, fBoundsMax, - fCollapsed ? " collapsed" : ""); + fCollapsed ? " collapsed" : ""); } template diff --git a/tests/PathOpsTestCommon.cpp b/tests/PathOpsTestCommon.cpp index f6852254c0..8cc8fe879d 100644 --- a/tests/PathOpsTestCommon.cpp +++ b/tests/PathOpsTestCommon.cpp @@ -237,7 +237,7 @@ void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath) { lo = hi; } break; - } + } case SkPath::kClose_Verb: simplePath->close(); break; diff --git a/tests/Point3Test.cpp b/tests/Point3Test.cpp index bf3b90270c..2dedd6b005 100644 --- a/tests/Point3Test.cpp +++ b/tests/Point3Test.cpp @@ -76,7 +76,7 @@ static void test_dot(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dot, SK_ScalarRoot2Over2)); } -static void test_length(skiatest::Reporter* reporter, +static void test_length(skiatest::Reporter* reporter, SkScalar x, SkScalar y, SkScalar z, SkScalar expectedLen) { SkPoint3 point = SkPoint3::Make(x, y, z); @@ -115,7 +115,7 @@ DEF_TEST(Point3, reporter) { SkScalar fX; SkScalar fY; SkScalar fZ; - SkScalar fLength; + SkScalar fLength; } gRec[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, { 0.3f, 0.4f, 0.5f, SK_ScalarRoot2Over2 }, diff --git a/tests/PointTest.cpp b/tests/PointTest.cpp index 84ea865827..c0d1f26086 100644 --- a/tests/PointTest.cpp +++ b/tests/PointTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/tests/PremulAlphaRoundTripTest.cpp b/tests/PremulAlphaRoundTripTest.cpp index e0060d62de..5cc7a493c6 100644 --- a/tests/PremulAlphaRoundTripTest.cpp +++ b/tests/PremulAlphaRoundTripTest.cpp @@ -114,4 +114,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, context) test_premul_alpha_roundtrip(reporter, device); } #endif - diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 922b4fd892..52210f2375 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp index b538fc8c9b..e6552108b5 100644 --- a/tests/ReadPixelsTest.cpp +++ b/tests/ReadPixelsTest.cpp @@ -52,7 +52,7 @@ static SkPMColor get_src_color(int x, int y) { } return SkPremultiplyARGBInline(a, r, g, b); } - + static SkPMColor get_dst_bmp_init_color(int x, int y, int w) { int n = y * w + x; diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp index 73c6647686..fe11106a65 100644 --- a/tests/RecordReplaceDrawTest.cpp +++ b/tests/RecordReplaceDrawTest.cpp @@ -137,7 +137,7 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool doReplace if (doReplace) { REPORTER_ASSERT(r, 0 == numLayers); } else { - REPORTER_ASSERT(r, 1 == numLayers); + REPORTER_ASSERT(r, 1 == numLayers); } } diff --git a/tests/RecordTest.cpp b/tests/RecordTest.cpp index 1b4077cce8..a67d7e8a2a 100644 --- a/tests/RecordTest.cpp +++ b/tests/RecordTest.cpp @@ -116,4 +116,3 @@ DEF_TEST(Record_Alignment, r) { REPORTER_ASSERT(r, is_aligned(record.alloc())); } } - diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index 2943c258ea..114207d2fe 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -137,7 +137,7 @@ static void test_clear(skiatest::Reporter* reporter, GrContext* context, } } -DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RectangleTexture, reporter, context, glContext) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RectangleTexture, reporter, context, glContext) { static const int kWidth = 13; static const int kHeight = 13; diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp index af30f86148..f3ba657182 100644 --- a/tests/RefDictTest.cpp +++ b/tests/RefDictTest.cpp @@ -10,7 +10,7 @@ class TestRC : public SkRefCnt { public: - + private: typedef SkRefCnt INHERITED; }; diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp index 02dad22e08..37f5318d30 100644 --- a/tests/RoundRectTest.cpp +++ b/tests/RoundRectTest.cpp @@ -693,7 +693,7 @@ static void test_round_rect_transform(skiatest::Reporter* reporter) { } } -// Test out the case where an oval already off in space is translated/scaled +// Test out the case where an oval already off in space is translated/scaled // further off into space - yielding numerical issues when the rect & radii // are transformed separatly // BUG=skia:2696 @@ -715,9 +715,9 @@ static void test_issue_2696(skiatest::Reporter* reporter) { SkScalar halfHeight = SkScalarHalf(dst.height()); for (int i = 0; i < 4; ++i) { - REPORTER_ASSERT(reporter, + REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner)i).fX, halfWidth)); - REPORTER_ASSERT(reporter, + REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner)i).fY, halfHeight)); } } diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index f8d6ea4297..f6b1275f00 100644 --- a/tests/SerializationTest.cpp +++ b/tests/SerializationTest.cpp @@ -293,7 +293,7 @@ static void TestColorFilterSerialization(skiatest::Reporter* reporter) { static SkBitmap draw_picture(SkPicture& picture) { SkBitmap bitmap; - bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()), + bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()), SkScalarCeilToInt(picture.cullRect().height())); SkCanvas canvas(bitmap); picture.playback(&canvas); @@ -333,8 +333,8 @@ static void serialize_and_compare_typeface(SkTypeface* typeface, const char* tex // Paint some text. SkPictureRecorder recorder; SkIRect canvasRect = SkIRect::MakeWH(kBitmapSize, kBitmapSize); - SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(canvasRect.width()), - SkIntToScalar(canvasRect.height()), + SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(canvasRect.width()), + SkIntToScalar(canvasRect.height()), nullptr, 0); canvas->drawColor(SK_ColorWHITE); canvas->drawText(text, 2, 24, 32, paint); @@ -599,17 +599,17 @@ protected: DEF_TEST(Annotations, reporter) { SkPictureRecorder recorder; SkCanvas* recordingCanvas = recorder.beginRecording(SkRect::MakeWH(100, 100)); - + const char* str0 = "rect-with-url"; const SkRect r0 = SkRect::MakeWH(10, 10); SkAutoTUnref d0(SkData::NewWithCString(str0)); SkAnnotateRectWithURL(recordingCanvas, r0, d0); - + const char* str1 = "named-destination"; const SkRect r1 = SkRect::MakeXYWH(5, 5, 0, 0); // collapsed to a point SkAutoTUnref d1(SkData::NewWithCString(str1)); SkAnnotateNamedDestination(recordingCanvas, {r1.x(), r1.y()}, d1); - + const char* str2 = "link-to-destination"; const SkRect r2 = SkRect::MakeXYWH(20, 20, 5, 6); SkAutoTUnref d2(SkData::NewWithCString(str2)); @@ -627,4 +627,3 @@ DEF_TEST(Annotations, reporter) { TestAnnotationCanvas canvas(reporter, recs, SK_ARRAY_COUNT(recs)); canvas.drawPicture(pict1); } - diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index bd07115dbf..770810a1c8 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -43,7 +43,7 @@ static SkBitmap create_bm() { p.setAntiAlias(false); temp.drawRect(SkRect::MakeXYWH(SkIntToScalar(kPad), SkIntToScalar(kPad), - SkIntToScalar(kSmallerSize), SkIntToScalar(kSmallerSize)), + SkIntToScalar(kSmallerSize), SkIntToScalar(kSmallerSize)), p); return bm; @@ -292,7 +292,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, context) { { sk_sp subSImg1(SkSpecialImage::MakeFromGpu( - nullptr, subset, + nullptr, subset, kNeedNewImageUniqueID_SpecialImage, texture)); test_image(subSImg1, reporter, false, true, kPad, kFullSize); diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp index a3df8d71bb..fe4da0f5fb 100644 --- a/tests/StreamTest.cpp +++ b/tests/StreamTest.cpp @@ -283,9 +283,9 @@ static void test_peeking_front_buffered_stream(skiatest::Reporter* r, } } -// This test uses file system operations that don't work out of the -// box on iOS. It's likely that we don't need them on iOS. Ignoring for now. -// TODO(stephana): Re-evaluate if we need this in the future. +// This test uses file system operations that don't work out of the +// box on iOS. It's likely that we don't need them on iOS. Ignoring for now. +// TODO(stephana): Re-evaluate if we need this in the future. #ifndef SK_BUILD_FOR_IOS DEF_TEST(StreamPeek, reporter) { // Test a memory stream. @@ -434,4 +434,3 @@ DEF_TEST(StreamEmptyStreamMemoryBase, r) { SkAutoTDelete asset(tmp.detachAsStream()); REPORTER_ASSERT(r, nullptr == asset->getMemoryBase()); } - diff --git a/tests/SubsetPath.h b/tests/SubsetPath.h index 65067d1b0b..9e4d2316aa 100644 --- a/tests/SubsetPath.h +++ b/tests/SubsetPath.h @@ -11,15 +11,15 @@ #include "SkTDArray.h" /* Given a path, generate a the desired minimal subset of the original. - + This does a binary divide-and-conquer on the path, first splitting by contours, and then by verbs. The caller passes whether the previous subset behaved the same as the original. If not, the subset() call restores the prior state before returning a new subset. - + If a path fails a local test, this reduces the data to the minimal set that fails using a pattern like: - + bool testFailed = true; SkPath minimal; SubsetContours subsetContours(testPath); diff --git a/tests/Test.h b/tests/Test.h index 411ce11c20..4b19a85c1d 100644 --- a/tests/Test.h +++ b/tests/Test.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp index 2c303a74ce..890042e19d 100644 --- a/tests/TestTest.cpp +++ b/tests/TestTest.cpp @@ -72,4 +72,3 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuGrContextAndGLContext, reporter, context, gl REPORTER_ASSERT(reporter, glContext); } #endif - diff --git a/tests/TextureCompressionTest.cpp b/tests/TextureCompressionTest.cpp index 09086605a5..e1992a0359 100644 --- a/tests/TextureCompressionTest.cpp +++ b/tests/TextureCompressionTest.cpp @@ -58,7 +58,7 @@ DEF_TEST(CompressAlphaFailDimensions, reporter) { SkAutoPixmapStorage pixmap; pixmap.alloc(SkImageInfo::MakeA8(kWidth, kHeight)); // leaving the pixels uninitialized, as they don't affect the test... - + for (int i = 0; i < SkTextureCompressor::kFormatCnt; ++i) { const SkTextureCompressor::Format fmt = static_cast(i); if (!compresses_a8(fmt)) { diff --git a/tests/TopoSortTest.cpp b/tests/TopoSortTest.cpp index 358cd8dbad..9cee4853e0 100644 --- a/tests/TopoSortTest.cpp +++ b/tests/TopoSortTest.cpp @@ -121,7 +121,7 @@ DEF_TEST(TopoSort, reporter) { for (size_t i = 0; i < SK_ARRAY_COUNT(tests); ++i) { SkTDArray graph; - + (tests[i].fCreate)(&graph); sk_tool_utils::TopoTestNode::Shuffle(&graph, &rand); @@ -139,4 +139,3 @@ DEF_TEST(TopoSort, reporter) { sk_tool_utils::TopoTestNode::DeallocNodes(&graph); } } - diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp index c431abc5c3..b38bb9f90b 100644 --- a/tests/UtilsTest.cpp +++ b/tests/UtilsTest.cpp @@ -14,7 +14,7 @@ class RefClass : public SkRefCnt { public: - + RefClass(int n) : fN(n) {} int get() const { return fN; } diff --git a/tests/VkClearTests.cpp b/tests/VkClearTests.cpp index 586d7e7728..7cca4e4a5a 100644 --- a/tests/VkClearTests.cpp +++ b/tests/VkClearTests.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/tests/VkUploadPixelsTests.cpp b/tests/VkUploadPixelsTests.cpp index 9fc495265d..53d9cfcadc 100644 --- a/tests/VkUploadPixelsTests.cpp +++ b/tests/VkUploadPixelsTests.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp index fe954fa2c2..472664bd97 100755 --- a/tests/VkWrapTests.cpp +++ b/tests/VkWrapTests.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp index 67896f0dec..5c24259a62 100644 --- a/tests/Writer32Test.cpp +++ b/tests/Writer32Test.cpp @@ -288,14 +288,14 @@ DEF_TEST(Writer32_data, reporter) { SkWriter32::WriteDataSize(data0), SkWriter32::WriteDataSize(data1), }; - + SkSWriter32<1000> writer; size_t sizeWritten = 0; writer.writeData(nullptr); sizeWritten += sizes[0]; REPORTER_ASSERT(reporter, sizeWritten == writer.bytesWritten()); - + writer.writeData(data0); sizeWritten += sizes[1]; REPORTER_ASSERT(reporter, sizeWritten == writer.bytesWritten()); @@ -315,7 +315,7 @@ DEF_TEST(Writer32_data, reporter) { REPORTER_ASSERT(reporter, strlen(str)+1 == d1->size()); REPORTER_ASSERT(reporter, !memcmp(str, d1->data(), strlen(str)+1)); REPORTER_ASSERT(reporter, 0 == d2->size()); - + REPORTER_ASSERT(reporter, reader.offset() == sizeWritten); REPORTER_ASSERT(reporter, reader.eof()); } diff --git a/third_party/ktx/ktx.cpp b/third_party/ktx/ktx.cpp index f7451e822e..32985eb374 100644 --- a/third_party/ktx/ktx.cpp +++ b/third_party/ktx/ktx.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * @@ -328,7 +327,7 @@ bool SkKTXFile::readKTXFile(const uint8_t* data, size_t dataLen) { } } } - + uint32_t imgSizePadded = (imgSize + 3) & ~3; buf += imgSizePadded; bytesLeft -= imgSizePadded; @@ -380,7 +379,7 @@ bool SkKTXFile::WriteETC1ToKTX(SkWStream* stream, const uint8_t *etc1Data, if (!stream->write(&kKTX_ENDIANNESS_CODE, 4)) { return false; } - + Header hdr; hdr.fGLType = 0; hdr.fGLTypeSize = 1; @@ -554,6 +553,6 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) { rowPtr += bitmap.rowBytes(); } } - + return true; } diff --git a/third_party/ktx/ktx.h b/third_party/ktx/ktx.h index 1114b49bf9..889d5aaf87 100644 --- a/third_party/ktx/ktx.h +++ b/third_party/ktx/ktx.h @@ -1,4 +1,3 @@ - /* * Copyright 2014 Google Inc. * diff --git a/third_party/libsdl/linux/SDL_config.h b/third_party/libsdl/linux/SDL_config.h index 425e1f8817..ab7b82c7dc 100644 --- a/third_party/libsdl/linux/SDL_config.h +++ b/third_party/libsdl/linux/SDL_config.h @@ -34,7 +34,7 @@ /* Make sure that this isn't included by Visual C++ */ #ifdef _MSC_VER -#error You should run hg revert SDL_config.h +#error You should run hg revert SDL_config.h #endif /* C language features */ diff --git a/third_party/libsdl/mac/SDL_config.h b/third_party/libsdl/mac/SDL_config.h index ea06bc1e3c..27ab73a22d 100644 --- a/third_party/libsdl/mac/SDL_config.h +++ b/third_party/libsdl/mac/SDL_config.h @@ -34,7 +34,7 @@ /* Make sure that this isn't included by Visual C++ */ #ifdef _MSC_VER -#error You should run hg revert SDL_config.h +#error You should run hg revert SDL_config.h #endif /* C language features */ diff --git a/third_party/lua/src/lauxlib.h b/third_party/lua/src/lauxlib.h index ac4d15fbb9..1ab0d485e6 100644 --- a/third_party/lua/src/lauxlib.h +++ b/third_party/lua/src/lauxlib.h @@ -208,5 +208,3 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, #endif - - diff --git a/third_party/lua/src/lctype.h b/third_party/lua/src/lctype.h index 99c7d12237..8c2d56a6f5 100644 --- a/third_party/lua/src/lctype.h +++ b/third_party/lua/src/lctype.h @@ -92,4 +92,3 @@ LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2]; #endif /* } */ #endif - diff --git a/third_party/lua/src/ldo.h b/third_party/lua/src/ldo.h index 27b837d999..3bae88eaf7 100644 --- a/third_party/lua/src/ldo.h +++ b/third_party/lua/src/ldo.h @@ -43,4 +43,3 @@ LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); #endif - diff --git a/third_party/lua/src/lmem.h b/third_party/lua/src/lmem.h index 5f850999a9..2ac8ac037d 100644 --- a/third_party/lua/src/lmem.h +++ b/third_party/lua/src/lmem.h @@ -54,4 +54,3 @@ LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, const char *what); #endif - diff --git a/third_party/lua/src/lobject.h b/third_party/lua/src/lobject.h index dd23b9143c..d7fc86cc85 100644 --- a/third_party/lua/src/lobject.h +++ b/third_party/lua/src/lobject.h @@ -604,4 +604,3 @@ LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); #endif - diff --git a/third_party/lua/src/lstate.h b/third_party/lua/src/lstate.h index c8a31f5c0b..3b7b2a1081 100644 --- a/third_party/lua/src/lstate.h +++ b/third_party/lua/src/lstate.h @@ -225,4 +225,3 @@ LUAI_FUNC void luaE_freeCI (lua_State *L); #endif - diff --git a/third_party/lua/src/luaconf.h b/third_party/lua/src/luaconf.h index df802c9526..4568d87ce4 100644 --- a/third_party/lua/src/luaconf.h +++ b/third_party/lua/src/luaconf.h @@ -548,4 +548,3 @@ #endif - diff --git a/tools/VisualBench/VisualBench.cpp b/tools/VisualBench/VisualBench.cpp index cbd1abe97b..578ff92e3d 100644 --- a/tools/VisualBench/VisualBench.cpp +++ b/tools/VisualBench/VisualBench.cpp @@ -192,4 +192,3 @@ void application_term() { SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { return new VisualBench(hwnd, argc, argv); } - diff --git a/tools/VisualBench/VisualInteractiveModule.cpp b/tools/VisualBench/VisualInteractiveModule.cpp index 986709af99..898315e852 100755 --- a/tools/VisualBench/VisualInteractiveModule.cpp +++ b/tools/VisualBench/VisualInteractiveModule.cpp @@ -41,7 +41,7 @@ void VisualInteractiveModule::drawStats(SkCanvas* canvas) { canvas->drawRect(rect, paint); // draw the 16ms line paint.setColor(SK_ColorLTGRAY); - canvas->drawLine(rect.fLeft, rect.fBottom - kBaseMS*kPixelPerMS, + canvas->drawLine(rect.fLeft, rect.fBottom - kBaseMS*kPixelPerMS, rect.fRight, rect.fBottom - kBaseMS*kPixelPerMS, paint); paint.setColor(SK_ColorRED); paint.setStyle(SkPaint::kStroke_Style); @@ -53,7 +53,7 @@ void VisualInteractiveModule::drawStats(SkCanvas* canvas) { int i = fCurrentMeasurement; do { int endY = startY - (int)(fMeasurements[i] * kPixelPerMS + 0.5); // round to nearest value - canvas->drawLine(SkIntToScalar(x), SkIntToScalar(startY), + canvas->drawLine(SkIntToScalar(x), SkIntToScalar(startY), SkIntToScalar(x), SkIntToScalar(endY), paint); i++; i &= (kMeasurementCount - 1); // fast mod diff --git a/tools/android/SkAndroidSDKCanvas.cpp b/tools/android/SkAndroidSDKCanvas.cpp index d31f93b671..c1a40f4766 100644 --- a/tools/android/SkAndroidSDKCanvas.cpp +++ b/tools/android/SkAndroidSDKCanvas.cpp @@ -300,7 +300,7 @@ bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { SkASSERT(pmap); SkImageInfo info; - size_t rowBytes; + size_t rowBytes; const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, nullptr); if (addr) { pmap->reset(info, addr, rowBytes); @@ -355,5 +355,3 @@ void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { } void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } - - diff --git a/tools/android/SkAndroidSDKCanvas.h b/tools/android/SkAndroidSDKCanvas.h index 812775f185..78cfa93dcd 100644 --- a/tools/android/SkAndroidSDKCanvas.h +++ b/tools/android/SkAndroidSDKCanvas.h @@ -107,4 +107,3 @@ protected: }; #endif // SkAndroidSDKCanvas_DEFINED - diff --git a/tools/chrome_fuzz.cpp b/tools/chrome_fuzz.cpp index f49e12693b..c59c741599 100644 --- a/tools/chrome_fuzz.cpp +++ b/tools/chrome_fuzz.cpp @@ -79,4 +79,3 @@ int main(int argc, char** argv) { SkDebugf("#EOF\n"); return ret; } - diff --git a/tools/create_test_font.cpp b/tools/create_test_font.cpp index 1de08ac038..5183981d13 100644 --- a/tools/create_test_font.cpp +++ b/tools/create_test_font.cpp @@ -255,7 +255,7 @@ static void output_font(SkTypeface* face, const char* name, SkTypeface::Style st } } fprintf(out, "\n};\n\n"); - + // all fonts are now 0x00, 0x20 - 0xFE // don't need to generate or output character codes? fprintf(out, "const unsigned %sCharCodes[] = {\n", fontname); @@ -275,7 +275,7 @@ static void output_font(SkTypeface* face, const char* name, SkTypeface::Style st } } fprintf(out, "\n};\n\n"); - + SkString widthsStr; fprintf(out, "const SkFixed %sWidths[] = {\n", fontname); for (int index = 0; index < offsetCount; ++index) { @@ -283,7 +283,7 @@ static void output_font(SkTypeface* face, const char* name, SkTypeface::Style st } widthsStr = strip_final(widthsStr); fprintf(out, "%s\n};\n\n", widthsStr.c_str()); - + fprintf(out, "const int %sCharCodesCount = (int) SK_ARRAY_COUNT(%sCharCodes);\n\n", fontname, fontname); diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp index 4c58b96608..cf3da5d21b 100644 --- a/tools/debugger/SkDebugCanvas.cpp +++ b/tools/debugger/SkDebugCanvas.cpp @@ -218,13 +218,13 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) { if (fPaintFilterCanvas) { fPaintFilterCanvas->addCanvas(canvas); canvas = fPaintFilterCanvas.get(); - + } if (fMegaVizMode) { this->markActiveCommands(index); } - + #if SK_SUPPORT_GPU // If we have a GPU backend we can also visualize the batching information GrAuditTrail* at = nullptr; @@ -237,7 +237,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) { if (i == index && fFilter) { canvas->clear(0xAAFFFFFF); } - + #if SK_SUPPORT_GPU GrAuditTrail::AutoCollectBatches* acb = nullptr; if (at) { @@ -457,7 +457,7 @@ void SkDebugCanvas::cleanupAuditTrail(SkCanvas* canvas) { Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanvas* canvas) { this->drawAndCollectBatches(n, canvas); - + // now collect json #if SK_SUPPORT_GPU GrAuditTrail* at = this->getAuditTrail(canvas); diff --git a/tools/debugger/SkDebugCanvas.h b/tools/debugger/SkDebugCanvas.h index fa02874779..47aaf75572 100644 --- a/tools/debugger/SkDebugCanvas.h +++ b/tools/debugger/SkDebugCanvas.h @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -44,8 +43,8 @@ public: void setClipVizColor(SkColor clipVizColor) { this->fClipVizColor = clipVizColor; } SkColor getClipVizColor() const { return fClipVizColor; } - void setDrawGpuBatchBounds(bool drawGpuBatchBounds) { - fDrawGpuBatchBounds = drawGpuBatchBounds; + void setDrawGpuBatchBounds(bool drawGpuBatchBounds) { + fDrawGpuBatchBounds = drawGpuBatchBounds; } bool getDrawGpuBatchBounds() const { return fDrawGpuBatchBounds; } @@ -156,7 +155,7 @@ public: /** Returns a JSON object representing up to the Nth draw, where N is less than - SkDebugCanvas::getSize(). The encoder may use the UrlDataManager to store binary data such + SkDebugCanvas::getSize(). The encoder may use the UrlDataManager to store binary data such as images, referring to them via URLs embedded in the JSON. */ Json::Value toJSON(UrlDataManager& urlDataManager, int n, SkCanvas*); diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp index af1270c9e5..fcd2885828 100644 --- a/tools/debugger/SkDrawCommand.cpp +++ b/tools/debugger/SkDrawCommand.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -474,7 +473,7 @@ static Json::Value make_json_path(const SkPath& path) { case SkPath::kInverseEvenOdd_FillType: result[SKDEBUGCANVAS_ATTRIBUTE_FILLTYPE] = SKDEBUGCANVAS_FILLTYPE_INVERSEEVENODD; break; - } + } Json::Value verbs(Json::arrayValue); SkPath::Iter iter(path, false); SkPoint pts[4]; @@ -563,7 +562,7 @@ static Json::Value make_json_pointmode(SkCanvas::PointMode mode) { return Json::Value(SKDEBUGCANVAS_POINTMODE_POINTS); case SkCanvas::kLines_PointMode: return Json::Value(SKDEBUGCANVAS_POINTMODE_LINES); - case SkCanvas::kPolygon_PointMode: + case SkCanvas::kPolygon_PointMode: return Json::Value(SKDEBUGCANVAS_POINTMODE_POLYGON); default: SkASSERT(false); @@ -571,7 +570,7 @@ static Json::Value make_json_pointmode(SkCanvas::PointMode mode) { }; } -static void store_scalar(Json::Value* target, const char* key, SkScalar value, +static void store_scalar(Json::Value* target, const char* key, SkScalar value, SkScalar defaultValue) { if (value != defaultValue) { (*target)[key] = Json::Value(value); @@ -584,14 +583,14 @@ static void store_bool(Json::Value* target, const char* key, bool value, bool de } } -static void encode_data(const void* bytes, size_t count, const char* contentType, +static void encode_data(const void* bytes, size_t count, const char* contentType, UrlDataManager& urlDataManager, Json::Value* target) { SkAutoTUnref data(SkData::NewWithCopy(bytes, count)); SkString url = urlDataManager.addData(data, contentType); *target = Json::Value(url.c_str()); } -static void flatten(const SkFlattenable* flattenable, Json::Value* target, +static void flatten(const SkFlattenable* flattenable, Json::Value* target, UrlDataManager& urlDataManager) { SkWriteBuffer buffer; flattenable->flatten(buffer); @@ -611,7 +610,7 @@ static void write_png_callback(png_structp png_ptr, png_bytep data, png_size_t l out->write(data, length); } -void SkDrawCommand::WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 height, +void SkDrawCommand::WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 height, SkWStream& out) { png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); SkASSERT(png != nullptr); @@ -644,11 +643,11 @@ void SkDrawCommand::WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_3 sk_free(pixels); } -static bool SK_WARN_UNUSED_RESULT flatten(const SkImage& image, Json::Value* target, +static bool SK_WARN_UNUSED_RESULT flatten(const SkImage& image, Json::Value* target, UrlDataManager& urlDataManager) { size_t rowBytes = 4 * image.width(); SkAutoFree buffer(sk_malloc_throw(rowBytes * image.height())); - SkImageInfo dstInfo = SkImageInfo::Make(image.width(), image.height(), + SkImageInfo dstInfo = SkImageInfo::Make(image.width(), image.height(), kN32_SkColorType, kPremul_SkAlphaType); if (!image.readPixels(dstInfo, buffer.get(), rowBytes, 0, 0)) { SkDebugf("readPixels failed\n"); @@ -700,7 +699,7 @@ static const char* alpha_type_name(SkAlphaType alphaType) { } } -static Json::ArrayIndex decode_data(Json::Value data, UrlDataManager& urlDataManager, +static Json::ArrayIndex decode_data(Json::Value data, UrlDataManager& urlDataManager, const void** target) { UrlDataManager::UrlData* urlData = urlDataManager.getDataFromUrl(SkString(data.asCString())); if (urlData == nullptr) { @@ -713,7 +712,7 @@ static Json::ArrayIndex decode_data(Json::Value data, UrlDataManager& urlDataMan return (Json::ArrayIndex) urlData->fData->size(); } -static SkFlattenable* load_flattenable(Json::Value jsonFlattenable, +static SkFlattenable* load_flattenable(Json::Value jsonFlattenable, UrlDataManager& urlDataManager) { if (!jsonFlattenable.isMember(SKDEBUGCANVAS_ATTRIBUTE_NAME)) { return nullptr; @@ -816,7 +815,7 @@ static sk_sp load_image(const Json::Value& jsonImage, UrlDataManager& u return result; } -static bool SK_WARN_UNUSED_RESULT flatten(const SkBitmap& bitmap, Json::Value* target, +static bool SK_WARN_UNUSED_RESULT flatten(const SkBitmap& bitmap, Json::Value* target, UrlDataManager& urlDataManager) { bitmap.lockPixels(); sk_sp image(SkImage::MakeFromBitmap(bitmap)); @@ -917,7 +916,7 @@ static void apply_paint_filterquality(const SkPaint& paint, Json::Value* target) } } -static void apply_paint_maskfilter(const SkPaint& paint, Json::Value* target, +static void apply_paint_maskfilter(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkMaskFilter* maskFilter = paint.getMaskFilter(); if (maskFilter != nullptr) { @@ -966,7 +965,7 @@ static void apply_paint_maskfilter(const SkPaint& paint, Json::Value* target, } } -static void apply_paint_patheffect(const SkPaint& paint, Json::Value* target, +static void apply_paint_patheffect(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkPathEffect* pathEffect = paint.getPathEffect(); if (pathEffect != nullptr) { @@ -991,7 +990,7 @@ static void apply_paint_patheffect(const SkPaint& paint, Json::Value* target, } } } - + static void apply_paint_textalign(const SkPaint& paint, Json::Value* target) { SkPaint::Align textAlign = paint.getTextAlign(); if (textAlign != SkPaint::kLeft_Align) { @@ -1009,7 +1008,7 @@ static void apply_paint_textalign(const SkPaint& paint, Json::Value* target) { } } -static void apply_paint_typeface(const SkPaint& paint, Json::Value* target, +static void apply_paint_typeface(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkTypeface* typeface = paint.getTypeface(); if (typeface != nullptr) { @@ -1019,7 +1018,7 @@ static void apply_paint_typeface(const SkPaint& paint, Json::Value* target, void* data = sk_malloc_throw(buffer.bytesWritten()); buffer.copyTo(data); Json::Value jsonData; - encode_data(data, buffer.bytesWritten(), "application/octet-stream", urlDataManager, + encode_data(data, buffer.bytesWritten(), "application/octet-stream", urlDataManager, &jsonData); jsonTypeface[SKDEBUGCANVAS_ATTRIBUTE_DATA] = jsonData; sk_free(data); @@ -1027,7 +1026,7 @@ static void apply_paint_typeface(const SkPaint& paint, Json::Value* target, } } -static void apply_paint_shader(const SkPaint& paint, Json::Value* target, +static void apply_paint_shader(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkFlattenable* shader = paint.getShader(); if (shader != nullptr) { @@ -1037,7 +1036,7 @@ static void apply_paint_shader(const SkPaint& paint, Json::Value* target, } } -static void apply_paint_xfermode(const SkPaint& paint, Json::Value* target, +static void apply_paint_xfermode(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkFlattenable* xfermode = paint.getXfermode(); if (xfermode != nullptr) { @@ -1057,7 +1056,7 @@ static void apply_paint_imagefilter(const SkPaint& paint, Json::Value* target, } } -static void apply_paint_colorfilter(const SkPaint& paint, Json::Value* target, +static void apply_paint_colorfilter(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkFlattenable* colorFilter = paint.getColorFilter(); if (colorFilter != nullptr) { @@ -1067,7 +1066,7 @@ static void apply_paint_colorfilter(const SkPaint& paint, Json::Value* target, } } -static void apply_paint_looper(const SkPaint& paint, Json::Value* target, +static void apply_paint_looper(const SkPaint& paint, Json::Value* target, UrlDataManager& urlDataManager) { SkFlattenable* looper = paint.getLooper(); if (looper != nullptr) { @@ -1080,11 +1079,11 @@ static void apply_paint_looper(const SkPaint& paint, Json::Value* target, Json::Value make_json_paint(const SkPaint& paint, UrlDataManager& urlDataManager) { Json::Value result(Json::objectValue); store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_STROKEWIDTH, paint.getStrokeWidth(), 0.0f); - store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_STROKEMITER, paint.getStrokeMiter(), + store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_STROKEMITER, paint.getStrokeMiter(), SkPaintDefaults_MiterLimit); store_bool(&result, SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS, paint.isAntiAlias(), false); store_bool(&result, SKDEBUGCANVAS_ATTRIBUTE_DITHER, paint.isDither(), false); - store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_TEXTSIZE, paint.getTextSize(), + store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_TEXTSIZE, paint.getTextSize(), SkPaintDefaults_TextSize); store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_TEXTSCALEX, paint.getTextScaleX(), SK_Scalar1); store_scalar(&result, SKDEBUGCANVAS_ATTRIBUTE_TEXTSCALEX, paint.getTextSkewX(), 0.0f); @@ -1119,7 +1118,7 @@ static void extract_json_paint_color(Json::Value& jsonPaint, SkPaint* target) { } } -static void extract_json_paint_shader(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_shader(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_SHADER)) { Json::Value jsonShader = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_SHADER]; @@ -1130,7 +1129,7 @@ static void extract_json_paint_shader(Json::Value& jsonPaint, UrlDataManager& ur } } -static void extract_json_paint_patheffect(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_patheffect(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_PATHEFFECT)) { Json::Value jsonPathEffect = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_PATHEFFECT]; @@ -1142,7 +1141,7 @@ static void extract_json_paint_patheffect(Json::Value& jsonPaint, UrlDataManager } } -static void extract_json_paint_maskfilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_maskfilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_MASKFILTER)) { Json::Value jsonMaskFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_MASKFILTER]; @@ -1154,7 +1153,7 @@ static void extract_json_paint_maskfilter(Json::Value& jsonPaint, UrlDataManager } } -static void extract_json_paint_colorfilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_colorfilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_COLORFILTER)) { Json::Value jsonColorFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_COLORFILTER]; @@ -1166,7 +1165,7 @@ static void extract_json_paint_colorfilter(Json::Value& jsonPaint, UrlDataManage } } -static void extract_json_paint_xfermode(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_xfermode(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_XFERMODE)) { Json::Value jsonXfermode = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_XFERMODE]; @@ -1178,7 +1177,7 @@ static void extract_json_paint_xfermode(Json::Value& jsonPaint, UrlDataManager& } } -static void extract_json_paint_looper(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_looper(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_LOOPER)) { Json::Value jsonLooper = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_LOOPER]; @@ -1189,11 +1188,11 @@ static void extract_json_paint_looper(Json::Value& jsonPaint, UrlDataManager& ur } } -static void extract_json_paint_imagefilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_imagefilter(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_IMAGEFILTER)) { Json::Value jsonImageFilter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_IMAGEFILTER]; - SkImageFilter* imageFilter = (SkImageFilter*) load_flattenable(jsonImageFilter, + SkImageFilter* imageFilter = (SkImageFilter*) load_flattenable(jsonImageFilter, urlDataManager); if (imageFilter != nullptr) { target->setImageFilter(imageFilter); @@ -1202,7 +1201,7 @@ static void extract_json_paint_imagefilter(Json::Value& jsonPaint, UrlDataManage } } -static void extract_json_paint_typeface(Json::Value& jsonPaint, UrlDataManager& urlDataManager, +static void extract_json_paint_typeface(Json::Value& jsonPaint, UrlDataManager& urlDataManager, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_TYPEFACE)) { Json::Value jsonTypeface = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_TYPEFACE]; @@ -1234,14 +1233,14 @@ static void extract_json_paint_strokewidth(Json::Value& jsonPaint, SkPaint* targ if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_STROKEWIDTH)) { float strokeWidth = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_STROKEWIDTH].asFloat(); target->setStrokeWidth(strokeWidth); - } + } } static void extract_json_paint_strokemiter(Json::Value& jsonPaint, SkPaint* target) { if (jsonPaint.isMember(SKDEBUGCANVAS_ATTRIBUTE_STROKEMITER)) { float strokeMiter = jsonPaint[SKDEBUGCANVAS_ATTRIBUTE_STROKEMITER].asFloat(); target->setStrokeMiter(strokeMiter); - } + } } static void extract_json_paint_strokejoin(Json::Value& jsonPaint, SkPaint* target) { @@ -1402,7 +1401,7 @@ static void extract_json_paint_textskewx(Json::Value& jsonPaint, SkPaint* target } } -static void extract_json_paint(Json::Value& paint, UrlDataManager& urlDataManager, +static void extract_json_paint(Json::Value& paint, UrlDataManager& urlDataManager, SkPaint* result) { extract_json_paint_color(paint, result); extract_json_paint_shader(paint, urlDataManager, result); @@ -1439,21 +1438,21 @@ static void extract_json_irect(Json::Value& rect, SkIRect* result) { static void extract_json_rrect(Json::Value& rrect, SkRRect* result) { SkVector radii[4] = { - { rrect[1][0].asFloat(), rrect[1][1].asFloat() }, - { rrect[2][0].asFloat(), rrect[2][1].asFloat() }, - { rrect[3][0].asFloat(), rrect[3][1].asFloat() }, + { rrect[1][0].asFloat(), rrect[1][1].asFloat() }, + { rrect[2][0].asFloat(), rrect[2][1].asFloat() }, + { rrect[3][0].asFloat(), rrect[3][1].asFloat() }, { rrect[4][0].asFloat(), rrect[4][1].asFloat() } }; - result->setRectRadii(SkRect::MakeLTRB(rrect[0][0].asFloat(), rrect[0][1].asFloat(), - rrect[0][2].asFloat(), rrect[0][3].asFloat()), + result->setRectRadii(SkRect::MakeLTRB(rrect[0][0].asFloat(), rrect[0][1].asFloat(), + rrect[0][2].asFloat(), rrect[0][3].asFloat()), radii); } static void extract_json_matrix(Json::Value& matrix, SkMatrix* result) { - SkScalar values[] = { + SkScalar values[] = { matrix[0][0].asFloat(), matrix[0][1].asFloat(), matrix[0][2].asFloat(), matrix[1][0].asFloat(), matrix[1][1].asFloat(), matrix[1][2].asFloat(), - matrix[2][0].asFloat(), matrix[2][1].asFloat(), matrix[2][2].asFloat() + matrix[2][0].asFloat(), matrix[2][1].asFloat(), matrix[2][2].asFloat() }; result->set9(values); } @@ -1584,11 +1583,11 @@ Json::Value SkClipPathCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkClipPathCommand* SkClipPathCommand::fromJSON(Json::Value& command, +SkClipPathCommand* SkClipPathCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkPath path; extract_json_path(command[SKDEBUGCANVAS_ATTRIBUTE_PATH], &path); - return new SkClipPathCommand(path, get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), + return new SkClipPathCommand(path, get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), command[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS].asBool()); } @@ -1612,7 +1611,7 @@ Json::Value SkClipRegionCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkClipRegionCommand* SkClipRegionCommand::fromJSON(Json::Value& command, +SkClipRegionCommand* SkClipRegionCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkASSERT(false); return nullptr; @@ -1641,11 +1640,11 @@ Json::Value SkClipRectCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkClipRectCommand* SkClipRectCommand::fromJSON(Json::Value& command, +SkClipRectCommand* SkClipRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRect rect; extract_json_rect(command[SKDEBUGCANVAS_ATTRIBUTE_COORDS], &rect); - return new SkClipRectCommand(rect, get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), + return new SkClipRectCommand(rect, get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), command[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS].asBool()); } @@ -1677,12 +1676,12 @@ Json::Value SkClipRRectCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkClipRRectCommand* SkClipRRectCommand::fromJSON(Json::Value& command, +SkClipRRectCommand* SkClipRRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRRect rrect; extract_json_rrect(command[SKDEBUGCANVAS_ATTRIBUTE_COORDS], &rrect); - return new SkClipRRectCommand(rrect, - get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), + return new SkClipRRectCommand(rrect, + get_json_regionop(command[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP]), command[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS].asBool()); } @@ -1753,7 +1752,7 @@ Json::Value SkDrawBitmapCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawBitmapCommand* SkDrawBitmapCommand::fromJSON(Json::Value& command, +SkDrawBitmapCommand* SkDrawBitmapCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkBitmap* bitmap = load_bitmap(command[SKDEBUGCANVAS_ATTRIBUTE_BITMAP], urlDataManager); if (bitmap == nullptr) { @@ -1769,7 +1768,7 @@ SkDrawBitmapCommand* SkDrawBitmapCommand::fromJSON(Json::Value& command, else { paintPtr = nullptr; } - SkDrawBitmapCommand* result = new SkDrawBitmapCommand(*bitmap, point[0].asFloat(), + SkDrawBitmapCommand* result = new SkDrawBitmapCommand(*bitmap, point[0].asFloat(), point[1].asFloat(), paintPtr); delete bitmap; return result; @@ -1820,7 +1819,7 @@ Json::Value SkDrawBitmapNineCommand::toJSON(UrlDataManager& urlDataManager) cons return result; } -SkDrawBitmapNineCommand* SkDrawBitmapNineCommand::fromJSON(Json::Value& command, +SkDrawBitmapNineCommand* SkDrawBitmapNineCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkBitmap* bitmap = load_bitmap(command[SKDEBUGCANVAS_ATTRIBUTE_BITMAP], urlDataManager); if (bitmap == nullptr) { @@ -1903,7 +1902,7 @@ Json::Value SkDrawBitmapRectCommand::toJSON(UrlDataManager& urlDataManager) cons return result; } -SkDrawBitmapRectCommand* SkDrawBitmapRectCommand::fromJSON(Json::Value& command, +SkDrawBitmapRectCommand* SkDrawBitmapRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkBitmap* bitmap = load_bitmap(command[SKDEBUGCANVAS_ATTRIBUTE_BITMAP], urlDataManager); if (bitmap == nullptr) { @@ -1921,7 +1920,7 @@ SkDrawBitmapRectCommand* SkDrawBitmapRectCommand::fromJSON(Json::Value& command, paintPtr = nullptr; } SkCanvas::SrcRectConstraint constraint; - if (command.isMember(SKDEBUGCANVAS_ATTRIBUTE_STRICT) && + if (command.isMember(SKDEBUGCANVAS_ATTRIBUTE_STRICT) && command[SKDEBUGCANVAS_ATTRIBUTE_STRICT].asBool()) { constraint = SkCanvas::kStrict_SrcRectConstraint; } @@ -1988,7 +1987,7 @@ Json::Value SkDrawImageCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawImageCommand* SkDrawImageCommand::fromJSON(Json::Value& command, +SkDrawImageCommand* SkDrawImageCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { sk_sp image = load_image(command[SKDEBUGCANVAS_ATTRIBUTE_IMAGE], urlDataManager); if (image == nullptr) { @@ -2037,7 +2036,7 @@ SkDrawImageRectCommand::SkDrawImageRectCommand(const SkImage* image, const SkRec } void SkDrawImageRectCommand::execute(SkCanvas* canvas) const { - canvas->legacy_drawImageRect(fImage, fSrc.getMaybeNull(), fDst, fPaint.getMaybeNull(), + canvas->legacy_drawImageRect(fImage, fSrc.getMaybeNull(), fDst, fPaint.getMaybeNull(), fConstraint); } @@ -2070,7 +2069,7 @@ Json::Value SkDrawImageRectCommand::toJSON(UrlDataManager& urlDataManager) const return result; } -SkDrawImageRectCommand* SkDrawImageRectCommand::fromJSON(Json::Value& command, +SkDrawImageRectCommand* SkDrawImageRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { sk_sp image = load_image(command[SKDEBUGCANVAS_ATTRIBUTE_IMAGE], urlDataManager); if (image == nullptr) { @@ -2088,7 +2087,7 @@ SkDrawImageRectCommand* SkDrawImageRectCommand::fromJSON(Json::Value& command, paintPtr = nullptr; } SkCanvas::SrcRectConstraint constraint; - if (command.isMember(SKDEBUGCANVAS_ATTRIBUTE_STRICT) && + if (command.isMember(SKDEBUGCANVAS_ATTRIBUTE_STRICT) && command[SKDEBUGCANVAS_ATTRIBUTE_STRICT].asBool()) { constraint = SkCanvas::kStrict_SrcRectConstraint; } @@ -2145,7 +2144,7 @@ Json::Value SkDrawOvalCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawOvalCommand* SkDrawOvalCommand::fromJSON(Json::Value& command, +SkDrawOvalCommand* SkDrawOvalCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRect coords; extract_json_rect(command[SKDEBUGCANVAS_ATTRIBUTE_COORDS], &coords); @@ -2177,7 +2176,7 @@ Json::Value SkDrawPaintCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawPaintCommand* SkDrawPaintCommand::fromJSON(Json::Value& command, +SkDrawPaintCommand* SkDrawPaintCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkPaint paint; extract_json_paint(command[SKDEBUGCANVAS_ATTRIBUTE_PAINT], urlDataManager, &paint); @@ -2209,7 +2208,7 @@ Json::Value SkDrawPathCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawPathCommand* SkDrawPathCommand::fromJSON(Json::Value& command, +SkDrawPathCommand* SkDrawPathCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkPath path; extract_json_path(command[SKDEBUGCANVAS_ATTRIBUTE_PATH], &path); @@ -2336,7 +2335,7 @@ Json::Value SkDrawPointsCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawPointsCommand* SkDrawPointsCommand::fromJSON(Json::Value& command, +SkDrawPointsCommand* SkDrawPointsCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkCanvas::PointMode mode; const char* jsonMode = command[SKDEBUGCANVAS_ATTRIBUTE_MODE].asCString(); @@ -2392,7 +2391,7 @@ void SkDrawPosTextCommand::execute(SkCanvas* canvas) const { Json::Value SkDrawPosTextCommand::toJSON(UrlDataManager& urlDataManager) const { Json::Value result = INHERITED::toJSON(urlDataManager); - result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, + result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, ((const char*) fText) + fByteLength); Json::Value coords(Json::arrayValue); size_t numCoords = fPaint.textToGlyphs(fText, fByteLength, nullptr); @@ -2404,7 +2403,7 @@ Json::Value SkDrawPosTextCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawPosTextCommand* SkDrawPosTextCommand::fromJSON(Json::Value& command, +SkDrawPosTextCommand* SkDrawPosTextCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { const char* text = command[SKDEBUGCANVAS_ATTRIBUTE_TEXT].asCString(); SkPaint paint; @@ -2579,7 +2578,7 @@ Json::Value SkDrawTextBlobCommand::toJSON(UrlDataManager& urlDataManager) const return result; } -SkDrawTextBlobCommand* SkDrawTextBlobCommand::fromJSON(Json::Value& command, +SkDrawTextBlobCommand* SkDrawTextBlobCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkTextBlobBuilder builder; Json::Value runs = command[SKDEBUGCANVAS_ATTRIBUTE_RUNS]; @@ -2683,7 +2682,7 @@ Json::Value SkDrawPatchCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawPatchCommand* SkDrawPatchCommand::fromJSON(Json::Value& command, +SkDrawPatchCommand* SkDrawPatchCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { Json::Value jsonCubics = command[SKDEBUGCANVAS_ATTRIBUTE_CUBICS]; SkPoint cubics[12]; @@ -2744,7 +2743,7 @@ Json::Value SkDrawRectCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawRectCommand* SkDrawRectCommand::fromJSON(Json::Value& command, +SkDrawRectCommand* SkDrawRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRect coords; extract_json_rect(command[SKDEBUGCANVAS_ATTRIBUTE_COORDS], &coords); @@ -2778,7 +2777,7 @@ Json::Value SkDrawRRectCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawRRectCommand* SkDrawRRectCommand::fromJSON(Json::Value& command, +SkDrawRRectCommand* SkDrawRRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRRect coords; extract_json_rrect(command[SKDEBUGCANVAS_ATTRIBUTE_COORDS], &coords); @@ -2817,7 +2816,7 @@ Json::Value SkDrawDRRectCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawDRRectCommand* SkDrawDRRectCommand::fromJSON(Json::Value& command, +SkDrawDRRectCommand* SkDrawDRRectCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkRRect outer; extract_json_rrect(command[SKDEBUGCANVAS_ATTRIBUTE_INNER], &outer); @@ -2850,7 +2849,7 @@ void SkDrawTextCommand::execute(SkCanvas* canvas) const { Json::Value SkDrawTextCommand::toJSON(UrlDataManager& urlDataManager) const { Json::Value result = INHERITED::toJSON(urlDataManager); - result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, + result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, ((const char*) fText) + fByteLength); Json::Value coords(Json::arrayValue); result[SKDEBUGCANVAS_ATTRIBUTE_COORDS] = make_json_point(fX, fY); @@ -2858,13 +2857,13 @@ Json::Value SkDrawTextCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkDrawTextCommand* SkDrawTextCommand::fromJSON(Json::Value& command, +SkDrawTextCommand* SkDrawTextCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { const char* text = command[SKDEBUGCANVAS_ATTRIBUTE_TEXT].asCString(); SkPaint paint; extract_json_paint(command[SKDEBUGCANVAS_ATTRIBUTE_PAINT], urlDataManager, &paint); Json::Value coords = command[SKDEBUGCANVAS_ATTRIBUTE_COORDS]; - return new SkDrawTextCommand(text, strlen(text), coords[0].asFloat(), coords[1].asFloat(), + return new SkDrawTextCommand(text, strlen(text), coords[0].asFloat(), coords[1].asFloat(), paint); } @@ -2899,7 +2898,7 @@ void SkDrawTextOnPathCommand::execute(SkCanvas* canvas) const { Json::Value SkDrawTextOnPathCommand::toJSON(UrlDataManager& urlDataManager) const { Json::Value result = INHERITED::toJSON(urlDataManager); - result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, + result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = Json::Value((const char*) fText, ((const char*) fText) + fByteLength); Json::Value coords(Json::arrayValue); result[SKDEBUGCANVAS_ATTRIBUTE_PATH] = make_json_path(fPath); @@ -2910,7 +2909,7 @@ Json::Value SkDrawTextOnPathCommand::toJSON(UrlDataManager& urlDataManager) cons return result; } -SkDrawTextOnPathCommand* SkDrawTextOnPathCommand::fromJSON(Json::Value& command, +SkDrawTextOnPathCommand* SkDrawTextOnPathCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { const char* text = command[SKDEBUGCANVAS_ATTRIBUTE_TEXT].asCString(); SkPaint paint; @@ -3069,7 +3068,7 @@ Json::Value SkSaveLayerCommand::toJSON(UrlDataManager& urlDataManager) const { result[SKDEBUGCANVAS_ATTRIBUTE_BOUNDS] = make_json_rect(fBounds); } if (fPaintPtr != nullptr) { - result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = make_json_paint(*fPaintPtr, + result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = make_json_paint(*fPaintPtr, urlDataManager); } if (fBackdrop != nullptr) { @@ -3084,7 +3083,7 @@ Json::Value SkSaveLayerCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkSaveLayerCommand* SkSaveLayerCommand::fromJSON(Json::Value& command, +SkSaveLayerCommand* SkSaveLayerCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkCanvas::SaveLayerRec rec; SkRect bounds; @@ -3130,7 +3129,7 @@ Json::Value SkSetMatrixCommand::toJSON(UrlDataManager& urlDataManager) const { return result; } -SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, +SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command, UrlDataManager& urlDataManager) { SkMatrix matrix; extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix); diff --git a/tools/debugger/SkDrawCommand.h b/tools/debugger/SkDrawCommand.h index 7eaf354bc7..ac9e476a9a 100644 --- a/tools/debugger/SkDrawCommand.h +++ b/tools/debugger/SkDrawCommand.h @@ -59,7 +59,7 @@ public: static const int kOpTypeCount = kLast_OpType + 1; - static void WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 height, + static void WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 height, SkWStream& out); SkDrawCommand(OpType opType); diff --git a/tools/debugger/SkObjectParser.cpp b/tools/debugger/SkObjectParser.cpp index 5f3fa44909..36427831c8 100644 --- a/tools/debugger/SkObjectParser.cpp +++ b/tools/debugger/SkObjectParser.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 Google Inc. * @@ -26,7 +25,7 @@ SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) { mBitmap->appendS32(bitmap.width()); mBitmap->append(" H: "); mBitmap->appendS32(bitmap.height()); - + const char* gColorTypeStrings[] = { "None", "A8", "565", "4444", "RGBA", "BGRA", "Index8", "G8", "RGBAf16" }; @@ -136,7 +135,7 @@ SkString* SkObjectParser::PaintToString(const SkPaint& paint) { SkString* SkObjectParser::PathToString(const SkPath& path) { SkString* mPath = new SkString; - + mPath->appendf("Path (%d) (", path.getGenerationID()); static const char* gFillStrings[] = { diff --git a/tools/gpuveto.cpp b/tools/gpuveto.cpp index 41ca0c8dd3..59b3bef2d9 100644 --- a/tools/gpuveto.cpp +++ b/tools/gpuveto.cpp @@ -52,8 +52,8 @@ int tool_main(int argc, char** argv) { // The SkPicture tracking information is only generated during recording // an isn't serialized. Replay the picture to regenerated the tracking data. SkPictureRecorder recorder; - picture->playback(recorder.beginRecording(picture->cullRect().width(), - picture->cullRect().height(), + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), nullptr, 0)); sk_sp recorded(recorder.finishRecordingAsPicture()); diff --git a/tools/imgblur.cpp b/tools/imgblur.cpp index c47bb02b75..3a0ae00f3b 100644 --- a/tools/imgblur.cpp +++ b/tools/imgblur.cpp @@ -37,7 +37,7 @@ int tool_main(int argc, char** argv) { if (!FLAGS_quiet) { SkDebugf("Sigma must be greater than zero (it is %f).\n", FLAGS_sigma); } - return kError; + return kError; } sk_sp data(SkData::MakeFromFileName(FLAGS_in[0])); @@ -70,7 +70,7 @@ int tool_main(int argc, char** argv) { if (!FLAGS_quiet) { SkDebugf("Couldn't write to file: %s\n", FLAGS_out[0]); } - return kError; + return kError; } return kSuccess; diff --git a/tools/imgslice.cpp b/tools/imgslice.cpp index 3585c06352..2fdc819aa9 100644 --- a/tools/imgslice.cpp +++ b/tools/imgslice.cpp @@ -42,21 +42,21 @@ int tool_main(int argc, char** argv) { SkDebugf("Channel (--rgb) must be between 0 and 3 (inclusive) - value is %d.\n", FLAGS_rgb); } - return kError; + return kError; } if (FLAGS_row >= 0 && FLAGS_column >= 0) { if (!FLAGS_quiet) { SkDebugf("Only one of '-c' or '-r' can be specified at at time.\n"); } - return kError; + return kError; } if (FLAGS_row < 0 && FLAGS_column < 0) { if (!FLAGS_quiet) { SkDebugf("At least one of '-c' or '-r' need to be specified.\n"); } - return kError; + return kError; } sk_sp data(SkData::MakeFromFileName(FLAGS_image[0])); @@ -128,7 +128,7 @@ int tool_main(int argc, char** argv) { SkDebugf(", %d", ((c) >> (FLAGS_rgb*8)) & 0xFF); } - } + } } SkDebugf("\n"); diff --git a/tools/lua/lua_pictures.cpp b/tools/lua/lua_pictures.cpp index 0edea2576e..9776002e7a 100644 --- a/tools/lua/lua_pictures.cpp +++ b/tools/lua/lua_pictures.cpp @@ -145,7 +145,7 @@ int tool_main(int argc, char** argv) { auto pic(load_picture(path)); if (pic.get()) { SkAutoTUnref canvas( - new SkLuaCanvas(SkScalarCeilToInt(pic->cullRect().width()), + new SkLuaCanvas(SkScalarCeilToInt(pic->cullRect().width()), SkScalarCeilToInt(pic->cullRect().height()), L.get(), gAccumulateFunc)); diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp index 1cbc2e19c3..57aaf1e722 100644 --- a/tools/pinspect.cpp +++ b/tools/pinspect.cpp @@ -38,7 +38,7 @@ static sk_sp inspect(const char path[]) { SkDebugf("Could not create SkPicture: %s\n", path); return nullptr; } - printf("picture cullRect: [%f %f %f %f]\n", + printf("picture cullRect: [%f %f %f %f]\n", pic->cullRect().fLeft, pic->cullRect().fTop, pic->cullRect().fRight, pic->cullRect().fBottom); return pic; diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp index 10e5c305c3..f46ebb6e60 100644 --- a/tools/sk_tool_utils.cpp +++ b/tools/sk_tool_utils.cpp @@ -91,7 +91,7 @@ void emoji_typeface(SkAutoTUnref* tf) { const char* emoji_sample_text() { if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { return "Hamburgefons"; - } + } if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) { return "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // 💰🏡🎅 "\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80" // 🍪🍕🚀 @@ -167,7 +167,7 @@ void set_portable_typeface(SkPaint* paint, const char* name, SkTypeface::Style s SkTypeface* face = create_font(name, style); SkSafeUnref(paint->setTypeface(face)); } - + void write_pixels(SkCanvas* canvas, const SkBitmap& bitmap, int x, int y, SkColorType colorType, SkAlphaType alphaType) { SkBitmap tmp(bitmap); @@ -256,7 +256,7 @@ void create_hemi_normal_map(SkBitmap* bm, const SkIRect& dst) { for (int x = dst.fLeft; x < dst.fRight; ++x) { norm.fX = (x + 0.5f - center.fX) / halfSize.fX; norm.fY = (y + 0.5f - center.fY) / halfSize.fY; - + SkScalar tmp = norm.fX * norm.fX + norm.fY * norm.fY; if (tmp >= 1.0f) { norm.set(0.0f, 0.0f, 1.0f); @@ -295,13 +295,13 @@ void create_frustum_normal_map(SkBitmap* bm, const SkIRect& dst) { norm = locX >= locY ? right : down; // LR corner } else { norm = locX > -locY ? right : up; // UR corner - } + } } else { if (locY > 0.0f) { norm = -locX > locY ? left : down; // LL corner } else { norm = locX > locY ? up : left; // UL corner - } + } } } @@ -331,13 +331,13 @@ void create_tetra_normal_map(SkBitmap* bm, const SkIRect& dst) { norm = locX >= locY ? rightUp : down; // LR corner } else { norm = rightUp; - } + } } else { if (locY > 0.0f) { norm = -locX > locY ? leftUp : down; // LL corner } else { norm = leftUp; - } + } } norm_to_rgb(bm, x, y, norm); @@ -439,7 +439,7 @@ SkBitmap slow_blur(const SkBitmap& src, float sigma) { *dst.getAddr32(x, y) = blur_pixel(src, x, y, kernel.get(), wh); } } - + return dst; } diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h index 1e67afb6d2..1d80731fd4 100644 --- a/tools/sk_tool_utils.h +++ b/tools/sk_tool_utils.h @@ -167,13 +167,13 @@ namespace sk_tool_utils { static void SetTempMark(TopoTestNode* node) { node->fTempMark = true; } static void ResetTempMark(TopoTestNode* node) { node->fTempMark = false; } static bool IsTempMarked(TopoTestNode* node) { return node->fTempMark; } - static void Output(TopoTestNode* node, int outputPos) { + static void Output(TopoTestNode* node, int outputPos) { SkASSERT(-1 != outputPos); - node->fOutputPos = outputPos; + node->fOutputPos = outputPos; } static bool WasOutput(TopoTestNode* node) { return (-1 != node->fOutputPos); } static int NumDependencies(TopoTestNode* node) { return node->fDependencies.count(); } - static TopoTestNode* Dependency(TopoTestNode* node, int index) { + static TopoTestNode* Dependency(TopoTestNode* node, int index) { return node->fDependencies[index]; } diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp index 47b467cd1f..1d946abaa0 100644 --- a/tools/skiaserve/Request.cpp +++ b/tools/skiaserve/Request.cpp @@ -55,7 +55,7 @@ SkData* Request::writeCanvasToPng(SkCanvas* canvas) { // write to png SkDynamicMemoryWStream buffer; - SkDrawCommand::WritePNG((const png_bytep) bmp->getPixels(), bmp->width(), bmp->height(), + SkDrawCommand::WritePNG((const png_bytep) bmp->getPixels(), bmp->width(), bmp->height(), buffer); return buffer.copyToData(); } @@ -155,7 +155,7 @@ SkSurface* Request::createGPUSurface() { return surface; } -bool Request::enableGPU(bool enable) { +bool Request::enableGPU(bool enable) { if (enable) { SkSurface* surface = this->createGPUSurface(); if (surface) { @@ -175,7 +175,7 @@ bool Request::enableGPU(bool enable) { fSurface.reset(this->createCPUSurface()); fGPUEnabled = false; return true; -} +} bool Request::initPictureFromStream(SkStream* stream) { // parse picture from stream @@ -254,4 +254,3 @@ SkColor Request::getPixel(int x, int y) { bitmap->unlockPixels(); return result; } - diff --git a/tools/skiaserve/Request.h b/tools/skiaserve/Request.h index eecfe33571..e3bc373841 100644 --- a/tools/skiaserve/Request.h +++ b/tools/skiaserve/Request.h @@ -59,7 +59,7 @@ struct Request { UploadContext* fUploadContext; SkAutoTUnref fDebugCanvas; UrlDataManager fUrlDataManager; - + private: SkData* writeCanvasToPng(SkCanvas* canvas); void drawToCanvas(int n, int m = -1); @@ -67,7 +67,7 @@ private: SkSurface* createGPUSurface(); SkIRect getBounds(); GrContext* getContext(); - + sk_sp fPicture; GrContextFactory* fContextFactory; SkAutoTUnref fSurface; @@ -75,4 +75,3 @@ private: }; #endif - diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp index 164f59526d..fd96251b86 100644 --- a/tools/skiaserve/skiaserve.cpp +++ b/tools/skiaserve/skiaserve.cpp @@ -86,7 +86,7 @@ int skiaserve_main() { address.sin_port = htons(FLAGS_port); int result = inet_pton(AF_INET, FLAGS_address[0], &address.sin_addr); if (result != 1) { - printf("inet_pton for %s:%d failed with return %d %s\n", + printf("inet_pton for %s:%d failed with return %d %s\n", FLAGS_address[0], FLAGS_port, result, strerror(errno)); return 1; } @@ -97,7 +97,7 @@ int skiaserve_main() { daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY #ifdef SK_DEBUG | MHD_USE_DEBUG -#endif +#endif , FLAGS_port, nullptr, nullptr, &answer_to_connection, &request, MHD_OPTION_SOCK_ADDR, &address, diff --git a/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp b/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp index 40449868bf..b14db1924d 100644 --- a/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp +++ b/tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp @@ -35,4 +35,3 @@ int BatchBoundsHandler::handle(Request* request, MHD_Connection* connection, request->fDebugCanvas->setDrawGpuBatchBounds(enabled); return SendOK(connection); } - diff --git a/tools/skiaserve/urlhandlers/BatchesHandler.cpp b/tools/skiaserve/urlhandlers/BatchesHandler.cpp index 221c5393c7..b245c4d8f3 100644 --- a/tools/skiaserve/urlhandlers/BatchesHandler.cpp +++ b/tools/skiaserve/urlhandlers/BatchesHandler.cpp @@ -31,11 +31,10 @@ int BatchesHandler::handle(Request* request, MHD_Connection* connection, // /batches if (0 == strcmp(method, MHD_HTTP_METHOD_GET)) { int n = request->getLastOp(); - + SkAutoTUnref data(request->getJsonBatchList(n)); return SendData(connection, data, "application/json"); } return MHD_NO; } - diff --git a/tools/skiaserve/urlhandlers/BreakHandler.cpp b/tools/skiaserve/urlhandlers/BreakHandler.cpp index b701955f90..16bf507297 100644 --- a/tools/skiaserve/urlhandlers/BreakHandler.cpp +++ b/tools/skiaserve/urlhandlers/BreakHandler.cpp @@ -83,4 +83,3 @@ int BreakHandler::handle(Request* request, MHD_Connection* connection, SkAutoTUnref data(stream.copyToData()); return SendData(connection, data, "application/json"); } - diff --git a/tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp b/tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp index 4ab5096a1b..a931f93a7c 100644 --- a/tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp +++ b/tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp @@ -35,4 +35,3 @@ int ClipAlphaHandler::handle(Request* request, MHD_Connection* connection, request->fDebugCanvas->setClipVizColor(SkColorSetARGB(alpha, 0, 0, 0)); return SendOK(connection); } - diff --git a/tools/skiaserve/urlhandlers/CmdHandler.cpp b/tools/skiaserve/urlhandlers/CmdHandler.cpp index 1699bcbcfc..09fdc17105 100644 --- a/tools/skiaserve/urlhandlers/CmdHandler.cpp +++ b/tools/skiaserve/urlhandlers/CmdHandler.cpp @@ -36,7 +36,7 @@ int CmdHandler::handle(Request* request, MHD_Connection* connection, } else { sscanf(commands[1].c_str(), "%d", &n); } - + SkAutoTUnref data(request->getJsonOps(n)); return SendData(connection, data, "application/json"); } @@ -60,4 +60,3 @@ int CmdHandler::handle(Request* request, MHD_Connection* connection, return MHD_NO; } - diff --git a/tools/skiaserve/urlhandlers/DataHandler.cpp b/tools/skiaserve/urlhandlers/DataHandler.cpp index 0c94530c5d..397be8f224 100644 --- a/tools/skiaserve/urlhandlers/DataHandler.cpp +++ b/tools/skiaserve/urlhandlers/DataHandler.cpp @@ -37,4 +37,3 @@ int DataHandler::handle(Request* request, MHD_Connection* connection, } return MHD_NO; } - diff --git a/tools/skiaserve/urlhandlers/DownloadHandler.cpp b/tools/skiaserve/urlhandlers/DownloadHandler.cpp index fd9308d26e..4e2391588b 100644 --- a/tools/skiaserve/urlhandlers/DownloadHandler.cpp +++ b/tools/skiaserve/urlhandlers/DownloadHandler.cpp @@ -31,4 +31,3 @@ int DownloadHandler::handle(Request* request, MHD_Connection* connection, return SendData(connection, data, "application/octet-stream", true, "attachment; filename=something.skp;"); } - diff --git a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp b/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp index b5d0c7a245..68eb86f6b4 100644 --- a/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp +++ b/tools/skiaserve/urlhandlers/EnableGPUHandler.cpp @@ -38,4 +38,3 @@ int EnableGPUHandler::handle(Request* request, MHD_Connection* connection, } return SendOK(connection); } - diff --git a/tools/skiaserve/urlhandlers/ImgHandler.cpp b/tools/skiaserve/urlhandlers/ImgHandler.cpp index a0e58bcc4d..91ea6d06de 100644 --- a/tools/skiaserve/urlhandlers/ImgHandler.cpp +++ b/tools/skiaserve/urlhandlers/ImgHandler.cpp @@ -43,4 +43,3 @@ int ImgHandler::handle(Request* request, MHD_Connection* connection, SkAutoTUnref data(request->drawToPng(n, m)); return SendData(connection, data, "image/png"); } - diff --git a/tools/skiaserve/urlhandlers/InfoHandler.cpp b/tools/skiaserve/urlhandlers/InfoHandler.cpp index 65bbeb9526..464bbb35e1 100644 --- a/tools/skiaserve/urlhandlers/InfoHandler.cpp +++ b/tools/skiaserve/urlhandlers/InfoHandler.cpp @@ -40,4 +40,3 @@ int InfoHandler::handle(Request* request, MHD_Connection* connection, SkAutoTUnref data(request->getJsonInfo(n)); return SendData(connection, data, "application/json"); } - diff --git a/tools/skiaserve/urlhandlers/PostHandler.cpp b/tools/skiaserve/urlhandlers/PostHandler.cpp index ce599200b2..34beefae11 100644 --- a/tools/skiaserve/urlhandlers/PostHandler.cpp +++ b/tools/skiaserve/urlhandlers/PostHandler.cpp @@ -66,11 +66,10 @@ int PostHandler::handle(Request* request, MHD_Connection* connection, fprintf(stderr, "Could not create picture from stream.\n"); return MHD_NO; } - + // clear upload context delete request->fUploadContext; request->fUploadContext = nullptr; return SendTemplate(connection, true, "/"); } - diff --git a/tools/skiaserve/urlhandlers/RootHandler.cpp b/tools/skiaserve/urlhandlers/RootHandler.cpp index 03b87f3b82..647c198cbc 100644 --- a/tools/skiaserve/urlhandlers/RootHandler.cpp +++ b/tools/skiaserve/urlhandlers/RootHandler.cpp @@ -23,4 +23,3 @@ int RootHandler::handle(Request* request, MHD_Connection* connection, const char* upload_data, size_t* upload_data_size) { return SendTemplate(connection); } - diff --git a/tools/skiaserve/urlhandlers/UrlHandler.h b/tools/skiaserve/urlhandlers/UrlHandler.h index 4fa9731da1..02a07b0d14 100644 --- a/tools/skiaserve/urlhandlers/UrlHandler.h +++ b/tools/skiaserve/urlhandlers/UrlHandler.h @@ -56,7 +56,7 @@ public: }; /** - Controls whether GPU rendering is enabled. Posting to /enableGPU/1 turns GPU on, /enableGPU/0 + Controls whether GPU rendering is enabled. Posting to /enableGPU/1 turns GPU on, /enableGPU/0 disables it. */ class EnableGPUHandler : public UrlHandler { @@ -128,4 +128,3 @@ public: const char* url, const char* method, const char* upload_data, size_t* upload_data_size) override; }; - diff --git a/tools/skpmaker.cpp b/tools/skpmaker.cpp index 99e6adf997..e7418ad453 100644 --- a/tools/skpmaker.cpp +++ b/tools/skpmaker.cpp @@ -77,9 +77,9 @@ int tool_main(int argc, char** argv) { } SkColor color = SkColorSetRGB(FLAGS_red, FLAGS_green, FLAGS_blue); - make_skp(SkIntToScalar(FLAGS_width), - SkIntToScalar(FLAGS_height), - SkIntToScalar(FLAGS_border), + make_skp(SkIntToScalar(FLAGS_width), + SkIntToScalar(FLAGS_height), + SkIntToScalar(FLAGS_border), color, FLAGS_writePath[0]); return 0; } diff --git a/tools/test_font_monospace.cpp b/tools/test_font_monospace.cpp index 64639be6dd..4b14dc6972 100644 --- a/tools/test_font_monospace.cpp +++ b/tools/test_font_monospace.cpp @@ -4845,4 +4845,3 @@ const SkPaint::FontMetrics LiberationMonoBoldItalicMetrics = { 0x30307833, -0.83252f, -0.83252f, 0.300293f, 0.300293f, 0, 0.791992f, 0.0123749f, -0.0942383f, 0.697754f, 0.538086f, 0.0104446f, 0.100098f, 0.23291f }; - diff --git a/tools/test_font_sans_serif.cpp b/tools/test_font_sans_serif.cpp index 859375ec97..b0d433d355 100644 --- a/tools/test_font_sans_serif.cpp +++ b/tools/test_font_sans_serif.cpp @@ -4855,4 +4855,3 @@ const SkPaint::FontMetrics LiberationSansBoldItalicMetrics = { 0x30307833, -1.02979f, -0.905273f, 0.211914f, 0.303223f, 0.0327148f, 1.3374f, 0.0208969f, -0.208984f, 1.12842f, 0.537598f, 0.0109024f, 0.10498f, 0.105957f }; - diff --git a/tools/test_font_serif.cpp b/tools/test_font_serif.cpp index 14a54337e9..49279ce996 100644 --- a/tools/test_font_serif.cpp +++ b/tools/test_font_serif.cpp @@ -5147,4 +5147,3 @@ const SkPaint::FontMetrics LiberationSerifBoldItalicMetrics = { 0x30307833, -0.980957f, -0.891113f, 0.216309f, 0.303223f, 0.0424805f, 1.32861f, 0.0207596f, -0.178223f, 1.15039f, 0.469727f, 0.0103607f, 0.0952148f, 0.108887f }; - -- cgit v1.2.3