Go to file
Brian Osman 69fd008199 Added SkJSONWriter
This is a stand-alone helper class for writing properly
structured JSON to an SkWStream. It currently solves two
problems (although this CL only uses it in one context):

1) Performance. Writing out JSON this way is about 10x
faster than using JSONCPP. For the large amounts of data
generated by the tracing system, that's a big win.

2) Makes it easy to emit structured JSON from code that's
not fully centralized. We'd like to spit out JSON that
describes a GrContext, GrGpu, GrCaps, etc... Doing that
with simple string manipulation is complex, and spreads
this logic over all those functions. Using JSONCPP adds
yet another (large) third party library dependency (that
we only build into our own tools right now).

This went through several revisions. I originally planned
it as a stateful SkString wrapper, so the user could just
build their JSON as a string. That's O(N^2), though,
because SkString grows by a (small) constant amount. Even
using a better growth strategy still means needing RAM
for all the resulting text, which is usually pointless.
This version has a constant memory cost, so writing huge
amounts of JSON to disk (tracing a long DM run can emit
100's of MBs) doesn't stress resources.

Bug: skia:
Change-Id: Ia716524b246db0f97d332da60d2ce9903069e748
Reviewed-on: https://skia-review.googlesource.com/31204
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-08-09 13:46:24 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench clean up useage of SkFloatBits 2017-08-07 02:49:29 +00:00
bin add a Win/Clang build bot 2017-07-31 19:53:51 +00:00
debugger Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
dm simplify gm matrices 2017-08-08 12:43:19 +00:00
docs fix links and missing constructor 2017-08-04 17:25:24 +00:00
example Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
experimental Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
fuzz Remove SkTypeface::Style from fuzzers and lua. 2017-08-08 15:27:19 +00:00
gm simplify gm matrices 2017-08-08 12:43:19 +00:00
gn Added SkJSONWriter 2017-08-09 13:46:24 +00:00
include Tiling support for GrGradientEffect kTwo_ColorType/kThree_ColorType 2017-08-08 15:27:36 +00:00
infra Revert "Bring recipes up to date." 2017-08-09 13:03:15 +00:00
platform_tools Enable ios on Raspberry Pi 2017-04-25 16:56:41 +00:00
resources Remove SkTypeface::Style from fuzzers and lua. 2017-08-08 15:27:19 +00:00
samplecode Remove SkTypeface::Style from fuzzers and lua. 2017-08-08 15:27:19 +00:00
site fix Vulkan doc typo 2017-08-07 16:53:19 +00:00
src Added SkJSONWriter 2017-08-09 13:46:24 +00:00
tests use rasterpipeline for images if matrix is >= scale+translate 2017-08-08 21:32:42 +00:00
third_party link libwebpmux in system-webp builds 2017-08-01 14:33:38 +00:00
tools Added SkJSONWriter 2017-08-09 13:46:24 +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 15-bit lowp is dead, long live 8-bit lowp 2017-08-04 05:19:38 +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/ 188fd5f6f..3c76d59f1 (1 commit) 2017-08-07 16:58: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 Update CQ extra trybots after switch to Debian 2017-06-29 19:35:40 +00:00
public.bzl add flag for google3, need to update test 2017-08-08 23:28:38 +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 "Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp"" 2017-07-19 12:17:34 +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.