Commit Graph

5 Commits

Author SHA1 Message Date
Brian Osman
7c2114fc2f Cache GrColorSpaceXforms
Even with a modest cache, we're going to get nearly 100% hit rate
for typical usage scenarios. I'm hoping to avoid the special case
caching of sRGB -> destination, and just rely on the more general
mechanism.

Yes, this is yet-another cache class. I wanted to use one of many
that are laying around, but couldn't find a good fit. On the plus
side, it's not much code.

BUG=skia:

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

Change-Id: I943be5c99f0d691a87ffe8c5bc3067a8eb491fc2
Reviewed-on: https://skia-review.googlesource.com/3726
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-20 20:47:33 +00:00
mtklein
e86e51fe7e Add reminders that these classes have constexpr default constructors.
We can do this now that we can write "constexpr".

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936653002

Review-Url: https://codereview.chromium.org/1936653002
2016-04-29 13:58:18 -07:00
halcanary
7b0b2ca435 Make Cmake work with debug build
Before this CL, the following failed to link:

    cd .../skia
    git fetch
    git checkout origin/master
    git clean -ffdx
    SKIA="$PWD"
    cd $(mktemp -d);
    cmake "${SKIA}/cmake" -DCMAKE_BUILD_TYPE=Debug -G Ninja
    ninja
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1757993006

Review URL: https://codereview.chromium.org/1757993006
2016-03-04 08:30:05 -08:00
mtklein
15923c9e47 Modernize SkSpinlock.
- Use std::atomic directly.
 - No more need for SkPODSpinlock or SK_DECLARE_STATIC_SPINLOCK.

Now simple code like this works as you'd hope:
    static SkSpinlock gLock;

That is, it starts unlocked and there's no static initializer.

std::atomic_flag would make this terser and standard-guaranteed,
but ATOMIC_FLAG_INIT caused not-yet-implemented errors on MSVC 2013.
The generated code for this approach is identical.

It appears the implicit constructor is constexpr when all the member
initializers are.  I'm hoping this way of producing constexpr constructors
without typing "constexpr" gives us a way to eliminate more SkFoo / SkBaseFoo
distinctions and SK_DECLARE_STATIC_FOO.  This was certainly the easiest.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734383002

Review URL: https://codereview.chromium.org/1734383002
2016-02-29 10:14:38 -08:00
herb
62a69c26b3 Move Mutexy things to private.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1368333004
2015-09-29 11:47:45 -07:00