Commit Graph

6 Commits

Author SHA1 Message Date
tfarina@chromium.org
68f3a3e0b0 Reland "Unwrap GrRedBlackTree unit test and use REPORTER_ASSERT()."
BUG=None
TEST=tests
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13233 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-29 23:56:40 +00:00
commit-bot@chromium.org
01260b2dbc Revert of Unwrap GrRedBlackTree unit test and use REPORTER_ASSERT(). (https://codereview.chromium.org/147713002/)
Reason for revert:
broke http://108.170.217.252:10115/builders/Build-Mac10.8-Clang-x86_64-Release/builds/2908/steps/Retry_BuildTests/logs/stdio and other builders:

GrRedBlackTreeTest.cpp:24:36: error: use of undeclared identifier 'xi'


Original issue's description:
> Unwrap GrRedBlackTree unit test and use REPORTER_ASSERT().
>
> This fixes the mtklein's TODO in GrUnitTests.cpp.
>
> BUG=None
> TEST=out/Debug/tests
> R=mtklein@google.com, robertphillips@google.com
>
> Committed: https://code.google.com/p/skia/source/detail?r=13208

R=mtklein@google.com, robertphillips@google.com, reed@google.com, tfarina@chromium.org
TBR=mtklein@google.com, reed@google.com, robertphillips@google.com, tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=None

Author: epoger@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13209 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-27 21:54:18 +00:00
tfarina@chromium.org
0fba15125b Unwrap GrRedBlackTree unit test and use REPORTER_ASSERT().
This fixes the mtklein's TODO in GrUnitTests.cpp.

BUG=None
TEST=out/Debug/tests
R=mtklein@google.com, robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13208 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-27 21:40:14 +00:00
tfarina@chromium.org
8f6884aab8 Cleanup: Sanitize the order of includes under tests/
Initially this was to make sure Test.h appeared after the Sk*.h includes.

Patch generated by the following command line:

$ ~/chromium/src/tools/sort-headers.py tests/*.cpp

BUG=None
TEST=tests
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-24 20:56:26 +00:00
commit-bot@chromium.org
e2eac8b2fd Move macros from TestClassDef.h to Test.h
Motivation: those macros don't make any sense without the definitions
in Test.h.

BUG=
R=mtklein@google.com

Author: halcanary@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-14 21:04:37 +00:00
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