Go to file
Mike Klein 37bbfe3ea4 Make SkASSERT and co. constexpr compatible.
One of the nice bits of constexpr is that an expression is constexpr if
there exists any set of argument values that make it constant.  It
doesn't have to be constant for _all_ argument values.

This means that this expression is constexpr:

   condition ? constexpr_value
             : []{ arbitrary non-constexpr code; }();

... it's constant when condition is true.

We can use this to rewrite SkASSERT(condition) as

    ( (condition) ? (void)0
                  : []{ SK_ABORT(#condition); }() )

Both sides of the ?: are void, and when condition is true at compile
time the right hand side disappears completely.  In C++11 constexpr
functions we just have to use the comma operator to jam SkASSERT()
into the order of evaluation:

    constexpr uint32_t foo(int x, int y) {
        return SkASSERT(x > y),
               x - y;
    }

Change-Id: I21878d14fb2af76d93591d2ae229460ee825cfde
Reviewed-on: https://skia-review.googlesource.com/52663
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-29 13:49:04 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap" 2017-09-27 23:15:07 +00:00
bin add a Win/Clang build bot 2017-07-31 19:53:51 +00:00
debugger Revert "Revert "Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget."""" 2017-08-31 20:04:12 +00:00
dm Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap" 2017-09-27 23:15:07 +00:00
docs feedback 2017-09-21 16:50:10 +00:00
example More iOS Fixes for SkiaSDLExample. 2017-09-05 20:34:55 +00:00
experimental Fix SkSVGDOM length & presentation context scoping 2017-09-09 14:06:28 +00:00
fuzz Fuzz: use SkNullWStream 2017-08-29 17:41:36 +00:00
gm Revert "Revert "migrate to sk_sp for SkFontMgr API"" 2017-09-26 14:05:18 +00:00
gn Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"""" 2017-09-29 13:48:54 +00:00
include Make SkASSERT and co. constexpr compatible. 2017-09-29 13:49:04 +00:00
infra Roll recipe dependencies (trivial). 2017-09-28 19:34:08 +00:00
platform_tools Enable ios on Raspberry Pi 2017-04-25 16:56:41 +00:00
resources Avoid uninitialized memory in readByteArrayAsData 2017-09-28 19:51:32 +00:00
samplecode Miscellaneous dynamic atlas fixes. 2017-09-28 19:38:42 +00:00
site Update docs on Skia bots. 2017-09-28 13:45:37 +00:00
src Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"""" 2017-09-29 13:48:54 +00:00
tests Avoid uninitialized memory in readByteArrayAsData 2017-09-28 19:51:32 +00:00
third_party Remove unused param to SkGIFFrameContext ctor 2017-09-28 17:53:27 +00:00
tools Remove unused functions get_preferred_size 2017-09-26 20:02:16 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore clang on windows support 2017-07-31 18:39:23 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Added support for building for tvOS 2017-03-14 22:55:04 +00:00
BUILD.gn [WASM] Add POC compile bot for WebAssembly 2017-09-21 18:24:43 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll skia/third_party/externals/angle2/ a9c60e9f9..2a9e107c0 (1 commit) 2017-09-29 11:04:24 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
PRESUBMIT.py Fix job name in PRESUBMIT.py. 2017-09-28 17:26:37 +00:00
public.bzl Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap" 2017-09-27 23:15:07 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Revert "Whitespace change to test Android autoroller" 2017-09-07 15:25:02 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.