skia2/tools/debugger/JsonWriteBuffer.h
Mike Klein c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00

59 lines
2.1 KiB
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef JsonWriteBuffer_DEFINED
#define JsonWriteBuffer_DEFINED
#include "src/core/SkWriteBuffer.h"
class SkJSONWriter;
class SkPath;
class UrlDataManager;
class JsonWriteBuffer final : public SkWriteBuffer {
public:
JsonWriteBuffer(SkJSONWriter* writer, UrlDataManager* urlDataManager)
: fUrlDataManager(urlDataManager), fWriter(writer), fCount(0) {}
void writePad32(const void* buffer, size_t bytes) override;
void writeByteArray(const void* data, size_t size) override;
void writeBool(bool value) override;
void writeScalar(SkScalar value) override;
void writeScalarArray(const SkScalar* value, uint32_t count) override;
void writeInt(int32_t value) override;
void writeIntArray(const int32_t* value, uint32_t count) override;
void writeUInt(uint32_t value) override;
void writeString(const char* value) override;
void writeFlattenable(const SkFlattenable* flattenable) override;
void writeColor(SkColor color) override;
void writeColorArray(const SkColor* color, uint32_t count) override;
void writeColor4f(const SkColor4f& color) override;
void writeColor4fArray(const SkColor4f* color, uint32_t count) override;
void writePoint(const SkPoint& point) override;
void writePointArray(const SkPoint* point, uint32_t count) override;
void writePoint3(const SkPoint3& point) override;
void writeMatrix(const SkMatrix& matrix) override;
void writeIRect(const SkIRect& rect) override;
void writeRect(const SkRect& rect) override;
void writeRegion(const SkRegion& region) override;
void writePath(const SkPath& path) override;
size_t writeStream(SkStream* stream, size_t length) override;
void writeImage(const SkImage*) override;
void writeTypeface(SkTypeface* typeface) override;
void writePaint(const SkPaint& paint) override;
private:
void append(const char* type);
UrlDataManager* fUrlDataManager;
SkJSONWriter* fWriter;
int fCount;
};
#endif