skia2/tests
commit-bot@chromium.org 742058f0ca Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons
The GCC compilers for Android and Ubuntu do not seem to be able to
inline the memcmp operations on GrBinHashKey data. Write the comparisons
manually. Also shortcut GrBinHashKey::EQ to skip comparison when hashes
do not match.

Speeds up grresourcecache_find test on ARM and x86_64. Speeds up
grresourcecache_add on x86_64.

In order to test the change, moves ad hoc Gr unit tests from
src/gr_unittest.cpp to tests/GrUnitTests to be consistent with other
tests and enables GrUnitTests.

Fixes a regression from r2863 with where re-setting GrBinHashKey data
would not set the hash correctly. This should also improve the hash
function itself. The regression caused many of the hash operations be
no-ops. This is caught by the unit test.

Renames the comparison functions that GrHashTable needs from EQ, LT to
Equals, LessThan.

Renames GrTBinHashKey to GrBinHashKey. The GrTBinHashKey used to
forward comparison functions to an ENTRY template class, which would
extract the key and call back to the GrTBinHashKey. This would save
the user from writing one comparison function when comparison was done
with int ENTRY::compare(). There's no real benefit in this now. Also
this was used only for one class (GrTextureStripAtlas). The other use
in GrResourceKey was not actually using the provided "shortcut". The
new GrBinHashKey is not templated with the entry, rather just provides
== and < functions. The users of GrTHashTable provide the needed
functions now.

Adds explicit documentation of functions that are actually needed
GrTHashTable for the Key template. Adds SK_DEBUG guards according to
the contract.

R=bsalomon@google.com, mtklein@google.com

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/88113002

