skia2/gyp
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
..
android_deps.gyp Update DEPS and GYP to use the copy of Android in platform_tools. 2013-05-02 12:27:21 +00:00
android_system.gyp Update DEPS and GYP to use the copy of Android in platform_tools. 2013-05-02 12:27:21 +00:00
angle.gyp move to newer angle 2013-11-27 15:43:22 +00:00
animator.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
apptype_console.gypi Update Skia Android tools. 2013-08-12 12:30:04 +00:00
bench.gyp Fold bench source file list into bench.gyp. 2013-11-27 00:44:03 +00:00
chromeos_deps.gyp GYP Changes and Scripts for Compiling Skia for ChromeOS 2013-06-11 15:52:19 +00:00
cityhash.gyp Re-land r9059 with empty cityhash.gyp, instead of deleted cityhash.gyp 2013-05-08 16:04:02 +00:00
common_conditions.gypi optimize pathops coverage 2013-11-21 17:04:29 +00:00
common_variables.gypi Hook in rough distance field support for fonts 2013-11-11 20:54:09 +00:00
common.gypi remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
core.gyp ARM Skia NEON patches - 30 - Xfermode: NEON modeprocs 2013-10-17 16:29:34 +00:00
core.gypi Revert "Revert "remove kA1_Config, as it is no longer supported"" 2013-11-26 12:51:57 +00:00
debugger.gyp Revert r11342 (Add infrastructure for testing the debugger code) due to build breakages 2013-09-18 13:28:10 +00:00
dm.gyp DM: add --tileGrid 2013-11-26 23:36:51 +00:00
edtaa.gyp Hook in rough distance field support for fonts 2013-11-11 20:54:09 +00:00
effects.gyp Implement SSE2-based implementations of the morphology filters (dilate & erode). This gives a 3-5X speedup over the naive implementation, and also mitigates a timing-based security attack in Chrome (https://code.google.com/p/chromium/issues/detail?id=251711). 2013-10-30 21:57:04 +00:00
effects.gypi Remove SkLumaXfermode. 2013-10-14 13:11:11 +00:00
everything.gyp Include pdfviewer in everything. 2013-11-14 15:46:25 +00:00
experimental.gyp Changes to SkTDStackNester. 2013-11-20 21:40:57 +00:00
FileReaderApp.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
flags.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
fontconfig.gyp Sanitizing source files in Housekeeper-Nightly 2013-08-21 07:01:29 +00:00
freetype.gyp Add libpoppler for PDF rendering, take 2 2013-08-20 18:57:01 +00:00
freetype.gypi Sanitizing source files in Housekeeper-Nightly 2013-08-21 07:01:29 +00:00
gm.gyp Pdfviewer refactoring. 2013-11-14 19:09:27 +00:00
gmslides.gypi Non-rect polygons are not covered in GM cases, such as triangle, trapezoid, diamond, polygons with lots of edges, concave polygons, etc, especially for stroke-style and stroke-and-fill style painters. So add a GM case to avoid potential rendering errors. 2013-11-27 01:24:53 +00:00
gpu.gyp Hook in rough distance field support for fonts 2013-11-11 20:54:09 +00:00
gpu.gypi Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons 2013-11-28 08:24:29 +00:00
gputest.gyp Fix android doubly defined empty string due to static lib and shared lib thing. 2013-08-21 20:50:50 +00:00
iconv.gyp Sanitizing source files in Housekeeper-Nightly 2013-08-21 07:01:29 +00:00
images.gyp Add SkImageGenerator Interface 2013-11-21 15:32:08 +00:00
jsoncpp.gyp quiet down more third-party warnings in poppler and jsoncpp 2013-09-30 18:19:26 +00:00
libjpeg.gyp Sanitizing source files in Housekeeper-Nightly 2013-06-11 07:01:17 +00:00
libwebp.gyp A fix for annoying clang error "unused-const-variabl" in third_party code. 2013-10-28 22:05:12 +00:00
lua.gyp use define to work-around localeconf() missingness in android 2013-05-15 20:55:49 +00:00
most.gyp pathops work in progress 2013-11-01 17:36:03 +00:00
nacl.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
opts.gyp ARM Skia NEON patches - 16/17 - Blitmask 2013-11-27 17:08:36 +00:00
pathops_unittest.gyp path ops work in progress 2013-10-02 14:49:34 +00:00
pathops_unittest.gypi path ops work in progress 2013-10-02 14:49:34 +00:00
pathops.gypi path ops work in progress 2013-09-16 15:55:01 +00:00
pdf.gyp Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten the path and the text when we have perspective. 2013-10-14 13:42:12 +00:00
pdf.gypi Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten the path and the text when we have perspective. 2013-10-14 13:42:12 +00:00
pdfviewer_lib.gyp Move PdfTokenLooper into its own file. 2013-11-20 23:12:25 +00:00
pdfviewer.gyp Pdfviewer refactoring. 2013-11-14 19:09:27 +00:00
pixman_test.gyp GYP Changes and Scripts for Compiling Skia for ChromeOS 2013-06-11 15:52:19 +00:00
poppler.gyp Add extra warnings to match what Android uses. 2013-11-20 15:13:49 +00:00
ports.gyp allow both GDI and DW fontmgrs at the same time 2013-08-21 15:20:43 +00:00
public_headers.gypi Remove unused header SkImageTypes.h 2013-10-16 17:02:28 +00:00
SampleApp.gyp Pdfviewer refactoring. 2013-11-14 19:09:27 +00:00
sfnt.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
shapeops_demo.gyp GYP Changes and Scripts for Compiling Skia for ChromeOS 2013-06-11 15:52:19 +00:00
shapeops_edge.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
shapeops_tool.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
SimpleCocoaApp.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
SimpleiOSApp.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
skia_lib.gyp refactor gyp to isolate freetype usage 2013-07-22 14:12:56 +00:00
skpskgr_test.gyp pathops work in progress 2013-11-01 17:36:03 +00:00
svg.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
tests.gyp Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons 2013-11-28 08:24:29 +00:00
tools.gyp fix multithread related crashes in skpdiff 2013-11-12 18:29:17 +00:00
utils.gyp pdfviewer: compile pdfviewer in gm, only if the flag is set (currently we compile pdfviewer, even if it is not used) 2013-11-12 17:44:28 +00:00
views_animated.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
views.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
xml.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00
xps.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
zlib.gyp Update obvious deps. 2013-07-22 14:39:45 +00:00