skia2/gn
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
..
toolchain clang on windows support 2017-07-31 18:39:23 +00:00
__init__.py Make gn directory importable in python 2017-03-20 17:40:30 +00:00
ar.py GN: quiet alink spam on Mac 2016-11-07 14:19:32 +00:00
bench.gni Retry cleaning up SkLinearBitmapPipeline. 2017-07-20 16:45:52 +00:00
BUILD.gn Tell clang/win to emulate MSVC 2015 2017-07-31 20:58:55 +00:00
BUILDCONFIG.gn clang on windows support 2017-07-31 18:39:23 +00:00
compile_processors.py switched to infra version of clang-format for skslc 2017-07-27 20:28:50 +00:00
core.gni Remove SkLightingShader and associated classes 2017-08-07 13:33:49 +00:00
cp.py GN: get Angle compiling on Windows. 2016-10-17 16:16:16 +00:00
effects.gni sRGB color filter 2017-07-25 14:27:33 +00:00
find_headers.py Revert "Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"" 2017-06-14 01:43:38 +00:00
find_ios_sysroot.py Add iOS simulator support in GN. 2017-03-13 17:21:43 +00:00
flutter_defines.gni Add GN arg to allow Flutter-specific API guards 2017-07-14 18:54:24 +00:00
gm.gni simplify gm matrices 2017-08-08 12:43:19 +00:00
gn_helpers.py Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
gn_meta_sln.py Move, rename, and document Visual Studio GN helper script 2016-12-14 16:41:52 +00:00
gn_to_bp.py Assume HQ is handled by pipeline, delete legacy code-path 2017-07-20 00:43:37 +00:00
gn_to_cmake.py Add support for lib_dirs to gn_to_cmake.py. 2016-10-28 15:07:10 +00:00
gpu.gni Add GrDebugMarkerOp 2017-08-08 13:23:20 +00:00
gypi_to_gn.py Add executable bit and shebang to python files 2016-08-18 04:36:25 -07:00
is_clang.py GN: match shell behavior for cc and cxx in is_clang.py 2016-09-27 09:29:24 -07:00
opts.gni Assume HQ is handled by pipeline, delete legacy code-path 2017-07-20 00:43:37 +00:00
package_ios.py Automate more parts of gn/package_ios.py. 2017-01-31 17:41:16 +00:00
pdf.gni SkPDF: simplify drawImage/Bitmap/Sprite code. 2017-07-12 20:41:41 +00:00
push_to_android.py skia_android_serial = "auto" 2017-01-12 16:30:17 +00:00
samples.gni Remove SkLightingShader and associated classes 2017-08-07 13:33:49 +00:00
shared_sources.gni Assume HQ is handled by pipeline, delete legacy code-path 2017-07-20 00:43:37 +00:00
sksl.gni converted GrBlurredEdgeFragmentProcessor to sksl 2017-07-14 20:46:34 +00:00
tests.gni Add support for object creation/snapshot/deletion events 2017-08-03 17:10:08 +00:00
utils.gni Added SkJSONWriter 2017-08-09 13:46:24 +00:00
xps.gni SkXPS: new document API. 2017-02-06 19:00:28 +00:00