git-svn-id: http://skia.googlecode.com/svn/trunk@12426 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-11-28 08:24:29 +00:00
..
TestXCode/Tests.xcodeproj migrate more legacy unittests into tests/ 2009-03-07 03:39:23 +00:00
AAClipTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
AndroidPaintTest.cpp We don't flatten or unflatten SkPaintOptionsAndroid. Reproduce and fix. 2013-09-26 15:16:12 +00:00
AnnotationTest.cpp PDF: add support for named destinations. 2013-03-08 09:09:10 +00:00
ARGBImageEncoderTest.cpp store SkAlphaType inside SkBitmap, on road to support unpremul 2013-10-21 14:00:07 +00:00
AtomicTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
BitmapCopyTest.cpp Revert "Revert "remove kA1_Config, as it is no longer supported"" 2013-11-26 12:51:57 +00:00
BitmapFactoryTest.cpp "Fix" persistent failure of BitmapFactoryTest on debug RazrI 2013-03-21 20:54:42 +00:00
BitmapGetColorTest.cpp Revert "Revert "remove kA1_Config, as it is no longer supported"" 2013-11-26 12:51:57 +00:00
BitmapHasherTest.cpp store SkAlphaType inside SkBitmap, on road to support unpremul 2013-10-21 14:00:07 +00:00
BitmapHeapTest.cpp In SkBitmapHeap, defer adding owners for new bitmaps. 2012-11-16 20:34:37 +00:00
BitSetTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
BlitRowTest.cpp Revert "Revert "remove kA1_Config, as it is no longer supported"" 2013-11-26 12:51:57 +00:00
BlurTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
CachedDecodingPixelRefTest.cpp Add SkImageGenerator Interface 2013-11-21 15:32:08 +00:00
CanvasStateTest.cpp fix printing of error messages in canvasstatetest. 2013-09-18 20:15:12 +00:00
CanvasTest.cpp More clang warning fixes. 2013-10-21 16:41:00 +00:00
ChecksumTest.cpp Add SkChecksum::Murmur3. 2013-07-23 20:25:34 +00:00
ClampRangeTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
ClipCacheTest.cpp Avoid re-rendering stencil clip for every draw with reducable clip stack 2013-11-05 15:03:08 +00:00
ClipCubicTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
ClipperTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
ClipStackTest.cpp Avoid re-rendering stencil clip for every draw with reducable clip stack 2013-11-05 15:03:08 +00:00
ColorFilterTest.cpp force readbuffer clients to use specialized readFoo for flattenables 2013-10-16 13:05:06 +00:00
ColorTest.cpp More clang warning fixes. 2013-10-21 16:41:00 +00:00
DataRefTest.cpp Remove SkDataTable from SkFlattenable hierarchy. 2013-10-15 20:39:57 +00:00
DeferredCanvasTest.cpp "Fix" another crash in DeferredCanvasTest on valgrind bot 2013-11-13 14:26:52 +00:00
DequeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
DeviceLooperTest.cpp Fix Mac 10.6 DeviceLooperTest build error (this time with feeling) 2013-09-18 12:51:50 +00:00
DocumentTest.cpp Fix DocumentTest/SkDocument memory leaks 2013-11-18 16:26:25 +00:00
DrawBitmapRectTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
DrawPathTest.cpp promote SkImage::AlphaType to SkAlphaType 2013-09-20 19:33:52 +00:00
DrawTextTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
DynamicHashTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
EmptyPathTest.cpp Refactor: clean up some unused or mostly-unused API I saw here. 2013-06-18 20:50:34 +00:00
ErrorTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-09-20 07:01:33 +00:00
FillPathTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
FitsInTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
FlatDataTest.cpp use SkTDynamicHash in picture recording 2013-08-20 16:48:47 +00:00
FlateTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
FontHostStreamTest.cpp Address some more valgrind issues 2013-11-14 14:47:56 +00:00
FontHostTest.cpp onCharsToGlyphs to handle non-bmp on Mac. 2013-10-25 17:49:08 +00:00
FontMgrTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-09-20 07:01:33 +00:00
FontNamesTest.cpp Clean up SkTypes.h. 2013-10-11 18:50:45 +00:00
FrontBufferedStreamTest.cpp Hide implementation details: SkFrontBufferedStream 2013-11-12 20:53:05 +00:00
GeometryTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
GifTest.cpp GIF decode: optional error messages and fault tolerance. 2013-10-11 18:21:56 +00:00
GLInterfaceValidation.cpp Simplify the GL interface validation test. 2013-03-11 20:22:38 +00:00
GLProgramsTest.cpp Implement SkColorFilter as a GrGLEffect 2013-10-23 05:42:03 +00:00
GpuBitmapCopyTest.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00
GpuColorFilterTest.cpp Implement SkColorFilter as a GrGLEffect 2013-10-23 05:42:03 +00:00
GpuDrawPathTest.cpp Temporarily disable GpuTestPath. 2013-08-05 14:50:31 +00:00
GradientTest.cpp Split SkDevice into SkBaseDevice and SkBitmapDevice 2013-08-29 11:54:56 +00:00
GrContextFactoryTest.cpp Add --threads to tests binary, to run non-GPU tests on multiple cores. 2013-04-19 13:24:28 +00:00
GrDrawTargetTest.cpp Avoid printing draw target info to stderr while running unit tests 2013-11-21 15:23:15 +00:00
GrMemoryPoolTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
GrSurfaceTest.cpp Reland of 8525 with fix for case when GrRT outlives GrTexture. 2013-04-09 15:04:12 +00:00
GrUnitTests.cpp Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons 2013-11-28 08:24:29 +00:00
HashCacheTest.cpp Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons 2013-11-28 08:24:29 +00:00
ImageCacheTest.cpp Trying to add the same scaled image twice shouldn't assert. 2013-11-27 20:22:23 +00:00
ImageDecodingTest.cpp Revert "Revert "remove kA1_Config, as it is no longer supported"" 2013-11-26 12:51:57 +00:00
ImageFilterTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
InfRectTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
JpegTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
LayerDrawLooperTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
LListTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
MathTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
Matrix44Test.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00
MatrixTest.cpp Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. 2013-11-05 15:46:56 +00:00
MD5Test.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-31 20:28:24 +00:00
MemoryTest.cpp Add sk_calloc. Remove SkMemory_stdlib, which seems unused. 2013-09-20 14:31:45 +00:00
MemsetTest.cpp combine glyph and image bulk alloc, and adjust initial alloc size, to reduce total waste from 50% to 30% 2013-06-19 19:25:36 +00:00
MessageBusTest.cpp We want to give SkPixelRef a way to signal over to GrResourceCache that it's become pointless to keep around textures based on that SkPixelRef when its pixels change, so that it can be a good citizen and free those textures. 2013-10-24 17:44:27 +00:00
MetaDataTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
MipMapTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
OnceTest.cpp SK_ONCE for SkData and SkPathRef 2013-10-23 14:44:08 +00:00
OSPathTest.cpp Fix bug in setting directories for tests. 2013-06-06 14:59:56 +00:00
PackBitsTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
PaintTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
ParsePathTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
PathCoverageTest.cpp Tests : Unused parameters cleanup 2013-02-27 19:17:41 +00:00
PathMeasureTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
PathOpsAngleTest.cpp I feel like my clang is especially sensitive to unused variables. 2013-11-22 20:43:54 +00:00
PathOpsBoundsTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsCubicIntersectionTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsCubicIntersectionTestData.cpp path ops work in progress 2013-10-02 14:49:34 +00:00
PathOpsCubicIntersectionTestData.h Make parallel unit testing work on windows 2013-04-10 15:55:37 +00:00
PathOpsCubicLineIntersectionTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsCubicQuadIntersectionTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsCubicReduceOrderTest.cpp remove more unused static functions 2013-11-25 15:05:05 +00:00
PathOpsCubicToQuadsTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsDCubicTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsDLineTest.cpp turn off debugging printfs 2013-07-23 15:27:41 +00:00
PathOpsDPointTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsDQuadTest.cpp pathops work in progress 2013-11-01 17:36:03 +00:00
PathOpsDRectTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsDTriangleTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-02 07:02:02 +00:00
PathOpsDVectorTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsExtendedTest.cpp pathops work in progress 2013-11-01 17:36:03 +00:00
PathOpsExtendedTest.h harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsInverseTest.cpp path ops : add support for inverse fill 2013-04-22 14:37:05 +00:00
PathOpsLineIntersectionTest.cpp fix line intersection 2013-11-08 18:00:01 +00:00
PathOpsLineParametetersTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsOpCubicThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsOpRectThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsOpTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
PathOpsQuadIntersectionTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsQuadIntersectionTestData.cpp path ops work in progress 2013-10-02 14:49:34 +00:00
PathOpsQuadIntersectionTestData.h Add intersections for path ops 2013-04-08 11:50:00 +00:00
PathOpsQuadLineIntersectionTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsQuadLineIntersectionThreadedTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsQuadParameterizationTest.cpp path ops work in progress 2013-04-15 19:13:59 +00:00
PathOpsQuadReduceOrderTest.cpp remove unused reduce order code 2013-11-25 14:18:21 +00:00
PathOpsSimplifyDegenerateThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsSimplifyFailTest.cpp path ops work in progress 2013-09-16 15:55:01 +00:00
PathOpsSimplifyQuadralateralsThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsSimplifyQuadThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsSimplifyRectThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsSimplifyTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-26 07:02:21 +00:00
PathOpsSimplifyTrianglesThreadedTest.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsSkpClipTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-02 07:02:02 +00:00
PathOpsSkpTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-09 07:02:23 +00:00
PathOpsTestCommon.cpp Sanitizing source files in Housekeeper-Nightly 2013-07-17 07:01:13 +00:00
PathOpsTestCommon.h harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
PathOpsThreadedCommon.cpp path ops work in progress 2013-09-16 15:55:01 +00:00
PathOpsThreadedCommon.h pathops work in progress 2013-11-01 17:36:03 +00:00
PathOpsTypesTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-02 07:02:02 +00:00
PathTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
PathUtilsTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
PDFPrimitivesTest.cpp Use SkPicture::ExtractBitmap callback in pdf too, there is no need for a specialized function pointer for pdf only only to pass a rectangle, when we can use subseted bitmaps. 2013-10-03 19:29:21 +00:00
PictureTest.cpp Expose SkPicture::willPlayBackBitmaps() 2013-10-24 11:12:47 +00:00
PictureUtilsTest.cpp Updated make_filepath test to reflect changes in picture_utils. TBR 2012-07-13 18:43:39 +00:00
PipeTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
PixelRefTest.cpp We want to give SkPixelRef a way to signal over to GrResourceCache that it's become pointless to keep around textures based on that SkPixelRef when its pixels change, so that it can be a good citizen and free those textures. 2013-10-24 17:44:27 +00:00
PointTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
PremulAlphaRoundTripTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
QuickRejectTest.cpp Added toString to SkDrawLooper-derived classes 2013-01-28 20:21:59 +00:00
RandomTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
Reader32Test.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
ReadPixelsTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
ReadWriteAlphaTest.cpp Remove GrRefCnt.h in favor of SkRefCnt.h 2013-09-09 13:38:37 +00:00
RefCntTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
RefDictTest.cpp Extended Inst counting to find "unknown" leaked object (SkTMaskGamma) 2012-08-16 14:58:06 +00:00
RegionTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
ResourceCacheTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-08-09 07:01:22 +00:00
RoundRectTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
RTreeTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
RuntimeConfigTest.cpp New SkRTConf macro SK_CONF_TRY_SET: no complaint on missing configuration 2013-11-06 15:07:44 +00:00
ScalarTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SerializationTest.cpp Fix Valgrind reports of test branching on uninitialized data. 2013-11-27 17:00:12 +00:00
SHA1Test.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-31 20:28:24 +00:00
ShaderImageFilterTest.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00
ShaderOpacityTest.cpp store SkAlphaType inside SkBitmap, on road to support unpremul 2013-10-21 14:00:07 +00:00
Sk64Test.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
skia_test.cpp GpuTest::GetContext() doesn't exist. 2013-11-20 17:59:54 +00:00
SkpSkGrTest.cpp Sanitizing source files in Housekeeper-Nightly 2013-11-02 07:02:02 +00:00
SortTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SrcOverTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
StreamTest.cpp Add a detachAsStream to SkDynamicMemoryWStream. 2013-07-19 22:32:11 +00:00
StringTest.cpp DM: write failed comparison mode .pngs one more level deep in the tree. 2013-11-26 22:06:12 +00:00
StrokeTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SurfaceTest.cpp Fix crash in tests on valgrind bot 2013-11-12 13:51:03 +00:00
TDStackNesterTest.cpp Changes to SkTDStackNester. 2013-11-20 21:40:57 +00:00
Test.cpp harden and speed up path op unit tests 2013-07-16 16:11:16 +00:00
Test.h Rewrite SkTRegistry to take any trivially-copyable type. 2013-09-04 17:20:18 +00:00
TestClassDef.h Add an even more convenient way to declare tests, with example. 2013-09-19 20:56:46 +00:00
TestSize.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
TileGridTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
TLSTest.cpp Tests : Unused parameters cleanup 2013-02-27 19:17:41 +00:00
ToUnicode.cpp pdf: write only ToUnicode mappings needed by the font, trimming anything out of [firstChar, lastChar] interval. 2013-09-18 19:29:08 +00:00
TSetTest.cpp Deterministic SkTSet and PDF Output 2013-07-24 01:51:08 +00:00
Typeface.cpp Update Android's FontHost to return NULL if familyName does not match 2013-09-19 12:08:40 +00:00
UnicodeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
UnitTestTest.cpp Fix crash when querying a runtime config that is defined in environment 2013-08-14 18:14:37 +00:00
UtilsTest.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
valgrind.supp Address some more valgrind issues 2013-11-14 14:47:56 +00:00
WArrayTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
WritePixelsTest.cpp Remove unnamed namespace usage from tests. 2013-10-12 17:25:17 +00:00
Writer32Test.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00
XfermodeTest.cpp Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00