History log of /external/skia/tests/GrMemoryPoolTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e4cd00699167cefde9abedbd49ede64f82d552c7 29-Nov-2016 dskiba <dskiba@chromium.org> Make GrMemoryPool play nice with bucketing allocators.

Some memory allocators have very coarse size buckets, so for example on
Android (jemalloc) an attempt to allocate 32 KiB + 1 byte will end up
allocating 40 KiB, wasting 8 KiB.

GrMemoryPool ctor takes two arguments that specify prealloc / block sizes,
and then inflates them to accommodate some bookkeeping structures. Since
most places create GrMemoryPools with pow2 numbers (which have buckets in
most allocators) the inflation causes allocator to select next size bucket,
wasting memory.

This CL makes GrMemoryPool to stop inflating sizes it was created with, and
allocate specified amounts exactly. Part of allocated memory is then used for
bookkeeping structures. Additionally, GrObjectMemoryPool template is provided,
which takes prealloc / block object counts (instead of sizes) and guarantees
that specified number of objects will fit in prealloc / block spaces.

BUG=651872
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2525773002

Review-Url: https://codereview.chromium.org/2525773002
/external/skia/tests/GrMemoryPoolTest.cpp
145dbcd165d9d27298eb8888bc240e2d06a95464 03-Nov-2016 Ben Wagner <bungeman@google.com> Remove SkAutoTDelete.

Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/tests/GrMemoryPoolTest.cpp
fc6c37b981daeece7474ce61070c707c37eefa62 27-Sep-2016 Mike Klein <mtklein@chromium.org> Remove stray semicolons.

Turns out function declarations don't end in semicolons...

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2720

No public API changes.
TBR=reed@google.com

Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb
Reviewed-on: https://skia-review.googlesource.com/2720
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/tests/GrMemoryPoolTest.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/tests/GrMemoryPoolTest.cpp
ebc1c10fe1befb4f8025e825d3fb6012c145c593 07-Aug-2015 bsalomon <bsalomon@google.com> Fix warnings on VS2015 x86_64 build

TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1276133002
/external/skia/tests/GrMemoryPoolTest.cpp
2766c00fc0b6a07d46e5f74cdad45da2ef625237 26-Jun-2015 mtklein <mtklein@chromium.org> remove SkInstCnt

It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
/external/skia/tests/GrMemoryPoolTest.cpp
6f07665768dc84453316e7b2bbd6049576764cb1 13-Jan-2015 mtklein <mtklein@chromium.org> Simplify SkInstCnt

This code requires fewer macros to use it (just one), has less code in macro
definitions, and has simpler synchronization code (just atomic ints, no SkOnce,
no SkMutex, etc.)

A minor downside, we lose indentation and reverse-ordering in the final report:
Leaked SkRefCntBase: 7
Leaked SkFontMgr: 1
Leaked SkWeakRefCnt: 1
Leaked SkTypeface: 1
Leaked SkFlattenable: 3
Leaked SkXfermode: 3
Leaked SkPathRef: 1
Leaked SkPixelRef: 1
Leaked SkMallocPixelRef: 1
becomes
Leaked SkXfermode: 3
Leaked SkMallocPixelRef: 1
Leaked SkPixelRef: 1
Leaked SkPathRef: 1
Leaked SkFlattenable: 3
Leaked SkTypeface: 1
Leaked SkWeakRefCnt: 1
Leaked SkFontMgr: 1
Leaked SkRefCntBase: 7

This is motivated by wanting to land https://codereview.chromium.org/806473006/,
which makes sure all static use of SkOnce are in global scope. The current
implementation of SkInstCnt uses them in function scope, which isn't safe.
BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/841263004
/external/skia/tests/GrMemoryPoolTest.cpp
8f6884aab8aecd7657cf3f9cdbc682f0deca29c5 24-Jan-2014 tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> 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
/external/skia/tests/GrMemoryPoolTest.cpp
e2eac8b2fd8966cc9af51f8d40151dad6c591d2e 14-Jan-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> 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
/external/skia/tests/GrMemoryPoolTest.cpp
e4fafb146e85cdfcf9d5418597b6818aa0754ada 12-Dec-2013 tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Use DEFINE_TESTCLASS_SHORT macro in tests.

