2015-03-25 17:22:41 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
Add a class to allocate small objects w/o extra calls to new.
Add SkSmallAllocator, a template for allocating small (as defined by the
instantiation) objects without extra calls to new. Add a helper macro to
make using it simple.
Remove SkTemplatesPriv.h, whose behavior is replaced by SkSmallAllocator.
The old SK_PLACEMENT_NEW had the following drawbacks:
- Easily confused with SkNEW_PLACEMENT.
- Requires passing around lots of void*s along with the storageSize.
- Requires using a separate class for deleting it.
- We had multiple ways Auto objects for deleting in different places.
- It always did a straight heap allocation on Windows, meaning Windows
did not get any advantages from the confusing code.
The new SkSmallAllocator simplifies things:
- It is clear about what it does.
- It takes care of the deletion in one place that is automatically
handled.
Further, the new class can be used to create more than one object. This
is in preparation for BUG=skia:1976, for which we would like to create
a new object without extra heap allocations. The plan is to create both
the blitter and the new object on the stack using the SkSmallAllocator.
Add a new test for SkSmallAllocator.
SkShader.h:
Move the private version of CreateBitmapShader to SkBitmapProcShader
(which already has the implementation) and remove the friend class
(which was only used to call this private function). This allows
SkSmallAllocator to reside in the private src/ directory.
SkBitmapProcShader:
Move CreateBitmapShader and the macro for the storage size here. With
the macro in a (private) header, the (private) headers with function
declarations (which now depend on the storage size used) can see the
macro.
Use SkSmallAllocator in CreateBitmapShader.
Change the macro to kBlitterStorageByteCount, since SkSmallAllocator
takes a byte count as its template parameter.
SkBlitter:
Use the SkSmallAllocator.
Remove Sk3DShader::fKillProc and SkAutoCallProc. Both of their
behaviors have been moved into SkSmallAllocator (SkAutoCallProc was
unnecessary anyway, because the only time we ever used it we also
called detach(), so its auto behavior never happened).
Create the Sk3DShader on the stack, if there's room.
Remove the helper version of Choose, which was unused.
SmallAllocatorTest:
Test for the new class.
The rest:
Use SkSmallAllocator.
BUG=skia:1976
R=reed@google.com, mtklein@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/179343005
git-svn-id: http://skia.googlecode.com/svn/trunk@13696 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-07 03:24:41 +00:00
|
|
|
# Common gypi for unit tests.
|
2014-02-26 16:31:22 +00:00
|
|
|
{
|
|
|
|
'include_dirs': [
|
2015-04-09 19:43:10 +00:00
|
|
|
'../src/codec',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../src/core',
|
|
|
|
'../src/effects',
|
|
|
|
'../src/image',
|
|
|
|
'../src/lazy',
|
|
|
|
'../src/images',
|
|
|
|
'../src/pathops',
|
|
|
|
'../src/pdf',
|
|
|
|
'../src/pipe/utils',
|
|
|
|
'../src/utils',
|
|
|
|
'../src/utils/debugger',
|
|
|
|
|
|
|
|
# Needed for TDStackNesterTest.
|
|
|
|
'../experimental/PdfViewer',
|
|
|
|
'../experimental/PdfViewer/src',
|
|
|
|
],
|
|
|
|
'dependencies': [
|
|
|
|
'experimental.gyp:experimental',
|
2014-07-22 17:15:34 +00:00
|
|
|
'flags.gyp:flags_common',
|
2014-02-26 16:31:22 +00:00
|
|
|
'pdf.gyp:pdf',
|
2014-06-18 21:32:48 +00:00
|
|
|
'skia_lib.gyp:skia_lib',
|
2014-02-26 16:31:22 +00:00
|
|
|
'tools.gyp:picture_utils',
|
2014-06-20 18:29:20 +00:00
|
|
|
'tools.gyp:resources',
|
2014-06-21 17:54:17 +00:00
|
|
|
'tools.gyp:sk_tool_utils',
|
2014-02-26 16:31:22 +00:00
|
|
|
],
|
2014-07-22 20:56:34 +00:00
|
|
|
'conditions': [
|
2014-08-05 13:36:11 +00:00
|
|
|
[ 'skia_os == "android"', {
|
|
|
|
'include_dirs': [
|
|
|
|
'../src/ports',
|
|
|
|
],
|
|
|
|
'sources': [
|
|
|
|
'../tests/FontConfigParser.cpp',
|
|
|
|
],
|
|
|
|
}],
|
2014-07-22 20:56:34 +00:00
|
|
|
[ 'skia_android_framework == 1', {
|
|
|
|
'libraries': [
|
|
|
|
'-ldl',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2014-02-26 16:31:22 +00:00
|
|
|
'sources': [
|
|
|
|
'../tests/Test.cpp',
|
|
|
|
'../tests/Test.h',
|
|
|
|
|
|
|
|
'../tests/AAClipTest.cpp',
|
|
|
|
'../tests/ARGBImageEncoderTest.cpp',
|
|
|
|
'../tests/AnnotationTest.cpp',
|
2014-04-22 15:21:18 +00:00
|
|
|
'../tests/AsADashTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/AtomicTest.cpp',
|
2014-11-10 21:12:25 +00:00
|
|
|
'../tests/BadIcoTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/BitSetTest.cpp',
|
|
|
|
'../tests/BitmapCopyTest.cpp',
|
|
|
|
'../tests/BitmapGetColorTest.cpp',
|
|
|
|
'../tests/BitmapHasherTest.cpp',
|
|
|
|
'../tests/BitmapHeapTest.cpp',
|
|
|
|
'../tests/BitmapTest.cpp',
|
|
|
|
'../tests/BlendTest.cpp',
|
|
|
|
'../tests/BlitRowTest.cpp',
|
|
|
|
'../tests/BlurTest.cpp',
|
2014-10-24 18:16:19 +00:00
|
|
|
'../tests/CTest.cpp',
|
2014-10-08 12:17:12 +00:00
|
|
|
'../tests/CachedDataTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/CachedDecodingPixelRefTest.cpp',
|
2014-07-22 19:38:55 +00:00
|
|
|
'../tests/CanvasStateHelpers.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/CanvasStateTest.cpp',
|
|
|
|
'../tests/CanvasTest.cpp',
|
|
|
|
'../tests/ChecksumTest.cpp',
|
|
|
|
'../tests/ClampRangeTest.cpp',
|
|
|
|
'../tests/ClipCacheTest.cpp',
|
|
|
|
'../tests/ClipCubicTest.cpp',
|
|
|
|
'../tests/ClipStackTest.cpp',
|
|
|
|
'../tests/ClipperTest.cpp',
|
2015-03-27 19:16:53 +00:00
|
|
|
'../tests/CodexTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/ColorFilterTest.cpp',
|
|
|
|
'../tests/ColorPrivTest.cpp',
|
|
|
|
'../tests/ColorTest.cpp',
|
2015-02-13 23:12:52 +00:00
|
|
|
'../tests/CPlusPlusEleven.cpp',
|
2014-03-18 17:38:34 +00:00
|
|
|
'../tests/DashPathEffectTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/DataRefTest.cpp',
|
|
|
|
'../tests/DeferredCanvasTest.cpp',
|
2015-02-18 19:29:56 +00:00
|
|
|
'../tests/DeflateWStream.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/DequeTest.cpp',
|
|
|
|
'../tests/DeviceLooperTest.cpp',
|
2014-03-03 19:23:28 +00:00
|
|
|
'../tests/DiscardableMemoryPoolTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/DiscardableMemoryTest.cpp',
|
|
|
|
'../tests/DocumentTest.cpp',
|
|
|
|
'../tests/DrawBitmapRectTest.cpp',
|
2015-04-11 15:04:56 +00:00
|
|
|
'../tests/DrawFilterTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/DrawPathTest.cpp',
|
2015-03-26 20:40:09 +00:00
|
|
|
'../tests/DrawTextTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/DynamicHashTest.cpp',
|
|
|
|
'../tests/EmptyPathTest.cpp',
|
|
|
|
'../tests/ErrorTest.cpp',
|
|
|
|
'../tests/FillPathTest.cpp',
|
|
|
|
'../tests/FitsInTest.cpp',
|
|
|
|
'../tests/FlateTest.cpp',
|
2014-07-16 20:32:56 +00:00
|
|
|
'../tests/FloatingPointTextureTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/FontHostStreamTest.cpp',
|
|
|
|
'../tests/FontHostTest.cpp',
|
|
|
|
'../tests/FontMgrTest.cpp',
|
|
|
|
'../tests/FontNamesTest.cpp',
|
2014-07-08 17:33:28 +00:00
|
|
|
'../tests/FontObjTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/FrontBufferedStreamTest.cpp',
|
2015-03-31 21:24:27 +00:00
|
|
|
'../tests/FunctionTest.cpp',
|
2014-03-03 19:23:28 +00:00
|
|
|
'../tests/GLInterfaceValidationTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/GLProgramsTest.cpp',
|
|
|
|
'../tests/GeometryTest.cpp',
|
|
|
|
'../tests/GifTest.cpp',
|
|
|
|
'../tests/GpuColorFilterTest.cpp',
|
|
|
|
'../tests/GpuDrawPathTest.cpp',
|
2014-06-30 15:26:50 +00:00
|
|
|
'../tests/GpuLayerCacheTest.cpp',
|
2014-05-29 18:46:38 +00:00
|
|
|
'../tests/GpuRectanizerTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/GrContextFactoryTest.cpp',
|
|
|
|
'../tests/GrDrawTargetTest.cpp',
|
2014-09-05 13:13:43 +00:00
|
|
|
'../tests/GrAllocatorTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/GrMemoryPoolTest.cpp',
|
2014-02-27 20:23:22 +00:00
|
|
|
'../tests/GrOrderedSetTest.cpp',
|
2014-08-08 16:41:42 +00:00
|
|
|
'../tests/GrGLSLPrettyPrintTest.cpp',
|
2014-07-08 17:33:28 +00:00
|
|
|
'../tests/GrRedBlackTreeTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/GrSurfaceTest.cpp',
|
|
|
|
'../tests/GrTBSearchTest.cpp',
|
2014-10-15 20:43:48 +00:00
|
|
|
'../tests/GrTRecorderTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/GradientTest.cpp',
|
2015-02-12 21:20:08 +00:00
|
|
|
'../tests/HashTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/ImageCacheTest.cpp',
|
|
|
|
'../tests/ImageDecodingTest.cpp',
|
|
|
|
'../tests/ImageFilterTest.cpp',
|
2014-07-21 18:37:39 +00:00
|
|
|
'../tests/ImageGeneratorTest.cpp',
|
2014-08-19 21:29:02 +00:00
|
|
|
'../tests/ImageIsOpaqueTest.cpp',
|
2014-07-14 14:48:04 +00:00
|
|
|
'../tests/ImageNewShaderTest.cpp',
|
2015-03-18 13:03:29 +00:00
|
|
|
'../tests/IndexedPngOverflowTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/InfRectTest.cpp',
|
2014-06-26 20:07:05 +00:00
|
|
|
'../tests/InterpolatorTest.cpp',
|
2015-03-11 18:12:54 +00:00
|
|
|
'../tests/InvalidIndexedPngTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/JpegTest.cpp',
|
2014-06-06 13:16:28 +00:00
|
|
|
'../tests/KtxTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/LListTest.cpp',
|
|
|
|
'../tests/LayerDrawLooperTest.cpp',
|
2014-04-10 20:42:53 +00:00
|
|
|
'../tests/LayerRasterizerTest.cpp',
|
2014-10-21 19:20:04 +00:00
|
|
|
'../tests/LazyPtrTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/MD5Test.cpp',
|
|
|
|
'../tests/MallocPixelRefTest.cpp',
|
2014-10-23 14:58:17 +00:00
|
|
|
'../tests/MaskCacheTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/MathTest.cpp',
|
|
|
|
'../tests/Matrix44Test.cpp',
|
|
|
|
'../tests/MatrixClipCollapseTest.cpp',
|
|
|
|
'../tests/MatrixTest.cpp',
|
|
|
|
'../tests/MemoryTest.cpp',
|
|
|
|
'../tests/MemsetTest.cpp',
|
|
|
|
'../tests/MessageBusTest.cpp',
|
|
|
|
'../tests/MetaDataTest.cpp',
|
|
|
|
'../tests/MipMapTest.cpp',
|
2014-06-09 18:16:58 +00:00
|
|
|
'../tests/NameAllocatorTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/OSPathTest.cpp',
|
|
|
|
'../tests/OnceTest.cpp',
|
2014-12-12 19:28:16 +00:00
|
|
|
'../tests/PDFInvalidBitmapTest.cpp',
|
2014-08-27 20:00:54 +00:00
|
|
|
'../tests/PDFJpegEmbedTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/PDFPrimitivesTest.cpp',
|
2015-02-23 18:04:34 +00:00
|
|
|
'../tests/PMFloatTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/PackBitsTest.cpp',
|
|
|
|
'../tests/PaintTest.cpp',
|
|
|
|
'../tests/ParsePathTest.cpp',
|
|
|
|
'../tests/PathCoverageTest.cpp',
|
|
|
|
'../tests/PathMeasureTest.cpp',
|
|
|
|
'../tests/PathTest.cpp',
|
2014-10-30 18:44:19 +00:00
|
|
|
'../tests/PictureBBHTest.cpp',
|
2014-04-21 19:33:12 +00:00
|
|
|
'../tests/PictureShaderTest.cpp',
|
2014-07-08 17:33:28 +00:00
|
|
|
'../tests/PictureTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/PixelRefTest.cpp',
|
|
|
|
'../tests/PointTest.cpp',
|
|
|
|
'../tests/PremulAlphaRoundTripTest.cpp',
|
|
|
|
'../tests/QuickRejectTest.cpp',
|
2014-07-08 17:33:28 +00:00
|
|
|
'../tests/RTConfRegistryTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/RTreeTest.cpp',
|
|
|
|
'../tests/RandomTest.cpp',
|
|
|
|
'../tests/ReadPixelsTest.cpp',
|
|
|
|
'../tests/ReadWriteAlphaTest.cpp',
|
|
|
|
'../tests/Reader32Test.cpp',
|
2014-04-09 23:30:28 +00:00
|
|
|
'../tests/RecordDrawTest.cpp',
|
2014-09-03 18:04:30 +00:00
|
|
|
'../tests/RecordReplaceDrawTest.cpp',
|
2014-04-30 13:18:12 +00:00
|
|
|
'../tests/RecordOptsTest.cpp',
|
Add pattern matchers for SkRecord
This is a mid-level library for finding patterns of commands in an SkRecord. At the API level, it's a bit regex inspired. Some examples:
- Pattern1<Is<DrawRect>> matches a single DrawRect
- Pattern1<Star<Is<DrawRect>>> matches 0 or more DrawRects
- Pattern2<Is<ClipRect>, Is<DrawRect>> matches a single clip rect followed by a single draw rect
- Pattern3<Is<Save>, Star<IsDraw>, Is<Restore>> matches a single Save, followed by any number of Draws, followed by Restore
- Pattern1<Or<Is<DrawRect>, Is<ClipRect>>> matches a DrawRect or a ClipRect
- Pattern1<Not<Is<ClipRect>>> matches a command that's notClipRect.
Once you have a pattern, you can call .search() on it to step through ranges of matching commands. This means patterns can replace most of the custom iteration logic for optimization passes: the generic pattern searching steps through all the optimization candidates, which optimization-specific code further inspects and mutates.
SkRecordTraits is now unused. Bye bye!
Generated code and performance of SkRecordOpts is very similar to what it was before. (I had to use SK_ALWAYS_INLINE in a few places to make this so.)
BUG=skia:2378
R=fmalita@chromium.org, bungeman@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/263063002
git-svn-id: http://skia.googlecode.com/svn/trunk@14582 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-05 21:59:52 +00:00
|
|
|
'../tests/RecordPatternTest.cpp',
|
2014-04-08 17:31:08 +00:00
|
|
|
'../tests/RecordTest.cpp',
|
2014-04-08 20:17:26 +00:00
|
|
|
'../tests/RecorderTest.cpp',
|
2014-09-15 17:53:16 +00:00
|
|
|
'../tests/RecordingXfermodeTest.cpp',
|
2015-01-15 14:01:23 +00:00
|
|
|
'../tests/RectTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/RefCntTest.cpp',
|
|
|
|
'../tests/RefDictTest.cpp',
|
|
|
|
'../tests/RegionTest.cpp',
|
|
|
|
'../tests/ResourceCacheTest.cpp',
|
|
|
|
'../tests/RoundRectTest.cpp',
|
|
|
|
'../tests/RuntimeConfigTest.cpp',
|
|
|
|
'../tests/SHA1Test.cpp',
|
|
|
|
'../tests/ScalarTest.cpp',
|
|
|
|
'../tests/SerializationTest.cpp',
|
|
|
|
'../tests/ShaderImageFilterTest.cpp',
|
|
|
|
'../tests/ShaderOpacityTest.cpp',
|
2014-06-25 17:39:00 +00:00
|
|
|
'../tests/SizeTest.cpp',
|
Refactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>
The primary feature this delivers is SkNf and SkNd for arbitrary power-of-two N. Non-specialized types or types larger than 128 bits should now Just Work (and we can drop in a specialization to make them faster). Sk4s is now just a typedef for SkNf<4, SkScalar>; Sk4d is SkNf<4, double>, Sk2f SkNf<2, float>, etc.
This also makes implementing new specializations easier and more encapsulated. We're now using template specialization, which means the specialized versions don't have to leak out so much from SkNx_sse.h and SkNx_neon.h.
This design leaves us room to grow up, e.g to SkNf<8, SkScalar> == Sk8s, and to grown down too, to things like SkNi<8, uint16_t> == Sk8h.
To simplify things, I've stripped away most APIs (swizzles, casts, reinterpret_casts) that no one's using yet. I will happily add them back if they seem useful.
You shouldn't feel bad about using any of the typedef Sk4s, Sk4f, Sk4d, Sk2s, Sk2f, Sk2d, Sk4i, etc. Here's how you should feel:
- Sk4f, Sk4s, Sk2d: feel awesome
- Sk2f, Sk2s, Sk4d: feel pretty good
No public API changes.
TBR=reed@google.com
BUG=skia:3592
Review URL: https://codereview.chromium.org/1048593002
2015-03-30 17:50:27 +00:00
|
|
|
'../tests/SkNxTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/SkBase64Test.cpp',
|
2015-02-24 06:12:12 +00:00
|
|
|
'../tests/SkImageTest.cpp',
|
2014-09-02 18:50:59 +00:00
|
|
|
'../tests/SkResourceCacheTest.cpp',
|
Add a class to allocate small objects w/o extra calls to new.
Add SkSmallAllocator, a template for allocating small (as defined by the
instantiation) objects without extra calls to new. Add a helper macro to
make using it simple.
Remove SkTemplatesPriv.h, whose behavior is replaced by SkSmallAllocator.
The old SK_PLACEMENT_NEW had the following drawbacks:
- Easily confused with SkNEW_PLACEMENT.
- Requires passing around lots of void*s along with the storageSize.
- Requires using a separate class for deleting it.
- We had multiple ways Auto objects for deleting in different places.
- It always did a straight heap allocation on Windows, meaning Windows
did not get any advantages from the confusing code.
The new SkSmallAllocator simplifies things:
- It is clear about what it does.
- It takes care of the deletion in one place that is automatically
handled.
Further, the new class can be used to create more than one object. This
is in preparation for BUG=skia:1976, for which we would like to create
a new object without extra heap allocations. The plan is to create both
the blitter and the new object on the stack using the SkSmallAllocator.
Add a new test for SkSmallAllocator.
SkShader.h:
Move the private version of CreateBitmapShader to SkBitmapProcShader
(which already has the implementation) and remove the friend class
(which was only used to call this private function). This allows
SkSmallAllocator to reside in the private src/ directory.
SkBitmapProcShader:
Move CreateBitmapShader and the macro for the storage size here. With
the macro in a (private) header, the (private) headers with function
declarations (which now depend on the storage size used) can see the
macro.
Use SkSmallAllocator in CreateBitmapShader.
Change the macro to kBlitterStorageByteCount, since SkSmallAllocator
takes a byte count as its template parameter.
SkBlitter:
Use the SkSmallAllocator.
Remove Sk3DShader::fKillProc and SkAutoCallProc. Both of their
behaviors have been moved into SkSmallAllocator (SkAutoCallProc was
unnecessary anyway, because the only time we ever used it we also
called detach(), so its auto behavior never happened).
Create the Sk3DShader on the stack, if there's room.
Remove the helper version of Choose, which was unused.
SmallAllocatorTest:
Test for the new class.
The rest:
Use SkSmallAllocator.
BUG=skia:1976
R=reed@google.com, mtklein@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/179343005
git-svn-id: http://skia.googlecode.com/svn/trunk@13696 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-07 03:24:41 +00:00
|
|
|
'../tests/SmallAllocatorTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/SortTest.cpp',
|
|
|
|
'../tests/SrcOverTest.cpp',
|
|
|
|
'../tests/StreamTest.cpp',
|
|
|
|
'../tests/StringTest.cpp',
|
|
|
|
'../tests/StrokeTest.cpp',
|
Draw more accurate thick-stroked Beziers (disabled)
Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.
To try this CL out, change src/core/SkStroke.h:18 to
#define QUAD_STROKE_APPROXIMATION 1
or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia
Here's what's in this CL:
bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp : random Beziers with various thicknesses
gm/smallarc.cpp : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values
The new stroke algorithm has a tweakable parameter:
stroker.setError(1); (SkStrokeRec.cpp:112)
The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.
An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.
BUG=skia:723,skia:2769
Review URL: https://codereview.chromium.org/558163005
2014-10-09 12:36:03 +00:00
|
|
|
'../tests/StrokerTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/SurfaceTest.cpp',
|
2015-02-20 21:54:40 +00:00
|
|
|
'../tests/SVGDeviceTest.cpp',
|
2015-04-09 19:43:10 +00:00
|
|
|
'../tests/SwizzlerTest.cpp',
|
Tessellating GPU path renderer.
This path renderer converts paths to linear contours, resolves intersections via Bentley-Ottman, implements a trapezoidal decomposition a la Fournier and Montuno to produce triangles, and renders those with a single draw call. It does not currently do antialiasing, so it must be used in conjunction with multisampling.
A fair amount of the code is to handle floating point edge cases in intersections. Rather than perform exact computations (which would require arbitrary precision arithmetic), we reconnect the mesh to reflect the intersection points. For example, intersections can occur above the current vertex, and force edges to be merged into the current vertex, requiring a restart of the intersections. Splitting edges for intersections can also force them to merge with formerly-distinct edges in the same polygon, or to violate the ordering of the active edge list, or the active edge state of split edges.
BUG=skia:
Review URL: https://codereview.chromium.org/855513004
2015-02-26 14:58:17 +00:00
|
|
|
'../tests/TessellatingPathRendererTests.cpp',
|
2014-03-21 19:39:02 +00:00
|
|
|
'../tests/TArrayTest.cpp',
|
2015-04-08 14:33:33 +00:00
|
|
|
'../tests/TemplatesTest.cpp',
|
2015-02-13 19:08:21 +00:00
|
|
|
'../tests/TDPQueueTest.cpp',
|
2014-11-10 17:20:22 +00:00
|
|
|
'../tests/Time.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/TLSTest.cpp',
|
2014-08-21 22:03:04 +00:00
|
|
|
'../tests/TextBlobTest.cpp',
|
2014-06-11 19:26:49 +00:00
|
|
|
'../tests/TextureCompressionTest.cpp',
|
2014-03-03 19:23:28 +00:00
|
|
|
'../tests/ToUnicodeTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/TracingTest.cpp',
|
2014-03-03 19:23:28 +00:00
|
|
|
'../tests/TypefaceTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/UnicodeTest.cpp',
|
|
|
|
'../tests/UtilsTest.cpp',
|
2014-11-18 17:32:36 +00:00
|
|
|
'../tests/VarAllocTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
'../tests/WArrayTest.cpp',
|
|
|
|
'../tests/WritePixelsTest.cpp',
|
|
|
|
'../tests/Writer32Test.cpp',
|
|
|
|
'../tests/XfermodeTest.cpp',
|
2015-01-19 18:10:27 +00:00
|
|
|
'../tests/YUVCacheTest.cpp',
|
2014-02-26 16:31:22 +00:00
|
|
|
|
|
|
|
'../tests/MatrixClipCollapseTest.cpp',
|
|
|
|
'../src/utils/debugger/SkDrawCommand.h',
|
|
|
|
'../src/utils/debugger/SkDrawCommand.cpp',
|
|
|
|
'../src/utils/debugger/SkDebugCanvas.h',
|
|
|
|
'../src/utils/debugger/SkDebugCanvas.cpp',
|
|
|
|
'../src/utils/debugger/SkObjectParser.h',
|
|
|
|
'../src/utils/debugger/SkObjectParser.cpp',
|
|
|
|
|
|
|
|
'../tests/PipeTest.cpp',
|
|
|
|
'../src/pipe/utils/SamplePipeControllers.cpp',
|
|
|
|
|
|
|
|
'../tests/TDStackNesterTest.cpp',
|
|
|
|
'../experimental/PdfViewer/src/SkTDStackNester.h',
|
|
|
|
],
|
|
|
|
}
|