The three version of DEFINE_TESTCLASS macro is deprecated and thus just
use the simple, short one.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
ab1c13864df34aecfd4840ea7d1e4f8730b44f4e 05-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix compilation with SK_ENABLE_INST_COUNT=1

Add INHERITED declarations to class declarations that prevent
compilation with the flag.

Remove SK_DEFINE_INST_COUNT from all class implementations. Instead,
use function-local static variables in the reference count helper
classes to create the global instances to store the needed info. The
accessor functions are defined inline in the helper classes, so
definitions are not needed. The initialization point of the variables
should be as well defined as previously.

Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT
instead. This avoids possible future compilation errors further.

For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member
function to all classes that use SK_DECLARE_INST_COUNT and
SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes
contain public INHERITED typedef. This member function seems to be
compiled away. This shouĺd ensure that part of the compilation errors
are caught earlier.

Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses.

R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
ddf94cf108ae430877f009bd67b9070341426947 12-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove unnamed namespace usage from tests.

Skia code prefers static over unnamed namespace.

BUG=None
TEST=None
R=bsalomon@google.com, robertphillips@google.com

Author: tfarina@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11747 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
e0e7cfe44bb9d66d76120a79e5275c294bacaa22 09-Sep-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Change old PRG to be SkLCGRandom; change new one to SkRandom

The goal here is to get people to start using the new random number
generator, while leaving the old one in place so we don't have to
rebaseline GMs.

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

Author: jvanverth@google.com

Review URL: https://chromiumcodereview.appspot.com/23576015

git-svn-id: http://skia.googlecode.com/svn/trunk@11169 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
9d1cff124c14e550889a5755ffa5e6537af7c8c8 18-Apr-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> use SkAutoTDelete instead of SkTScopedPtr
Review URL: https://codereview.chromium.org/13831011

git-svn-id: http://skia.googlecode.com/svn/trunk@8749 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
c490f801b063a0837501feab3d12b73d71f46312 04-Mar-2013 jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Change random number generator for 'tests' to SkMWCRandom. Also removes some
unused headers and fixes a couple of bugs exposed by changing the random
number generator:

First, the function SkMatrix::getMaxStretch() had an error where it was testing
the square of a number against near-zero. This led to it occasionally taking a
cheaper but imprecise path for computing the eigenvalues of the matrix. It's
been replaced with a check against the square of SK_ScalarNearlyZero.

The second case was a failure in ClipStackTest, where it hit the rare case of
a practically empty clip stack (it has a single Union) and we set a tight
bounds. The bounds rect doesn't get set by GrReducedClip::ReduceClipStack() in
this case, so when it clips the reduced stack it's clipping against garbage,
and the resulting regions don't match. The solution is to initialize the
tightBounds rect.


git-svn-id: http://skia.googlecode.com/svn/trunk@7952 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
4e23068b374023d43c4c725138d523721d975892 15-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Re-enable inst counting in debug builds.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7098066

git-svn-id: http://skia.googlecode.com/svn/trunk@7206 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
a9590fc00c4aa2fd34329e552e6396c457702a76 21-Aug-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed compilation issue when instance counting is disabled

http://codereview.appspot.com/6462089/



git-svn-id: http://skia.googlecode.com/svn/trunk@5210 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
a68937c950847cea2eb7064ef5b63feb82ed3a71 03-Aug-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Move SK_SUPPORT_GPU checks below first #includes in case the macro is defined in SkUserConfig.h rather than by the build system.



git-svn-id: http://skia.googlecode.com/svn/trunk@4948 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
cf8fb1f6f03fc77f9927564f9ef9abeeeec508d2 02-Aug-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Create GPU-less build of Skia.



git-svn-id: http://skia.googlecode.com/svn/trunk@4912 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
b74af872cc1ce45768df3ae03fa86ad3ed76b582 27-Jun-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Separated Inst counting from the SK_DEBUG #define (now SK_ENABLE_INST_COUNT)

http://codereview.appspot.com/6353047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4376 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp
4da34e36cb7a07c3a28ae2a135b1837c26fc7aea 19-Jun-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add GrMemoryPool as a helper to override operators new/delete

Review URL: http://codereview.appspot.com/6306090/



git-svn-id: http://skia.googlecode.com/svn/trunk@4282 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/GrMemoryPoolTest.cpp