new batch of docs
new batch of docs
Docs-Preview: https://skia.org/?cl=141244
Bug: skia:
Change-Id: I5a285778baaee2734495374adeb7359d524e47e3
Reviewed-on: https://skia-review.googlesource.com/141244
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 5bf8e1b..433743b 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -77,6 +77,7 @@
# ------------------------------------------------------------------------------
#Method virtual bool allocPixelRef(SkBitmap* bitmap) = 0
+#Line # allocates pixel memory ##
Allocates the pixel memory for the bitmap, given its dimensions and
Color_Type. Returns true on success, where success means either setPixels
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index dabec68..c310b11 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -5444,15 +5444,15 @@
Draws Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
-Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
-Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
-Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
-Subpixel_Text, and Paint_Vertical_Text.
+#paint_font_metrics#.
Paint_Text_Encoding must be set to SkPaint::kGlyphID_TextEncoding.
-Elements of paint: Path_Effect, Mask_Filter, Shader, Color_Filter,
-Image_Filter, and Draw_Looper; apply to blob.
+Elements of paint: Anti_Alias, Blend_Mode, Color including Color_Alpha,
+Color_Filter, Paint_Dither, Draw_Looper, Mask_Filter, Path_Effect, Shader, and
+Paint_Style; apply to blob. If Paint contains SkPaint::kStroke_Style:
+Paint_Miter_Limit, Paint_Stroke_Cap, Paint_Stroke_Join, and Paint_Stroke_Width;
+apply to Path created from blob.
#Param blob Glyphs, positions, and their paints' text size, typeface, and so on ##
#Param x horizontal offset applied to blob ##
@@ -5497,10 +5497,7 @@
Draws Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
-Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
-Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
-Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
-Subpixel_Text, and Paint_Vertical_Text.
+#paint_font_metrics#.
Paint_Text_Encoding must be set to SkPaint::kGlyphID_TextEncoding.
diff --git a/docs/SkDynamicMemoryWStream_Reference.bmh b/docs/SkDynamicMemoryWStream_Reference.bmh
new file mode 100644
index 0000000..ad7da9e
--- /dev/null
+++ b/docs/SkDynamicMemoryWStream_Reference.bmh
@@ -0,0 +1,252 @@
+#Topic DynamicMemoryWStream
+#Alias DynamicMemoryWStream_Reference ##
+
+#Class SkDynamicMemoryWStream
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkDynamicMemoryWStream()
+#In Constructor
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method ~SkDynamicMemoryWStream() override
+#In Constructor
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool write(const void* buffer, size_t size) override
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t bytesWritten() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool read(void* buffer, size_t offset, size_t size)
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param offset incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void copyTo(void* dst) const
+#In incomplete
+#Line # incomplete ##
+
+Copies bytes read to dst.
+
+#Param dst incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeToStream(SkWStream* dst) const
+#In incomplete
+#Line # incomplete ##
+
+#Param dst incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void copyToAndReset(void* dst)
+#In incomplete
+#Line # incomplete ##
+
+Copies bytes read to dst, and resets stream to start.
+Internally, frees memory as it is copied, reducing total memory
+use on large streams.
+
+#Param dst incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeToAndReset(SkWStream* dst)
+#In incomplete
+#Line # incomplete ##
+
+Writes bytes read to dst, and resets stream to start.
+Internally, frees memory as it is copied, reducing total memory
+use on large streams.
+
+Stream is reset: data memory is released and stream length is set to zero;
+regardless of whether the write was successful.
+
+#Param dst incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method sk_sp<SkData> detachAsData()
+#In incomplete
+#Line # incomplete ##
+
+Return the contents as SkData, and then reset the stream.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkStreamAsset> detachAsStream()
+#In incomplete
+#Line # incomplete ##
+
+Reset, returning a reader stream with the current content.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void reset()
+#In incomplete
+#Line # incomplete ##
+
+Reset the stream to its original, empty, state.
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void padToAlign4()
+#In incomplete
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkDynamicMemoryWStream ##
+
+#Topic DynamicMemoryWStream ##
diff --git a/docs/SkFILEStream_Reference.bmh b/docs/SkFILEStream_Reference.bmh
new file mode 100644
index 0000000..e0f6135
--- /dev/null
+++ b/docs/SkFILEStream_Reference.bmh
@@ -0,0 +1,284 @@
+#Topic FILEStream
+#Alias FILEStream_Reference ##
+
+#Class SkFILEStream
+
+A stream that wraps a C FILE* file stream. */
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method explicit SkFILEStream(const char path[] = nullptr)
+#In Constructor
+#Line # incomplete ##
+
+Initializes Stream by reading data contained by path.
+File descriptor is opened here and is closed when SkFILEStream
+Destructor is invoked.
+
+#Param path incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method explicit SkFILEStream(FILE* file)
+#In Constructor
+#Line # incomplete ##
+
+Initialize the stream with an existing C_FILE stream.
+The current position of the C_FILE stream will be considered the
+beginning of the SkFILEStream.
+The C_FILE stream is closed when SkFILEStream Destructor is invoked.
+
+#Param file incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method ~SkFILEStream() override
+#In Constructor
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static std::unique_ptr<SkFILEStream> Make(const char path[])
+#In incomplete
+#Line # incomplete ##
+
+#Param path incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isValid() const
+#In incomplete
+#Line # incomplete ##
+
+Returns true if the current path could be opened.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void close()
+#In incomplete
+#Line # incomplete ##
+
+Close this SkFILEStream.
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t read(void* buffer, size_t size) override
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isAtEnd() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool rewind() override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkStreamAsset> duplicate() const
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t getPosition() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool seek(size_t position) override
+#In incomplete
+#Line # incomplete ##
+
+#Param position incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool move(long offset) override
+#In incomplete
+#Line # incomplete ##
+
+#Param offset incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkStreamAsset> fork() const
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t getLength() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkFILEStream ##
+
+#Topic FILEStream ##
diff --git a/docs/SkFILEWStream_Reference.bmh b/docs/SkFILEWStream_Reference.bmh
new file mode 100644
index 0000000..7dde5a1
--- /dev/null
+++ b/docs/SkFILEWStream_Reference.bmh
@@ -0,0 +1,135 @@
+#Topic FILEWStream
+#Alias FILEWStream_Reference ##
+
+#Class SkFILEWStream
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkFILEWStream(const char path[])
+#In Constructor
+#Line # incomplete ##
+
+#Param path incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method ~SkFILEWStream() override
+#In Constructor
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isValid() const
+#In incomplete
+#Line # incomplete ##
+
+Returns true if the current path could be opened.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool write(const void* buffer, size_t size) override
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void flush() override
+#In incomplete
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void fsync()
+#In incomplete
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t bytesWritten() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkFILEWStream ##
+
+#Topic FILEWStream ##
diff --git a/docs/SkMemoryStream_Reference.bmh b/docs/SkMemoryStream_Reference.bmh
new file mode 100644
index 0000000..0287131
--- /dev/null
+++ b/docs/SkMemoryStream_Reference.bmh
@@ -0,0 +1,451 @@
+#Topic MemoryStream
+#Alias MemoryStream_Reference ##
+
+#Class SkMemoryStream
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkMemoryStream()
+#In Constructor
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkMemoryStream(size_t length)
+#In Constructor
+#Line # incomplete ##
+
+We allocate (and free) the memory. Write to it via getMemoryBase()
+
+#Param length incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkMemoryStream(const void* data, size_t length, bool copyData = false)
+#In Constructor
+#Line # incomplete ##
+
+If copyData is true, the stream makes a private copy of the data.
+
+#Param data incomplete ##
+#Param length incomplete ##
+#Param copyData incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkMemoryStream(sk_sp<SkData> data)
+#In Constructor
+#Line # incomplete ##
+
+Creates the stream to read from the specified data
+
+#Param data incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static std::unique_ptr<SkMemoryStream> MakeCopy(const void* data, size_t length)
+#In incomplete
+#Line # incomplete ##
+
+Returns a stream with a copy of the input data.
+
+#Param data incomplete ##
+#Param length incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static std::unique_ptr<SkMemoryStream> MakeDirect(const void* data, size_t length)
+#In incomplete
+#Line # incomplete ##
+
+Returns a stream with a bare pointer reference to the input data.
+
+#Param data incomplete ##
+#Param length incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static std::unique_ptr<SkMemoryStream> Make(sk_sp<SkData> data)
+#In incomplete
+#Line # incomplete ##
+
+Returns a stream with a shared reference to the input data.
+
+#Param data incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual void setMemory(const void* data, size_t length,
+ bool copyData = false)
+#In incomplete
+#Line # incomplete ##
+
+Resets the stream to the specified data and length,
+just like the constructor.
+if copyData is true, the stream makes a private copy of the data
+
+#Param data incomplete ##
+#Param length incomplete ##
+#Param copyData incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void setMemoryOwned(const void* data, size_t length)
+#In incomplete
+#Line # incomplete ##
+
+#Private
+##
+
+#Param data incomplete ##
+#Param length incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method sk_sp<SkData> asData() const
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void setData(sk_sp<SkData> data)
+#In incomplete
+#Line # incomplete ##
+
+#Param data incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void skipToAlign4()
+#In incomplete
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const void* getAtPos()
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t read(void* buffer, size_t size) override
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isAtEnd() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t peek(void* buffer, size_t size) const override
+#In incomplete
+#Line # incomplete ##
+
+#Param buffer incomplete ##
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool rewind() override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkMemoryStream> duplicate() const
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t getPosition() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool seek(size_t position) override
+#In incomplete
+#Line # incomplete ##
+
+#Param position incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool move(long offset) override
+#In incomplete
+#Line # incomplete ##
+
+#Param offset incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkMemoryStream> fork() const
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t getLength() const override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const void* getMemoryBase() override
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkMemoryStream ##
+
+#Topic MemoryStream ##
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index 28847b8..55cd01a 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -395,9 +395,9 @@
# ------------------------------------------------------------------------------
#Method SkPath()
-
+#In Constructor
#Line # constructs with default values ##
-Constucts an empty path. By default, Path has no Verbs, no Points, and no Weights.
+Constucts an empty Path. By default, Path has no Verbs, no Points, and no Weights.
Fill_Type is set to kWinding_FillType.
#Return empty Path ##
@@ -417,7 +417,7 @@
# ------------------------------------------------------------------------------
#Method SkPath(const SkPath& path)
-
+#In Constructor
#Line # makes a shallow copy ##
Constructs a copy of an existing path.
Copy constructor makes two paths identical by value. Internally, path and
@@ -515,7 +515,7 @@
#StdOut ##
##
-#SeeAlso swap() SkPath(const SkPath& path)
+#SeeAlso swap SkPath(const SkPath& path)
##
@@ -523,7 +523,7 @@
#Method bool operator==(const SkPath& a, const SkPath& b)
-#Line # compares paths for equality ##
+#Line # compares Paths for equality ##
Compares a and b; returns true if Fill_Type, Verb_Array, Point_Array, and Weights
are equivalent.
@@ -560,6 +560,8 @@
##
##
+#SeeAlso operator!=(const SkPath& a, const SkPath& b) operator=(const SkPath& path)
+
##
# ------------------------------------------------------------------------------
@@ -588,14 +590,14 @@
debugster("empty", one, two);
one.addRect({10, 20, 30, 40});
two.addRect({10, 20, 30, 40});
- debugster("addRect", one, two);
+ debugster("add rect", one, two);
one.setConvexity(SkPath::kConcave_Convexity);
debugster("setConvexity", one, two);
SkDebugf("convexity %c=\n", one.getConvexity() == two.getConvexity() ? '=' : '!');
}
#StdOut
empty one == two
-addRect one == two
+add rect one == two
setConvexity one == two
convexity !=
##
@@ -1275,7 +1277,7 @@
#Line # returns if verb count is zero ##
Returns if Path is empty.
Empty Path may have FillType but has no SkPoint, Verb, or Conic_Weight.
-SkPath() constructs empty Path; reset() and (rewind) make Path empty.
+SkPath() constructs empty Path; reset() and rewind() make Path empty.
#Return true if the path contains no Verb array ##
@@ -5414,6 +5416,7 @@
##
#Method Iter(const SkPath& path, bool forceClose)
+#Line # constructs Path iterator ##
Sets Iter to return elements of Verb_Array, Point_Array, and Conic_Weight in path.
If forceClose is true, Iter will add kLine_Verb and kClose_Verb after each
@@ -5473,7 +5476,7 @@
##
#Method void setPath(const SkPath& path, bool forceClose)
-
+#Line # resets Iter to Path ##
Sets Iter to return elements of Verb_Array, Point_Array, and Conic_Weight in path.
If forceClose is true, Iter will add kLine_Verb and kClose_Verb after each
open Contour. path is not altered.
@@ -5532,6 +5535,7 @@
##
#Method Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
+#Line # returns next Verb ##
Returns next Verb in Verb_Array, and advances Iter.
When Verb_Array is exhausted, returns kDone_Verb.
@@ -5625,7 +5629,7 @@
##
#Method SkScalar conicWeight() const
-
+#Line # returns Conic_Weight ##
Returns Conic_Weight if next() returned kConic_Verb.
If next() has not been called, or next() did not return kConic_Verb,
@@ -5879,7 +5883,7 @@
investigated to see if the change is correct or not.
see change 21340 (abandoned for now)
- #SeeAlso next()
+ #SeeAlso next
##
diff --git a/docs/SkPicture_Reference.bmh b/docs/SkPicture_Reference.bmh
index 8ad642a..3445504 100644
--- a/docs/SkPicture_Reference.bmh
+++ b/docs/SkPicture_Reference.bmh
@@ -139,7 +139,14 @@
#In Constructor
#Line # constructs Picture from stream ##
-Recreates a picture that was serialized into a stream.
+Recreates Picture that was serialized into a stream. Returns constructed Picture
+if successful; otherwise, returns nullptr. Fails if data does not permit
+constructing valid Picture.
+
+procs.fPictureProc permits supplying a custom function to decode Picture.
+If procs.fPictureProc is nullptr, default decoding is used. procs.fPictureCtx
+may be used to provide user context to procs.fPictureProc; procs.fPictureProc
+is called with a pointer to data, data byte length, and user context.
#Param stream container for serial data ##
#Param procs custom serial data decoders; may be nullptr ##
@@ -172,7 +179,14 @@
#In Constructor
#Line # constructs Picture from data ##
-Recreates a picture that was serialized into data.
+Recreates Picture that was serialized into data. Returns constructed Picture
+if successful; otherwise, returns nullptr. Fails if data does not permit
+constructing valid Picture.
+
+procs.fPictureProc permits supplying a custom function to decode Picture.
+If procs.fPictureProc is nullptr, default decoding is used. procs.fPictureCtx
+may be used to provide user context to procs.fPictureProc; procs.fPictureProc
+is called with a pointer to data, data byte length, and user context.
#Param data container for serial data ##
#Param procs custom serial data decoders; may be nullptr ##
@@ -207,7 +221,14 @@
#Param size size of data ##
#Param procs custom serial data decoders; may be nullptr ##
-Recreates a picture that was serialized into data.
+Recreates Picture that was serialized into data. Returns constructed Picture
+if successful; otherwise, returns nullptr. Fails if size is smaller than
+required data length, or if data does not permit constructing valid Picture.
+
+procs.fPictureProc permits supplying a custom function to decode Picture.
+If procs.fPictureProc is nullptr, default decoding is used. procs.fPictureCtx
+may be used to provide user context to procs.fPictureProc; procs.fPictureProc
+is called with a pointer to data, data byte length, and user context.
#Return Picture constructed from data ##
@@ -328,10 +349,15 @@
#Method sk_sp<SkData> serialize(const SkSerialProcs* procs = nullptr) const
#In Utility
-#Line # writes Picture to data ##
-Returns storage containing data describing Picture, using optional custom
+#Line # writes Picture to Data ##
+Returns storage containing Data describing Picture, using optional custom
encoders.
+procs.fPictureProc permits supplying a custom function to encode Picture.
+If procs.fPictureProc is nullptr, default encoding is used. procs.fPictureCtx
+may be used to provide user context to procs.fPictureProc; procs.fPictureProc
+is called with a pointer to Picture and user context.
+
#Param procs custom serial data encoders; may be nullptr ##
#Return storage containing serialized Picture ##
@@ -358,6 +384,11 @@
#Method void serialize(SkWStream* stream, const SkSerialProcs* procs = nullptr) const
Writes picture to stream, using optional custom encoders.
+procs.fPictureProc permits supplying a custom function to encode Picture.
+If procs.fPictureProc is nullptr, default encoding is used. procs.fPictureCtx
+may be used to provide user context to procs.fPictureProc; procs.fPictureProc
+is called with a pointer to Picture and user context.
+
#Param stream writable serial data stream ##
#Param procs custom serial data encoders; may be nullptr ##
diff --git a/docs/SkRRect_Reference.bmh b/docs/SkRRect_Reference.bmh
index 633239a..3a0c136 100644
--- a/docs/SkRRect_Reference.bmh
+++ b/docs/SkRRect_Reference.bmh
@@ -537,7 +537,7 @@
#In Property
#Line # returns corner radii for simple types ##
-Returns top-left corner x-radii. If type() returns kEmpty_Type, kRect_Type,
+Returns top-left corner radii. If type() returns kEmpty_Type, kRect_Type,
kOval_Type, or kSimple_Type, returns a value representative of all corner radii.
If type() returns kNinePatch_Type or kComplex_Type, at least one of the
remaining three corners has a different value.
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index 49eff9e..e06b943 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -1528,10 +1528,10 @@
Returns true if: fLeft <= x < fRight && fTop <= y < fBottom.
Returns false if SkRect is empty.
-#Param x test SkPoint x-coordinate ##
-#Param y test SkPoint y-coordinate ##
+#Param x test Point x-coordinate ##
+#Param y test Point y-coordinate ##
-#Return true if (x, y) is inside SkRect ##
+#Return true if (x, y) is inside Rect ##
#Example
SkRect rect = { 30, 50, 40, 60 };
diff --git a/docs/SkRegion_Reference.bmh b/docs/SkRegion_Reference.bmh
new file mode 100644
index 0000000..b664e27
--- /dev/null
+++ b/docs/SkRegion_Reference.bmh
@@ -0,0 +1,1954 @@
+#Topic Region
+#Alias Region_Reference ##
+#Alias Regions ##
+
+Region is a compressed one bit mask. Region describes an aliased clipping area
+on integer boundaries. Region can also describe an array of integer rectangles.
+
+Canvas uses Region to reduce the current clip. Region may be drawn to Canvas;
+Paint determines if Region is filled or stroked, its Color, and so on.
+
+Region may be constructed from IRect array or Path. Diagonal lines and curves
+in Path become integer rectangle edges. Regions operators compute union,
+intersection, difference, and so on. Canvas allows only intersection and
+difference; successive clips can only reduce available Canvas area.
+
+#PhraseDef list_of_op_types
+kDifference_Op, kIntersect_Op, kUnion_Op, kXOR_Op, kReverseDifference_Op,
+kReplace_Op
+##
+
+#Class SkRegion
+
+SkRegion describes the set of pixels used to clip Canvas. SkRegion is compact,
+efficiently storing a single integer rectangle, or a run length encoded array
+of rectangles. SkRegion may reduce the current Canvas_Clip, or may be drawn as
+one or more integer rectangles. SkRegion iterator returns the scan lines or
+rectangles contained by it, optionally intersecting a bounding rectangle.
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constant
+#Populate
+##
+
+#Subtopic Class
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Operator
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Class Iterator
+#Line # iterator returning IRect ##
+
+#Code
+ class Iterator {
+ public:
+ Iterator();
+ Iterator(const SkRegion& region);
+ bool rewind();
+ void reset(const SkRegion& region);
+ bool done() const;
+ void next();
+ const SkIRect& rect();
+ const SkRegion* rgn();
+ };
+##
+
+Returns sequence of rectangles, sorted along y-axis, then x-axis, that make
+up Region.
+
+# ------------------------------------------------------------------------------
+
+#Method Iterator()
+#Line # constructs Region iterator ##
+Initializes Iterator with an empty Region. done() on Iterator returns true.
+Call reset() to initialized Iterator at a later time.
+
+#Return empty Region ierator ##
+
+#Example
+ SkRegion::Iterator iter;
+ SkRegion region;
+ region.setRect({1, 2, 3, 4});
+ iter.reset(region);
+ auto r = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+rect={1,2,3,4}
+##
+##
+
+#SeeAlso reset SkRegion
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method Iterator(const SkRegion& region)
+#Line # constructs Region iterator ##
+Sets Iterator to return elements of IRect array in region.
+#Param region Region to iterate ##
+
+#Return Region iterator ##
+
+#Example
+ SkRegion region;
+ region.setRect({1, 2, 3, 4});
+ SkRegion::Iterator iter(region);
+ auto r = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+rect={1,2,3,4}
+##
+##
+
+#SeeAlso reset SkRegion Cliperator Spanerator
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool rewind()
+#Line # points Iterator to start ##
+
+Points Iterator to start of Region.
+Returns true if Region was set; otherwise, returns false.
+
+#Return true if Region was set ##
+
+#Example
+#Bug 8186
+ auto debugster = [](const char* label, SkRegion::Iterator& iter, bool addRewind) -> void {
+ if (addRewind) {
+ bool success = iter.rewind();
+ SkDebugf("%14s rewind success=%s\n", label, success ? "true" : "false");
+ }
+ auto r = iter.rect();
+ SkDebugf("%14s rect={%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion::Iterator iter;
+ debugster("empty iter", iter, true);
+ SkRegion region;
+ iter.reset(region);
+ debugster("empty region", iter, true);
+ region.setRect({1, 2, 3, 4});
+ iter.reset(region);
+ debugster("after set rect", iter, false);
+ debugster("after rewind", iter, true);
+#StdOut
+#Volatile
+ empty iter rewind success=false
+ empty iter rect={0,0,0,0}
+ empty region rewind success=true
+ empty region rect={0,0,0,0}
+after set rect rect={1,2,3,4}
+ after rewind rewind success=true
+ after rewind rect={1,2,3,4}
+##
+##
+
+#SeeAlso reset
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void reset(const SkRegion& region)
+#Line # sets Region to iterate ##
+
+Resets iterator, using the new Region.
+
+#Param region Region to iterate ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion::Iterator& iter) -> void {
+ SkDebugf("%14s: done=%s\n", label, iter.done() ? "true" : "false");
+ };
+ SkRegion region;
+ SkRegion::Iterator iter(region);
+ debugster("empty region", iter);
+ region.setRect({1, 2, 3, 4});
+ debugster("after set rect", iter);
+ iter.reset(region);
+ debugster("after reset", iter);
+#StdOut
+ empty region: done=true
+after set rect: done=true
+ after reset: done=false
+##
+##
+
+#SeeAlso rewind
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool done() const
+#Line # returns if data parsing is complete ##
+
+Returns true if Iterator is pointing to final IRect in Region.
+
+#Return true if data parsing is complete ##
+
+#Example
+ SkRegion region;
+ SkRegion::Iterator iter(region);
+ SkDebugf("done=%s\n", iter.done() ? "true" : "false");
+ region.setRect({1, 2, 3, 4});
+ iter.rewind();
+ SkDebugf("done=%s\n", iter.done() ? "true" : "false");
+#StdOut
+done=true
+done=false
+##
+##
+
+#SeeAlso next rect
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void next()
+#Line # advances to next IRect ##
+
+Advances Iterator to next IRect in Region if it is not done.
+
+#Example
+ SkRegion region;
+ SkIRect rects[] = {{1, 2, 3, 4}, {5, 6, 7, 8}};
+ region.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkRegion::Iterator iter(region);
+ do {
+ auto r2 = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r2.fLeft, r2.fTop, r2.fRight, r2.fBottom);
+ iter.next();
+ } while (!iter.done());
+#StdOut
+rect={1,2,3,4}
+rect={5,6,7,8}
+##
+##
+
+#SeeAlso done rect
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const SkIRect& rect() const
+#Line # returns part of Region as IRect ##
+
+Returns IRect element in Region. Does not return predictable results if Region
+is empty.
+
+#Return part of Region as IRect ##
+
+#Example
+#Bug 8186
+ SkRegion region;
+ SkRegion::Iterator iter(region);
+ auto r1 = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r1.fLeft, r1.fTop, r1.fRight, r1.fBottom);
+ region.setRect({1, 2, 3, 4});
+ iter.rewind();
+ auto r2 = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r2.fLeft, r2.fTop, r2.fRight, r2.fBottom);
+#StdOut
+#Volatile
+rect={0,0,0,0}
+rect={1,2,3,4}
+##
+##
+
+#SeeAlso next done
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const SkRegion* rgn() const
+#Line # returns original Region ##
+
+Returns Region if set; otherwise, returns nullptr.
+
+#Return iterated Region ##
+
+#Example
+ SkRegion region;
+ SkIRect rects[] = {{1, 2, 3, 4}, {3, 4, 5, 6}};
+ region.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkRegion::Iterator iter(region);
+ auto r = iter.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+ auto b = iter.rgn()->getBounds();
+ SkDebugf("bounds={%d,%d,%d,%d}\n", b.fLeft, b.fTop, b.fRight, b.fBottom);
+##
+
+#SeeAlso Iterator reset
+
+#Method ##
+
+#Class Iterator ##
+
+# ------------------------------------------------------------------------------
+
+#Class Cliperator
+#Line # iterator returning IRect within clip ##
+
+#Code
+ class SK_API Cliperator {
+ public:
+ Cliperator(const SkRegion&, const SkIRect& clip);
+ bool done();
+ void next();
+ const SkIRect& rect() const;
+ };
+##
+
+Returns the sequence of rectangles, sorted along y-axis, then x-axis, that make
+up Region intersected with the specified clip rectangle.
+
+# ------------------------------------------------------------------------------
+
+#Method Cliperator(const SkRegion& region, const SkIRect& clip)
+#Line # constructs Region iterator with clip ##
+
+Sets Cliperator to return elements of IRect array in Region within clip.
+
+#Param region Region to iterate ##
+#Param clip bounds of iteration ##
+
+#Return Region iterator ##
+
+#Example
+ SkRegion region;
+ region.setRect({1, 2, 3, 4});
+ SkRegion::Cliperator clipper(region, {0, 0, 2, 3});
+ auto r = clipper.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+rect={1,2,2,3}
+##
+##
+
+#SeeAlso SkRegion Iterator Spanerator
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool done()
+#Line # returns if data parsing is complete ##
+
+Returns true if Cliperator is pointing to final IRect in Region.
+
+#Return true if data parsing is complete ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ SkRegion::Cliperator clipper(region, {0, 0, 5, 5});
+ SkDebugf("%14s done=%s\n", label, clipper.done() ? "true" : "false");
+ };
+ SkRegion region;
+ debugster("empty region", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("after add rect", region);
+#StdOut
+ empty region done=true
+after add rect done=false
+##
+##
+
+#SeeAlso next rect
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void next()
+#Line # advances to next IRect within clip ##
+
+Advances iterator to next IRect in Region contained by clip.
+
+#Example
+ SkRegion region;
+ SkIRect rects[] = {{1, 2, 3, 4}, {5, 6, 7, 8}};
+ region.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkRegion::Cliperator clipper(region, {0, 3, 8, 7});
+ do {
+ auto r2 = clipper.rect();
+ SkDebugf("rect={%d,%d,%d,%d}\n", r2.fLeft, r2.fTop, r2.fRight, r2.fBottom);
+ clipper.next();
+ } while (!clipper.done());
+#StdOut
+rect={1,3,3,4}
+rect={5,6,7,7}
+##
+##
+
+#SeeAlso done
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const SkIRect& rect() const
+#Line # returns part of Region as IRect intersected with clip ##
+
+Returns IRect element in Region, intersected with clip passed to Cliperator
+constructor. Does not return predictable results if Region
+is empty.
+
+#Return part of Region inside clip as IRect ##
+
+#Example
+#Bug 8186
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ SkRegion::Cliperator clipper(region, {0, 0, 5, 3});
+ auto r = clipper.rect();
+ SkDebugf("%14s rect={%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region;
+ debugster("empty region", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("after set rect", region);
+#StdOut
+#Volatile
+ empty region rect={1094713344,1065353216,0,-1}
+after set rect rect={1,2,3,3}
+##
+##
+
+#SeeAlso next done
+
+#Method ##
+
+#Class Cliperator ##
+
+# ------------------------------------------------------------------------------
+
+#Class Spanerator
+#Line # horizontal line segment iterator ##
+
+#Code
+ class Spanerator {
+ public:
+ Spanerator(const SkRegion& region, int y, int left, int right);
+ bool next(int* left, int* right);
+ };
+##
+
+Returns the line segment ends within Region that intersect a horizontal line.
+
+# ------------------------------------------------------------------------------
+
+#Method Spanerator(const SkRegion& region, int y, int left, int right)
+#Line # constructs Region iterator on scan line ##
+
+Sets Spanerator to return line segments in Region on scan line.
+
+
+#Param region Region to iterate ##
+#Param y horizontal line to intersect ##
+#Param left bounds of iteration ##
+#Param right bounds of iteration ##
+
+#Return Region iterator ##
+
+#Example
+ SkRegion region;
+ region.setRect({1, 2, 3, 4});
+ SkRegion::Spanerator spanner(region, 3, 2, 4);
+ int left, right;
+ bool result = spanner.next(&left, &right);
+ SkDebugf("result=%s left=%d right=%d\n", result ? "true" : "false", left, right);
+##
+
+#SeeAlso SkRegion Iterator Cliperator
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool next(int* left, int* right)
+#Line # advances to next span on horizontal line ##
+
+Advances iterator to next span intersecting Region within line segment provided
+in constructor. Returns true if interval was found.
+
+#Param left pointer to span start; may be nullptr ##
+#Param right pointer to span end; may be nullptr ##
+
+#Return true if interval was found ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ SkRegion::Spanerator spanner(region, 3, 2, 4);
+ int left, right;
+ bool result = spanner.next(&left, &right);
+ SkDebugf("%14s: result=%s", label, result ? "true" : "false");
+ if (result) SkDebugf(" left=%d right=%d", left, right);
+ SkDebugf("\n");
+ };
+ SkRegion region;
+ debugster("empty region", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("after set rect", region);
+#StdOut
+ empty region: result=false
+after set rect: result=true left=2 right=3
+##
+##
+
+#SeeAlso done
+
+#Method ##
+
+#Class Spanerator ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkRegion()
+#In Constructor
+#Line # constructs with default values ##
+
+Constructs an empty Region. Region is set to empty bounds
+at (0, 0) with zero width and height.
+
+#Return empty Region ##
+
+#Example
+SkRegion region;
+SkIRect r = region.getBounds();
+SkDebugf("region bounds: {%d, %d, %d, %d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+region bounds: {0, 0, 0, 0}
+##
+##
+
+#SeeAlso setEmpty
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkRegion(const SkRegion& region)
+#In Constructor
+#Line # makes a shallow copy ##
+Constructs a copy of an existing region.
+Copy constructor makes two regions identical by value. Internally, region and
+the returned result share pointer values. The underlying Rect array is
+copied when modified.
+
+Creating a Region copy is very efficient and never allocates memory.
+Regions are always copied by value from the interface; the underlying shared
+pointers are not exposed.
+
+#Param region Region to copy by value ##
+
+#Return copy of Region ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region({1, 2, 3, 4});
+ SkRegion region2(region);
+ debugster("region bounds", region);
+ debugster("region2 bounds", region2);
+ region.setEmpty();
+ SkDebugf(" after region set empty:\n");
+ debugster("region bounds", region);
+ debugster("region2 bounds", region2);
+#StdOut
+ region bounds: {1,2,3,4}
+region2 bounds: {1,2,3,4}
+ after region set empty:
+ region bounds: {0,0,0,0}
+region2 bounds: {1,2,3,4}
+##
+##
+
+#SeeAlso setRegion operator=(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method explicit SkRegion(const SkIRect& rect)
+#In Constructor
+#Line # constructs Region matching IRect ##
+Constructs a rectangular Region matching the bounds of rect.
+
+#Param rect bounds of constructed Region ##
+
+#Return rectangular Region ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ SkRegion region2;
+ region2.setRect({1, 2, 3, 4});
+ SkDebugf("region %c= region2\n", region == region2 ? '=' : '!');
+##
+
+#SeeAlso setRect setRegion
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method ~SkRegion()
+#In Constructor
+#Line # decreases Reference_Count of owned objects ##
+Releases ownership of any shared data and deletes data if Region is sole owner.
+
+#Example
+#Description
+delete calls Region Destructor, but copy of original in region2 is unaffected.
+##
+ SkRegion* region = new SkRegion({1, 2, 3, 4});
+ SkRegion region2(*region);
+ delete region;
+ auto r = region2.getBounds();
+ SkDebugf("region2 bounds: {%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+region2 bounds: {1,2,3,4}
+##
+##
+
+#SeeAlso SkRegion() SkRegion(const SkRegion& region) SkRegion(const SkIRect& rect) operator=(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkRegion& operator=(const SkRegion& region)
+#In Operator
+#Line # makes a shallow copy ##
+Constructs a copy of an existing region.
+Makes two regions identical by value. Internally, region and
+the returned result share pointer values. The underlying Rect array is
+copied when modified.
+
+Creating a Region copy is very efficient and never allocates memory.
+Regions are always copied by value from the interface; the underlying shared
+pointers are not exposed.
+
+#Param region Region to copy by value ##
+
+#Return Region to copy by value ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region1({1, 2, 3, 4});
+ SkRegion region2 = region1;
+ debugster("region1 bounds", region1);
+ debugster("region2 bounds", region2);
+#StdOut
+region1 bounds: {1,2,3,4}
+region2 bounds: {1,2,3,4}
+##
+##
+
+#SeeAlso set swap SkRegion(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool operator==(const SkRegion& other)_const
+#In Operator
+#Line # compares Regions for equality ##
+
+Compares Region and other; returns true if they enclose exactly
+the same area.
+
+#Param other Region to compare ##
+
+#Return true if Region pair are equivalent ##
+
+#Example
+ auto debugster = [](const char* prefix, const SkRegion& a, const SkRegion& b) -> void {
+ SkDebugf("%s one %c= two\n", prefix, a == b ? '=' : '!');
+ };
+ SkRegion one;
+ SkRegion two;
+ debugster("empty", one, two);
+ one.setRect({1, 2, 3, 4});
+ debugster("set rect", one, two);
+ one.setEmpty();
+ debugster("set empty", one, two);
+#StdOut
+empty one == two
+set rect one != two
+set empty one == two
+##
+##
+
+#SeeAlso operator!=(const SkRegion& other)_const operator=(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool operator!=(const SkRegion& other)_const
+#In Operator
+#Line # compares Regions for inequality ##
+
+Compares Region and other; returns true if they do not enclose the same area.
+
+#Param other Region to compare ##
+
+#Return true if Region pair are not equivalent ##
+
+#Example
+ auto debugster = [](const char* prefix, const SkRegion& a, const SkRegion& b) -> void {
+ SkDebugf("%s one %c= two\n", prefix, a != b ? '!' : '=');
+ };
+ SkRegion one;
+ SkRegion two;
+ debugster("empty", one, two);
+ one.setRect({1, 2, 3, 4});
+ two.setRect({1, 2, 3, 3});
+ debugster("set rect", one, two);
+ two.op({1, 3, 3, 4}, SkRegion::kUnion_Op);
+ debugster("union rect", one, two);
+#StdOut
+empty one == two
+set rect one != two
+union rect one == two
+##
+##
+
+#SeeAlso operator==(const SkRegion& other)_const operator=(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool set(const SkRegion& src)
+#In Constructor
+#Line # makes a shallow copy ##
+
+Sets Region to src, and returns true if src bounds is not empty.
+This makes Region and src identical by value. Internally,
+Region and src share pointer values. The underlying Rect array is
+copied when modified.
+
+Creating a Region copy is very efficient and never allocates memory.
+Regions are always copied by value from the interface; the underlying shared
+pointers are not exposed.
+
+#Param src Region to copy ##
+
+#Return copy of src ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region1({1, 2, 3, 4});
+ SkRegion region2;
+ region2.set(region1);
+ debugster("region1 bounds", region1);
+ debugster("region2 bounds", region2);
+#StdOut
+region1 bounds: {1,2,3,4}
+region2 bounds: {1,2,3,4}
+##
+##
+
+#SeeAlso operator=(const SkRegion& region) swap SkRegion(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void swap(SkRegion& other)
+#In Operator
+#Line # exchanges Region pair ##
+
+Exchanges IRect array of Region and other. swap() internally exchanges pointers,
+so it is lightweight and does not allocate memory.
+
+swap() usage has largely been replaced by operator=(const SkRegion& region).
+Paths do not copy their content on assignment until they are written to,
+making assignment as efficient as swap().
+
+#Param other operator=(const SkRegion& region) set ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region1({1, 2, 3, 4});
+ SkRegion region2;
+ region1.swap(region2);
+ debugster("region1 bounds", region1);
+ debugster("region2 bounds", region2);
+#StdOut
+region1 bounds: {0,0,0,0}
+region2 bounds: {1,2,3,4}
+##
+##
+
+#SeeAlso operator=(const SkRegion& region) set SkRegion(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isEmpty() const
+#In Property
+#Line # returns if bounds has no width or height ##
+
+Returns true if Region is empty.
+Empty Region has bounds width or height less than or equal to zero.
+SkRegion() constructs empty Region; setEmpty
+and setRect with dimensionless data make Region empty.
+
+#Return true if bounds has no width or height ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ SkDebugf("%14s: region is %s" "empty\n", label, region.isEmpty() ? "" : "not ");
+ };
+ SkRegion region;
+ debugster("initial", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("set rect", region);
+ region.setEmpty();
+ debugster("set empty", region);
+#StdOut
+ initial: region is empty
+ set rect: region is not empty
+ set empty: region is empty
+##
+##
+
+#SeeAlso isRect isComplex operator==(const SkRegion& other)_const
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isRect() const
+#In Property
+#Line # returns if Region contains one IRect ##
+
+Returns true if Region is one IRect with positive dimensions.
+
+#Return true if Region contains one IRect ##
+
+#Example
+ auto debugster = [](const char* label, const SkRegion& region) -> void {
+ SkDebugf("%s: region is %s" "rect\n", label, region.isRect() ? "" : "not ");
+ };
+ SkRegion region;
+ debugster("initial", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("set rect", region);
+ region.setEmpty();
+ debugster("set empty", region);
+#StdOut
+initial: region is not rect
+set rect: region is rect
+set empty: region is not rect
+##
+##
+
+#SeeAlso isEmpty isComplex
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isComplex() const
+#In Property
+#Line # returns true if Region contains more than one IRect ##
+
+Returns true if Region is described by more than one rectangle.
+
+#Return true if Region contains more than one IRect ##
+
+#Example
+ auto debugster = [](const char* label, const SkRegion& region) -> void {
+ SkDebugf("%s: region is %s" "complex\n", label, region.isComplex() ? "" : "not ");
+ };
+ SkRegion region;
+ debugster("initial", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("set rect", region);
+ region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
+ debugster("op rect", region);
+#StdOut
+initial: region is not complex
+set rect: region is not complex
+op rect: region is complex
+##
+##
+
+#SeeAlso isEmpty isRect
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const SkIRect& getBounds() const
+#In Property
+#Line # returns maximum and minimum of IRect array ##
+
+Returns minimum and maximum axes values of IRect array.
+Returns (0, 0, 0, 0) if Region is empty.
+
+#Return combined bounds of all IRect elements ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
+ auto r = region.getBounds();
+ SkDebugf("bounds: {%d,%d,%d,%d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
+#StdOut
+bounds: {1,2,4,5}
+##
+##
+
+#SeeAlso isEmpty isRect
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method int computeRegionComplexity() const
+#In Property
+#Line # returns relative complexity ##
+
+Returns a value that increases with the number of
+elements in Region. Returns zero if Region is empty.
+Returns one if Region equals IRect; otherwise, returns
+value greater than one indicating that Region is complex.
+
+Call to compare Regions for relative complexity.
+
+#Return relative complexity ##
+
+#Example
+ auto debugster = [](const char* label, const SkRegion& region) -> void {
+ SkDebugf("%s: region complexity %d\n", label, region.computeRegionComplexity());
+ };
+ SkRegion region;
+ debugster("initial", region);
+ region.setRect({1, 2, 3, 4});
+ debugster("set rect", region);
+ region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
+ debugster("op rect", region);
+#StdOut
+initial: region complexity 0
+set rect: region complexity 1
+op rect: region complexity 3
+##
+##
+
+#SeeAlso isRect isComplex
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool getBoundaryPath(SkPath* path) const
+#In Property
+#Line # appends Region outline to Path ##
+
+Appends outline of Region to path.
+Returns true if Region is not empty; otherwise, returns false, and leaves path
+unmodified.
+
+#Param path Path to append to ##
+
+#Return true if path changed ##
+
+#Example
+#Height 100
+ SkRegion region;
+ region.setRect({10, 20, 90, 60});
+ region.op({30, 40, 60, 80}, SkRegion::kXOR_Op);
+ canvas->drawRegion(region, SkPaint());
+ SkPath path;
+ region.getBoundaryPath(&path);
+ path.offset(100, 0);
+ canvas->drawPath(path, SkPaint());
+##
+
+#SeeAlso isEmpty isComplex
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setEmpty()
+#In Constructor
+#Line # constructs with default values ##
+
+Constructs an empty Region. Region is set to empty bounds
+at (0, 0) with zero width and height. Always returns false.
+
+#Return false ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region({1, 2, 3, 4});
+ debugster("region bounds", region);
+ region.setEmpty();
+ SkDebugf(" after region set empty:\n");
+ debugster("region bounds", region);
+#StdOut
+ region bounds: {1,2,3,4}
+ after region set empty:
+ region bounds: {0,0,0,0}
+##
+##
+
+#SeeAlso SkRegion()
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setRect(const SkIRect& rect)
+#In Constructor
+#Line # constructs Region matching IRect ##
+
+Constructs a rectangular Region matching the bounds of rect.
+If rect is empty, constructs empty and returns false.
+
+#Param rect bounds of constructed Region ##
+
+#Return true if rect is not empty ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ SkDebugf("region is %s" "empty\n", region.isEmpty() ? "" : "not ");
+ bool setEmpty = region.setRect({1, 2, 1, 4});
+ SkDebugf("region is %s" "empty\n", region.isEmpty() ? "" : "not ");
+ SkDebugf("setEmpty: %s\n", setEmpty ? "true" : "false");
+#StdOut
+region is not empty
+region is empty
+setEmpty: false
+##
+##
+
+#SeeAlso SkRegion(const SkIRect& rect)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setRect(int32_t left, int32_t top, int32_t right, int32_t bottom)
+#In Constructor
+#Line # constructs Region matching bounds ##
+
+Constructs Region with bounds (left, top, right, bottom).
+Returns true if left is less than right and top is less than bottom; otherwise,
+constructs empty Region and returns false.
+
+#Param left edge of bounds on x-axis ##
+#Param top edge of bounds on y-axis ##
+#Param right edge of bounds on x-axis ##
+#Param bottom edge of bounds on y-axis ##
+
+#Return rectangular Region ##
+
+#Example
+ auto debugster = [](const char* label, bool success, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: success:%s {%d,%d,%d,%d}\n", label, success ? "true" : "false",
+ r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region;
+ bool success = region.setRect(1, 2, 3, 4);
+ debugster("set to: 1,2,3,4", success, region);
+ success = region.setRect(3, 2, 1, 4);
+ debugster("set to: 3,2,1,4", success, region);
+#StdOut
+set to: 1,2,3,4: success:true {1,2,3,4}
+set to: 3,2,1,4: success:false {0,0,0,0}
+##
+##
+
+#SeeAlso SkRegion(const SkIRect& rect)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setRects(const SkIRect rects[], int count)
+#In Constructor
+#Line # sets IRect array ##
+
+Constructs Region as the union of IRect in rects array. If count is
+zero, constructs empty Region. Returns false if constructed Region is empty.
+
+May be faster than repeated calls to op().
+
+#Param rects array of IRects ##
+#Param count array size ##
+
+#Return true if constructed Region is not empty ##
+
+#Example
+#Height 70
+ SkIRect rects[] = { {10, 10, 40, 40}, {20, 20, 50, 50}, {30, 30, 60, 60} };
+ SkRegion region;
+ region.setRects(rects, SK_ARRAY_COUNT(rects));
+ canvas->drawRegion(region, SkPaint());
+ region.setEmpty();
+ for (auto add : rects) {
+ region.op(add, SkRegion::kUnion_Op);
+ }
+ region.translate(100, 0);
+ canvas->drawRegion(region, SkPaint());
+##
+
+#SeeAlso setRect op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setRegion(const SkRegion& region)
+#In Constructor
+#Line # copies Region ##
+
+Constructs a copy of an existing region.
+Makes two regions identical by value. Internally, region and
+the returned result share pointer values. The underlying Rect array is
+copied when modified.
+
+Creating a Region copy is very efficient and never allocates memory.
+Regions are always copied by value from the interface; the underlying shared
+pointers are not exposed.
+
+#Param region Region to copy by value ##
+
+#Return Region to copy by value ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ auto r = region.getBounds();
+ SkDebugf("%14s: {%d,%d,%d,%d}\n", label, r.fLeft, r.fTop, r.fRight, r.fBottom);
+ };
+ SkRegion region({1, 2, 3, 4});
+ SkRegion region2;
+ region2.setRegion(region);
+ debugster("region bounds", region);
+ debugster("region2 bounds", region2);
+ region2.setEmpty();
+ SkDebugf(" after region set empty:\n");
+ debugster("region bounds", region);
+ debugster("region2 bounds", region2);
+#StdOut
+ region bounds: {1,2,3,4}
+region2 bounds: {1,2,3,4}
+ after region set empty:
+ region bounds: {1,2,3,4}
+region2 bounds: {0,0,0,0}
+##
+##
+
+#SeeAlso SkRegion(const SkRegion& region)
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setPath(const SkPath& path, const SkRegion& clip)
+#In Constructor
+#Line # constructs Region from clipped Path ##
+
+Constructs Region to match outline of path within clip.
+Returns false if constructed Region is empty.
+
+Constructed Region draws the same pixels as path through clip when
+Anti_Aliasing is disabled.
+
+#Param path Path providing outline ##
+#Param clip Region containing path ##
+
+#Return true if constructed Region is not empty ##
+
+#Example
+#Height 120
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath textPath;
+ paint.getTextPath("Q", 1, 0, 110, &textPath);
+ SkIRect clipRect = {20, 20, 100, 120};
+ SkRegion clipRegion(clipRect);
+ SkRegion region;
+ region.setPath(textPath, clipRegion);
+ canvas->drawRegion(region, SkPaint());
+ clipRect.offset(100, 0);
+ textPath.offset(100, 0);
+ canvas->clipRect(SkRect::Make(clipRect), false);
+ canvas->drawPath(textPath, SkPaint());
+##
+
+#SeeAlso setRects op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool intersects(const SkIRect& rect) const
+#In Intersection
+#Line # returns true if areas overlap ##
+
+Returns true if Region intersects rect.
+Returns false if either rect or Region is empty, or do not intersect.
+
+#Param rect IRect to intersect ##
+
+#Return true if rect and Region have area in common ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath textPath;
+ paint.getTextPath("W", 1, 20, 110, &textPath);
+ SkRegion region;
+ region.setPath(textPath, SkRegion({0, 0, 256, 256}));
+ canvas->drawRegion(region, SkPaint());
+ SkIRect iRect = SkIRect::MakeXYWH(frame * 160, 55, 10, 10);
+ paint.setColor(region.intersects(iRect) ? SK_ColorBLUE : SK_ColorRED);
+ canvas->drawRect(SkRect::Make(iRect), paint);
+##
+
+#SeeAlso contains SkRect::intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool intersects(const SkRegion& other) const
+
+Returns true if Region intersects other.
+Returns false if either other or Region is empty, or do not intersect.
+
+#Param other Region to intersect ##
+
+#Return true if other and Region have area in common ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath hPath, dotPath;
+ paint.getTextPath("H", 1, 40, 110, &hPath);
+ paint.getTextPath(",", 1, frame * 180, 95, &dotPath);
+ SkRegion hRegion, dotRegion;
+ hRegion.setPath(hPath, SkRegion({0, 0, 256, 256}));
+ dotRegion.setPath(dotPath, SkRegion({0, 0, 256, 256}));
+ canvas->drawRegion(hRegion, paint);
+ paint.setColor(hRegion.intersects(dotRegion) ? SK_ColorBLUE : SK_ColorRED);
+ canvas->drawRegion(dotRegion, paint);
+##
+
+#SeeAlso contains SkRect::intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool contains(int32_t x, int32_t y) const
+#In Intersection
+#Line # returns true if points are equal or inside ##
+
+Returns true if IPoint (x, y) is inside Region.
+Returns false if Region is empty.
+
+#Param x test IPoint x-coordinate ##
+#Param y test IPoint y-coordinate ##
+
+#Return true if (x, y) is inside Region ##
+
+#Example
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ SkRegion xRegion;
+ xRegion.setPath(xPath, SkRegion({0, 0, 256, 256}));
+ canvas->drawRegion(xRegion, paint);
+ for (int y = 0; y < 128; y += 8) {
+ for (int x = 0; x < 128; x += 8) {
+ paint.setColor(xRegion.contains(x, y) ? SK_ColorWHITE : SK_ColorRED);
+ canvas->drawPoint(x, y, paint);
+ }
+ }
+##
+
+#SeeAlso intersects SkRect::contains
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool contains(const SkIRect& other) const
+
+Returns true if other is completely inside Region.
+Returns false if Region or other is empty.
+
+#Param other IRect to contain ##
+
+#Return true if other is inside Region ##
+
+#Example
+#Height 128
+#Duration 4
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ SkRegion xRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ xRegion.op(drawBounds, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+ SkIRect test = SkIRect::MakeXYWH(frame* 128, 64, 5, 5);
+ if (xRegion.contains(test)) {
+ paint.setColor(SK_ColorYELLOW);
+ canvas->drawRect(SkRect::Make(test), paint);
+ }
+##
+
+#SeeAlso intersects SkRect::contains
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool contains(const SkRegion& other) const
+
+Returns true if other is completely inside Region.
+Returns false if Region or other is empty.
+
+#Param other Region to contain ##
+
+#Return true if other is inside Region ##
+
+#Example
+#Height 128
+#Duration 4
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath, testPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ paint.getTextPath("`", 1, frame * 150 - 40, 150, &testPath);
+ SkRegion xRegion, testRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ testRegion.setPath(testPath, SkRegion(drawBounds));
+ xRegion.op(drawBounds, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+ if (xRegion.contains(testRegion)) {
+ paint.setColor(SK_ColorYELLOW);
+ canvas->drawRegion(testRegion, paint);
+ }
+##
+
+#SeeAlso intersects SkRect::contains
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool quickContains(const SkIRect& r) const
+#In Intersection
+#Line # returns true quickly if points are equal or inside ##
+
+Returns true if Region is a single rectangle and contains r.
+May return false even though Region contains r.
+
+#Param r IRect to contain ##
+
+#Return true quickly if r points are equal or inside ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ SkIRect test = {2, 2, 3, 3};
+ SkDebugf("quickContains 1: %s\n", region.quickContains(test) ? "true" : "false");
+ region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
+ SkDebugf("quickContains 2: %s\n", region.quickContains(test) ? "true" : "false");
+ region.op({1, 7, 3, 8}, SkRegion::kUnion_Op);
+ SkDebugf("quickContains 3: %s\n", region.quickContains(test) ? "true" : "false");
+#StdOut
+quickContains 1: true
+quickContains 2: true
+quickContains 3: false
+##
+##
+
+#SeeAlso contains quickReject intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool quickContains(int32_t left, int32_t top, int32_t right,
+ int32_t bottom) const
+
+Returns true if Region is a single rectangle and contains IRect
+(left, top, right, bottom).
+Returns false if Region is empty or IRect (left, top, right, bottom) is empty.
+May return false even though Region contains (left, top, right, bottom).
+
+#Param left edge of bounds on x-axis ##
+#Param top edge of bounds on y-axis ##
+#Param right edge of bounds on x-axis ##
+#Param bottom edge of bounds on y-axis ##
+
+#Return true quickly if IRect are equal or inside ##
+
+#Example
+ auto debugster = [](const char* label, SkRegion& region) -> void {
+ SkDebugf("%s: %s\n", label, region.quickContains(2, 2, 3, 3) ? "true" : "false");
+ };
+ SkRegion region({1, 2, 3, 4});
+ debugster("quickContains 1", region);
+ region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
+ debugster("quickContains 2", region);
+ region.op({1, 7, 3, 8}, SkRegion::kUnion_Op);
+ debugster("quickContains 3", region);
+#StdOut
+quickContains 1: true
+quickContains 2: true
+quickContains 3: false
+##
+##
+
+#SeeAlso contains quickReject intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool quickReject(const SkIRect& rect) const
+#In Intersection
+#Line # returns true quickly if points are outside ##
+
+Returns true if Region does not intersect rect.
+Returns true if rect is empty or Region is empty.
+May return false even though Region does not intersect rect.
+
+#Param rect IRect to intersect ##
+
+#Return true if rect does not intersect ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ SkIRect test = {4, 2, 5, 3};
+ SkDebugf("quickReject 1: %s\n", region.quickReject(test) ? "true" : "false");
+ region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
+ SkDebugf("quickReject 2: %s\n", region.quickReject(test) ? "true" : "false");
+ region.op({4, 7, 5, 8}, SkRegion::kUnion_Op);
+ SkDebugf("quickReject 3: %s\n", region.quickReject(test) ? "true" : "false");
+#StdOut
+quickReject 1: true
+quickReject 2: true
+quickReject 3: false
+##
+##
+
+#SeeAlso quickContains contains intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool quickReject(const SkRegion& rgn) const
+
+Returns true if Region does not intersect rgn.
+Returns true if rgn is empty or Region is empty.
+May return false even though Region does not intersect rgn.
+
+#Param rgn Region to intersect ##
+
+#Return true if rgn does not intersect ##
+
+#Example
+ SkRegion region({1, 2, 3, 4});
+ SkRegion test;
+ SkIRect rects[] = {{4, 2, 5, 3}, {7, 2, 8, 3}};
+ test.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkDebugf("quickReject 1: %s\n", region.quickReject(test) ? "true" : "false");
+ region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
+ SkDebugf("quickReject 2: %s\n", region.quickReject(test) ? "true" : "false");
+ region.op({4, 7, 5, 8}, SkRegion::kUnion_Op);
+ SkDebugf("quickReject 3: %s\n", region.quickReject(test) ? "true" : "false");
+#StdOut
+quickReject 1: true
+quickReject 2: true
+quickReject 3: false
+##
+##
+
+#SeeAlso quickContains contains intersects
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void translate(int dx, int dy)
+#In Transform
+#Line # translates IPoints in Region ##
+
+Offsets Region by IVector (dx, dy). Has no effect if Region is empty.
+
+#Param dx x-axis offset ##
+#Param dy y-axis offset ##
+
+#Example
+#Height 90
+ SkRegion test;
+ SkIRect rects[] = {{40, 20, 50, 30}, {70, 40, 80, 50}, { 60, 10, 70, 20}};
+ test.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkPaint paint;
+ for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN, SK_ColorMAGENTA } ) {
+ paint.setColor(color);
+ canvas->drawRegion(test, paint);
+ test.translate(10, 10);
+ }
+##
+
+#SeeAlso SkCanvas::translate SkIRect::offset SkPath::offset
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void translate(int dx, int dy, SkRegion* dst) const
+
+Offsets Region by IVector (dx, dy), writing result to dst. Region may be passed
+as dst parameter, translating Region in place. Has no effect if dst is nullptr.
+If Region is empty, sets dst to empty.
+
+#Param dx x-axis offset ##
+#Param dy y-axis offset ##
+#Param dst translated result ##
+
+#Example
+ SkRegion test;
+ SkIRect rects[] = {{40, 20, 50, 30}, {70, 40, 80, 50}, { 60, 10, 70, 20}};
+ test.setRects(rects, SK_ARRAY_COUNT(rects));
+ SkPaint paint;
+ for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN, SK_ColorMAGENTA } ) {
+ paint.setColor(color);
+ canvas->drawRegion(test, paint);
+ SkRegion second;
+ test.translate(10, test.getBounds().fBottom, &second);
+ test.op(second, SkRegion::kXOR_Op);
+ test.translate(30, 0);
+ }
+##
+
+#SeeAlso SkCanvas::translate SkIRect::offset SkPath::offset
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Enum Op
+#Line # binary operator combining Regions ##
+
+#Code
+ enum Op {
+ kDifference_Op,
+ kIntersect_Op,
+ kUnion_Op,
+ kXOR_Op,
+ kReverseDifference_Op,
+ kReplace_Op,
+ kLastOp = kReplace_Op,
+ };
+##
+
+The logical operations that can be performed when combining two Regions.
+
+#Const kDifference_Op 0
+#Line # target minus operand ##
+Subtracts operand Region from target Region.
+##
+#Const kIntersect_Op 1
+#Line # target intersected with operand ##
+Intersects operand Region and target Region.
+##
+#Const kUnion_Op 2
+#Line # target unioned with operand ##
+Unions operand Region and target Region.
+##
+#Const kXOR_Op 3
+#Line # target exclusive or with operand ##
+Replaces target Region with area exclusive to both Regions.
+##
+#Const kReverseDifference_Op 4
+#Line # operand minus target ##
+Subtracts target Region from operand Region.
+##
+#Const kReplace_Op 5
+#Line # replace target with operand ##
+Replaces target Region with operand Region.
+##
+#Const kLastOp 5
+#Line # last operator ##
+##
+
+#Example
+ SkRegion operand({35, 35, 85, 85});
+ const char* labels[] = {"difference", "intersect", "union", "xor", "reverse diff", "replace"};
+ int index = 0;
+ SkPaint paint;
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ for (auto op : { SkRegion::kDifference_Op, SkRegion::kIntersect_Op, SkRegion::kUnion_Op,
+ SkRegion::kXOR_Op, SkRegion::kReverseDifference_Op, SkRegion::kReplace_Op } ) {
+ SkRegion target({10, 10, 60, 60});
+ target.op(operand, op);
+ canvas->drawRegion(target, paint);
+ canvas->drawString(labels[index++], 40, 100, paint);
+ canvas->translate(80, 0);
+ if (SkRegion::kUnion_Op == op) {
+ canvas->translate(-240, 120);
+ }
+ }
+##
+
+#SeeAlso SkPathOp
+
+#Enum ##
+
+# ------------------------------------------------------------------------------
+
+#Const kOpCnt 6
+#Line # number of operators defined ##
+May be used to verify that Op is a legal value.
+#Const ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(const SkIRect& rect, Op op)
+#In Transform
+#Line # applies binary operator ##
+
+Replaces Region with the result of Region op rect.
+Returns true if replaced Region is not empty.
+
+#Param rect IRect operand ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ SkRegion xRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ xRegion.op(drawBounds, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(int left, int top, int right, int bottom, Op op)
+
+Replaces Region with the result of Region op IRect (left, top, right, bottom).
+Returns true if replaced Region is not empty.
+
+#Param left edge of bounds on x-axis ##
+#Param top edge of bounds on y-axis ##
+#Param right edge of bounds on x-axis ##
+#Param bottom edge of bounds on y-axis ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ SkRegion xRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ xRegion.op(drawBounds.fLeft + frame * drawBounds.width(), drawBounds.fTop,
+ drawBounds.fRight, drawBounds.fBottom, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(const SkRegion& rgn, Op op)
+
+Replaces Region with the result of Region op rgn.
+Returns true if replaced Region is not empty.
+
+#Param rgn Region operand ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath, opPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ opPath.addCircle(64, 64, frame * 64);
+ SkRegion xRegion, opRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ opRegion.setPath(opPath, SkRegion(drawBounds));
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ xRegion.op(opRegion, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(const SkIRect& rect, const SkRegion& rgn, Op op)
+
+Replaces Region with the result of rect op rgn.
+Returns true if replaced Region is not empty.
+
+#Param rect IRect operand ##
+#Param rgn Region operand ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath, opPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ opPath.addCircle(64, 64, frame * 64);
+ SkRegion xRegion, opRegion, rectRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ opRegion.setPath(opPath, SkRegion(drawBounds));
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ drawBounds.inset(frame * drawBounds.width() / 2, 0);
+ rectRegion.op(drawBounds, opRegion, SkRegion::kIntersect_Op);
+ xRegion.op(rectRegion, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(const SkRegion& rgn, const SkIRect& rect, Op op)
+
+Replaces Region with the result of rgn op rect.
+Returns true if replaced Region is not empty.
+
+#Param rgn Region operand ##
+#Param rect IRect operand ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath, opPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ opPath.addCircle(64, 64, frame * 64);
+ SkRegion xRegion, opRegion, rectRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ opRegion.setPath(opPath, SkRegion(drawBounds));
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ drawBounds.inset(frame * drawBounds.width() / 2, 0);
+ rectRegion.op(opRegion, drawBounds, SkRegion::kUnion_Op);
+ xRegion.op(rectRegion, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool op(const SkRegion& rgna, const SkRegion& rgnb, Op op)
+
+Replaces Region with the result of rgna op rgnb.
+Returns true if replaced Region is not empty.
+
+#Param rgna Region operand ##
+#Param rgnb Region operand ##
+#Param op operator, one of: #list_of_op_types#
+##
+
+#Return false if result is empty ##
+
+#Example
+#Duration 4
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath, opPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ xPath.setFillType(SkPath::kInverseWinding_FillType);
+ opPath.addCircle(64, 64, frame * 64);
+ opPath.setFillType(SkPath::kInverseWinding_FillType);
+ SkRegion xRegion, opRegion, rectRegion;
+ SkIRect drawBounds = {0, 0, 128, 128};
+ opRegion.setPath(opPath, SkRegion(drawBounds));
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ drawBounds.inset(frame * drawBounds.width() / 2, 0);
+ rectRegion.setRect(drawBounds);
+ rectRegion.op(xRegion, SkRegion::kIntersect_Op);
+ xRegion.op(rectRegion, opRegion, SkRegion::kReverseDifference_Op);
+ canvas->drawRegion(xRegion, paint);
+##
+
+#SeeAlso setRects Op
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method char* toString()
+#In Utility
+#Line # exists for Android framework only ##
+#Private
+Android framework only.
+##
+#Return string representation of Region ##
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t writeToMemory(void* buffer) const
+#In Utility
+#Line # writes to buffer ##
+
+Writes Region to buffer, and returns number of bytes written.
+If buffer is nullptr, returns number number of bytes that would be written.
+
+#Param buffer storage for binary data ##
+
+#Return size of Region ##
+
+#Example
+#Height 128
+ SkPaint paint;
+ paint.setTextSize(128);
+ SkPath xPath;
+ paint.getTextPath("X", 1, 20, 110, &xPath);
+ SkIRect drawBounds = {0, 0, 128, 128};
+ SkRegion xRegion;
+ xRegion.setPath(xPath, SkRegion(drawBounds));
+ size_t size = xRegion.writeToMemory(nullptr);
+ sk_sp<SkData> data = SkData::MakeUninitialized(size);
+ xRegion.writeToMemory(data->writable_data());
+ SkRegion copy;
+ copy.readFromMemory(data->data(), data->size());
+ canvas->drawRegion(copy, paint);
+##
+
+#SeeAlso readFromMemory
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t readFromMemory(const void* buffer, size_t length)
+#In Utility
+#Line # reads from buffer ##
+
+Constructs Region from buffer of size length. Returns bytes read.
+Returned value will be multiple of four or zero if length was too small.
+
+#Param buffer storage for binary data ##
+#Param length size of buffer ##
+
+#Return bytes read ##
+
+#Example
+#Height 100
+ SkRegion region({20, 20, 80, 80});
+ size_t size = region.writeToMemory(nullptr);
+ sk_sp<SkData> data = SkData::MakeUninitialized(size);
+ region.writeToMemory(data->writable_data());
+ SkRegion copy;
+ copy.readFromMemory(data->data(), data->size());
+ canvas->drawRegion(copy, SkPaint());
+##
+
+#SeeAlso writeToMemory
+
+#Method ##
+
+#Class SkRegion ##
+
+#Topic Region ##
diff --git a/docs/SkStream_Reference.bmh b/docs/SkStream_Reference.bmh
new file mode 100644
index 0000000..d978d08
--- /dev/null
+++ b/docs/SkStream_Reference.bmh
@@ -0,0 +1,529 @@
+#Topic Stream
+#Alias Stream_Reference ##
+
+#Class SkStream
+
+SkStream describes an abstract class that provides readable serial access to
+data. Subclass SkFILEStream stores readable data in a file. Subclass
+SkMemoryStream stores readable data in memory.
+
+SkStream data is immutable; data access is synchronous. Reading Stream data
+returns only as many bytes as were available when Stream was created. Unlike
+traditional streams, additional data will not become available at a later time
+or on a subsequent read request.
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual ~SkStream()
+#In Constructor
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkStream()
+#In Constructor
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static std::unique_ptr<SkStreamAsset> MakeFromFile(const char path[])
+#In incomplete
+#Line # incomplete ##
+
+Attempts to open the specified file as a stream, returns nullptr on failure.
+
+#Param path incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual size_t read(void* buffer, size_t size) = 0
+#In incomplete
+#Line # incomplete ##
+
+Reads or skips size number of bytes.
+If buffer is nullptr, skip size bytes, return how many were skipped.
+If buffer is not nullptr, copy size bytes into buffer, return how many were copied.
+
+#Param buffer when nullptr skip size bytes, otherwise copy size bytes into buffer
+##
+#Param size the number of bytes to skip or copy
+##
+
+#Return the number of bytes actually read.
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t skip(size_t size)
+#In incomplete
+#Line # incomplete ##
+
+Skip size number of bytes. #Param size incomplete ##
+
+#Return the actual number bytes that could be skipped
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual size_t peek(void* buffer, size_t size) const
+#In incomplete
+#Line # incomplete ##
+
+Attempt to peek at size bytes.
+If this stream supports peeking, copy min(size, peekable bytes) into
+buffer, and return the number of bytes copied.
+If the stream does not support peeking, or cannot peek any bytes,
+return 0 and leave buffer unchanged.
+The stream is guaranteed to be in the same visible state after this
+call, regardless of success or failure.
+
+#Param buffer must not be nullptr, and must be at least size bytes. Destination
+ to copy bytes
+##
+#Param size number of bytes to copy
+##
+
+#Return number of bytes peeked/copied.
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool isAtEnd() const = 0
+#In incomplete
+#Line # incomplete ##
+
+Returns true when all the bytes in the stream have been read.
+This may return true early (when there are no more bytes to be read)
+or late (after the first unsuccessful read).
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readS8(int8_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readS16(int16_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readS32(int32_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readU8(uint8_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readU16(uint16_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readU32(uint32_t* i)
+#In incomplete
+#Line # incomplete ##
+
+#Param i incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readBool(bool* b)
+#In incomplete
+#Line # incomplete ##
+
+#Param b incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readScalar(SkScalar* s)
+#In incomplete
+#Line # incomplete ##
+
+#Param s incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT readPackedUInt(size_t* u)
+#In incomplete
+#Line # incomplete ##
+
+#Param u incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool rewind()
+#In incomplete
+#Line # incomplete ##
+
+Rewinds to the beginning of the stream. Returns true if the stream is known
+to be at the beginning after this call returns.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkStream> duplicate() const
+#In incomplete
+#Line # incomplete ##
+
+Duplicates this stream. If this cannot be done, returns NULL.
+The returned stream will be positioned at the beginning of its data.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method std::unique_ptr<SkStream> fork() const
+#In incomplete
+#Line # incomplete ##
+
+Duplicates this stream. If this cannot be done, returns NULL.
+The returned stream will be positioned the same as this stream.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool hasPosition() const
+#In incomplete
+#Line # incomplete ##
+
+Returns true if this stream can report its current position.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual size_t getPosition() const
+#In incomplete
+#Line # incomplete ##
+
+Returns the current position in the stream. If this cannot be done, returns 0.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool seek(size_t position)
+#In incomplete
+#Line # incomplete ##
+
+#Param position incomplete ##
+
+Seeks to an absolute position in the stream. If this cannot be done, returns false.
+If an attempt is made to seek past the end of the stream, the position will be set
+to the end of the stream.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool move(long offset)
+#In incomplete
+#Line # incomplete ##
+
+#Param offset incomplete ##
+
+Seeks to an relative offset in the stream. If this cannot be done, returns false.
+If an attempt is made to move to a position outside the stream, the position will be set
+to the closest point within the stream (beginning or end).
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool hasLength() const
+#In incomplete
+#Line # incomplete ##
+
+Returns true if this stream can report its total length.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual size_t getLength() const
+#In incomplete
+#Line # incomplete ##
+
+Returns the total length of the stream. If this cannot be done, returns 0.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual const void* getMemoryBase()
+#In incomplete
+#Line # incomplete ##
+
+Returns the starting address for the data. If this cannot be done, returns NULL.
+TODO: replace with virtual const SkData* getData()
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkStream ##
+
+#Topic Stream ##
diff --git a/docs/SkTextBlobBuilder_Reference.bmh b/docs/SkTextBlobBuilder_Reference.bmh
new file mode 100644
index 0000000..e2e121e
--- /dev/null
+++ b/docs/SkTextBlobBuilder_Reference.bmh
@@ -0,0 +1,287 @@
+#Topic Text_Blob_Builder
+#Alias Text_Blob_Builder_Reference ##
+
+#Class SkTextBlobBuilder
+
+Helper class for constructing SkTextBlob.
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Class
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Struct RunBuffer
+#Line # storage for Glyphs and Glyph positions ##
+
+#Code
+ struct RunBuffer {
+ SkGlyphID* glyphs;
+ SkScalar* pos;
+ char* utf8text;
+ uint32_t* clusters;
+ };
+##
+
+RunBuffer supplies storage for Glyphs and positions within a run.
+
+A run is a sequence of Glyphs sharing Paint_Font_Metrics and positioning.
+Each run may position its Glyphs in one of three ways:
+by specifying where the first Glyph is drawn, and allowing Paint_Font_Metrics to
+determine the advance to subsequent Glyphs; by specifying a baseline, and
+the position on that baseline for each Glyph in run; or by providing Point
+array, one per Glyph.
+
+#Subtopic Member
+#Populate
+##
+
+#Member SkGlyphID* glyphs
+#Line # storage for Glyphs in run ##
+ glyphs points to memory for one or more Glyphs. glyphs memory must be
+ written to by the caller.
+##
+
+#Member SkScalar* pos
+#Line # storage for positions in run ##
+ pos points to memory for Glyph positions. Depending on how RunBuffer
+ is allocated, pos may point to zero bytes per Glyph, one Scalar per Glyph,
+ or one Point per Glyph.
+##
+
+#Member char* utf8text
+#Line # reserved for future use ##
+ Reserved for future use. utf8text should not be read or written.
+##
+
+#Member uint32_t* clusters
+#Line # reserved for future use ##
+ Reserved for future use. clusters should not be read or written.
+##
+
+#SeeAlso allocRun allocRunPos allocRunPosH
+
+#Struct RunBuffer ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkTextBlobBuilder()
+#In Constructor
+#Line # constructs with default values ##
+
+Constructs empty Text_Blob_Builder. By default, Text_Blob_Builder has no runs.
+
+#Return empty Text_Blob_Builder ##
+
+#Example
+ SkTextBlobBuilder builder;
+ sk_sp<SkTextBlob> blob = builder.make();
+ SkDebugf("blob " "%s" " nullptr", blob == nullptr ? "equals" : "does not equal");
+#StdOut
+blob equals nullptr
+##
+##
+
+#SeeAlso make SkTextBlob::MakeFromText
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method ~SkTextBlobBuilder()
+#In Constructor
+#Line # deletes storage ##
+Deletes data allocated internally by Text_Blob_Builder.
+
+#NoExample
+##
+
+#SeeAlso SkTextBlobBuilder()
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method sk_sp<SkTextBlob> make()
+#In Constructor
+#Line # constructs Text_Blob from bulider ##
+
+Returns Text_Blob built from runs of Glyphs added by builder. Returned
+Text_Blob is immutable; it may be copied, but its contents may not be altered.
+Returns nullptr if no runs of Glyphs were added by builder.
+
+Resets Text_Blob_Builder to its initial empty state, allowing it to be
+reused to build a new set of runs.
+
+#Return Text_Blob or nullptr ##
+
+#Example
+ SkTextBlobBuilder builder;
+ sk_sp<SkTextBlob> blob = builder.make();
+ SkDebugf("blob " "%s" " nullptr\n", blob == nullptr ? "equals" : "does not equal");
+ SkPaint paint;
+ paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ paint.textToGlyphs("x", 1, builder.allocRun(paint, 1, 20, 20).glyphs);
+ blob = builder.make();
+ SkDebugf("blob " "%s" " nullptr\n", blob == nullptr ? "equals" : "does not equal");
+ blob = builder.make();
+ SkDebugf("blob " "%s" " nullptr\n", blob == nullptr ? "equals" : "does not equal");
+#StdOut
+blob equals nullptr
+blob does not equal nullptr
+blob equals nullptr
+##
+##
+
+#SeeAlso SkTextBlob::MakeFromText
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const RunBuffer& allocRun(const SkPaint& font, int count, SkScalar x, SkScalar y,
+ const SkRect* bounds = nullptr)
+#In Allocator
+#Line # returns writable glyph buffer at Point ##
+
+Returns run with storage for Glyphs. Caller must write count Glyphs to
+RunBuffer.glyphs before next call to FontBlobBuilder.
+
+RunBuffer.utf8text, and RunBuffer.clusters should be ignored.
+
+Glyphs share Paint_Font_Metrics in font, including: #paint_font_metrics#.
+
+Glyphs are positioned on a baseline at (x, y), using font Paint_Font_Metrics to
+determine their relative placement.
+
+bounds defines an optional bounding box, used to suppress drawing when Text_Blob
+bounds does not intersect Surface bounds. If bounds is nullptr, Text_Blob bounds
+is computed from (x, y) and RunBuffer.glyphs Paint_Font_Metrics.
+
+#Param font Paint used for this run ##
+#Param count number of glyphs ##
+#Param x horizontal offset within the blob ##
+#Param y vertical offset within the blob ##
+#Param bounds optional run bounding box ##
+
+#Return writable glyph buffer ##
+
+#Example
+#Height 60
+ SkTextBlobBuilder builder;
+ SkPaint paint, glyphPaint;
+ glyphPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ const SkTextBlobBuilder::RunBuffer& run = builder.allocRun(glyphPaint, 5, 20, 20);
+ paint.textToGlyphs("hello", 5, run.glyphs);
+ canvas->drawRect({20, 20, 30, 30}, paint);
+ canvas->drawTextBlob(builder.make(), 20, 20, paint);
+##
+
+#SeeAlso allocRunPosH allocRunPos
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const RunBuffer& allocRunPosH(const SkPaint& font, int count, SkScalar y,
+ const SkRect* bounds = nullptr)
+#In Allocator
+#Line # returns writable glyph and x-axis position buffers ##
+
+Returns run with storage for Glyphs and positions along baseline. Caller must
+write count Glyphs to RunBuffer.glyphs, and count Scalars to RunBuffer.pos;
+before next call to FontBlobBuilder.
+
+RunBuffer.utf8text, and RunBuffer.clusters should be ignored.
+
+Glyphs share Paint_Font_Metrics in font, including: #paint_font_metrics#.
+
+Glyphs are positioned on a baseline at y, using x-axis positions written by
+caller to RunBuffer.pos.
+
+bounds defines an optional bounding box, used to suppress drawing when Text_Blob
+bounds does not intersect Surface bounds. If bounds is nullptr, Text_Blob bounds
+is computed from y, RunBuffer.pos, and RunBuffer.glyphs Paint_Font_Metrics.
+
+#Param font Paint used for this run ##
+#Param count number of Glyphs ##
+#Param y vertical offset within the blob ##
+#Param bounds optional run bounding box ##
+
+#Return writable glyph buffer and x-axis position buffer ##
+
+#Example
+#Height 60
+ SkTextBlobBuilder builder;
+ SkPaint paint, glyphPaint;
+ glyphPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ const SkTextBlobBuilder::RunBuffer& run = builder.allocRunPosH(glyphPaint, 5, 20);
+ paint.textToGlyphs("hello", 5, run.glyphs);
+ SkScalar positions[] = {0, 10, 20, 40, 80};
+ memcpy(run.pos, positions, sizeof(positions));
+ canvas->drawTextBlob(builder.make(), 20, 20, paint);
+##
+
+#SeeAlso allocRunPos allocRun
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method const RunBuffer& allocRunPos(const SkPaint& font, int count,
+ const SkRect* bounds = nullptr)
+#In Allocator
+#Line # returns writable glyph and Point buffers ##
+
+Returns run with storage for Glyphs and Point positions. Caller must
+write count Glyphs to RunBuffer.glyphs, and count Points to RunBuffer.pos;
+before next call to FontBlobBuilder.
+
+RunBuffer.utf8text, and RunBuffer.clusters should be ignored.
+
+Glyphs share Paint_Font_Metrics in font, including: #paint_font_metrics#.
+
+Glyphs are positioned using Points written by caller to RunBuffer.pos, using
+two Scalar values for each Point.
+
+bounds defines an optional bounding box, used to suppress drawing when Text_Blob
+bounds does not intersect Surface bounds. If bounds is nullptr, Text_Blob bounds
+is computed from RunBuffer.pos, and RunBuffer.glyphs Paint_Font_Metrics.
+
+#Param font Paint used for this run ##
+#Param count number of Glyphs ##
+#Param bounds optional run bounding box ##
+
+#Return writable glyph buffer and Point buffer ##
+
+#Example
+#Height 90
+ SkTextBlobBuilder builder;
+ SkPaint paint, glyphPaint;
+ glyphPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ const SkTextBlobBuilder::RunBuffer& run = builder.allocRunPos(glyphPaint, 5);
+ paint.textToGlyphs("hello", 5, run.glyphs);
+ SkPoint positions[] = {{0, 0}, {10, 10}, {20, 20}, {40, 40}, {80, 80}};
+ memcpy(run.pos, positions, sizeof(positions));
+ canvas->drawTextBlob(builder.make(), 20, 20, paint);
+##
+
+#SeeAlso allocRunPosH allocRun
+
+#Method ##
+
+#Class SkTextBlobBuilder ##
+
+#Topic Text_Blob_Builder ##
diff --git a/docs/SkTextBlob_Reference.bmh b/docs/SkTextBlob_Reference.bmh
new file mode 100644
index 0000000..169fa63
--- /dev/null
+++ b/docs/SkTextBlob_Reference.bmh
@@ -0,0 +1,325 @@
+#Topic Text_Blob
+#Alias Text_Blob_Reference ##
+
+#PhraseDef paint_font_metrics
+Typeface, Paint_Text_Size, Paint_Text_Scale_X,
+Paint_Text_Skew_X, Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
+Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
+and Subpixel_Text
+##
+
+Text_Blob holds one or more runs of text. Each run associates a string of Glyphs
+with a position and Paint. Each Paint contains attributes used
+to define the run text: #paint_font_metrics#.
+
+Text_Blob runs of text use Glyph_ID encoding; each run Paint must set
+Paint_Text_Encoding to SkPaint::kGlyphID_TextEncoding.
+
+Text_Blob is constructed with SkTextBlob::MakeFromText or Text_Blob_Builder.
+Once created, Text_Blob can not be modified.
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Class SkTextBlob
+
+SkTextBlob combines multiple text runs into an immutable container. Each text
+run consists of Glyphs, Paint, and position. Only parts of Paint related to
+fonts and text rendering are used by run.
+
+# ------------------------------------------------------------------------------
+
+#Method const SkRect& bounds() const
+#In Property
+#Line # returns conservative bounding box ##
+
+Returns conservative bounding box. Uses Paint associated with each glyph to
+determine glyph bounds, and unions all bounds. Returned bounds may be
+larger than the bounds of all Glyphs in runs.
+
+#Return conservative bounding box ##
+
+#Example
+#Height 70
+ SkTextBlobBuilder textBlobBuilder;
+ const char bunny[] = "/(^x^)\\";
+ const int len = sizeof(bunny) - 1;
+ uint16_t glyphs[len];
+ SkPaint paint;
+ paint.textToGlyphs(bunny, len, glyphs);
+ paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ int runs[] = { 3, 1, 3 };
+ SkPoint textPos = { 20, 50 };
+ int glyphIndex = 0;
+ for (auto runLen : runs) {
+ paint.setTextSize(1 == runLen ? 20 : 50);
+ const SkTextBlobBuilder::RunBuffer& run =
+ textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY);
+ memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen);
+ textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr);
+ glyphIndex += runLen;
+ }
+ sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
+ paint.reset();
+ canvas->drawTextBlob(blob.get(), 0, 0, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRect(blob->bounds(), paint);
+##
+
+#SeeAlso SkPath::getBounds
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method uint32_t uniqueID() const
+#In Property
+#Line # returns identifier for Text_Blob ##
+
+Returns a non-zero value unique among all text blobs.
+
+#Return identifier for Text_Blob ##
+
+#Example
+for (int index = 0; index < 2; ++index) {
+ SkTextBlobBuilder textBlobBuilder;
+ const char bunny[] = "/(^x^)\\";
+ const int len = sizeof(bunny) - 1;
+ uint16_t glyphs[len];
+ SkPaint paint;
+ paint.textToGlyphs(bunny, len, glyphs);
+ paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ paint.setTextScaleX(0.5);
+ int runs[] = { 3, 1, 3 };
+ SkPoint textPos = { 20, 50 };
+ int glyphIndex = 0;
+ for (auto runLen : runs) {
+ paint.setTextSize(1 == runLen ? 20 : 50);
+ const SkTextBlobBuilder::RunBuffer& run =
+ textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY);
+ memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen);
+ textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr);
+ glyphIndex += runLen;
+ }
+ sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
+ paint.reset();
+ canvas->drawTextBlob(blob.get(), 0, 0, paint);
+ std::string id = "unique ID:" + std::to_string(blob->uniqueID());
+ canvas->drawString(id.c_str(), 30, blob->bounds().fBottom + 15, paint);
+ canvas->translate(blob->bounds().fRight + 10, 0);
+}
+##
+
+#SeeAlso SkRefCnt
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static sk_sp<SkTextBlob> MakeFromText(
+ const void* text, size_t byteLength, const SkPaint& paint)
+#In Constructor
+#Line # constructs Text_Blob with one run ##
+
+Creates Text_Blob with a single run. text meaning depends on Paint_Text_Encoding;
+by default, text is encoded as UTF-8.
+
+paint contains attributes used to define the run text: #paint_font_metrics#.
+
+#Param text character code points or Glyphs drawn ##
+#Param byteLength byte length of text array ##
+#Param paint text size, typeface, text scale, and so on, used to draw ##
+
+#Return Text_Blob constructed from one run ##
+
+#Example
+#Height 24
+ SkPaint blobPaint;
+ blobPaint.setColor(SK_ColorRED); // ignored
+ blobPaint.setTextSize(24); // respected
+ blobPaint.setAntiAlias(true); // ignored
+ SkPaint canvasPaint = blobPaint;
+ canvasPaint.setColor(SK_ColorBLUE); // respected
+ canvasPaint.setTextSize(2); // ignored
+ sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromText("Hello World", 11, blobPaint);
+ canvas->drawTextBlob(blob, 20, 20, canvasPaint);
+##
+
+#SeeAlso MakeFromString TextBlobBuilder
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method static sk_sp<SkTextBlob> MakeFromString(const char* string, const SkPaint& paint)
+#In Constructor
+#Line # constructs Text_Blob with one run ##
+
+Creates Text_Blob with a single run. string meaning depends on Paint_Text_Encoding;
+by default, string is encoded as UTF-8.
+
+paint contains Paint_Font_Metrics used to define the run text: #paint_font_metrics#.
+
+#Param string character code points or Glyphs drawn ##
+#Param paint text size, typeface, text scale, and so on, used to draw ##
+
+#Return Text_Blob constructed from one run ##
+
+#Example
+#Height 24
+ SkPaint blobPaint;
+ blobPaint.setColor(SK_ColorRED); // ignored
+ blobPaint.setTextSize(24); // respected
+ blobPaint.setAntiAlias(true); // ignored
+ SkPaint canvasPaint = blobPaint;
+ canvasPaint.setColor(SK_ColorBLUE); // respected
+ canvasPaint.setTextSize(2); // ignored
+ sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString("Hello World", blobPaint);
+ canvas->drawTextBlob(blob, 20, 20, canvasPaint);
+##
+
+#SeeAlso MakeFromText TextBlobBuilder
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t serialize(const SkSerialProcs& procs, void* memory, size_t memory_size) const
+#In Utility
+#Line # writes Text_Blob to memory ##
+
+Writes data to allow later reconstruction of Text_Blob. memory points to storage
+to receive the encoded data, and memory_size describes the size of storage.
+Returns bytes used if provided storage is large enough to hold all data;
+otherwise, returns zero.
+
+procs.fTypefaceProc permits supplying a custom function to encode Typeface.
+If procs.fTypefaceProc is nullptr, default encoding is used. procs.fTypefaceCtx
+may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc
+is called with a pointer to Typeface and user context.
+
+#Param procs custom serial data encoders; may be nullptr ##
+#Param memory storage for data ##
+#Param size size of storage ##
+
+#Return bytes written, or zero if required storage is larger than memory_size ##
+
+#Example
+#Height 64
+###$
+$Function
+#include "SkSerialProcs.h"
+$$
+$$$#
+ SkPaint blobPaint;
+ blobPaint.setTextSize(24);
+ sk_sp<SkTextBlob> blob = SkTextBlob::MakeAsDrawText("Hello World", 11, blobPaint);
+ char storage[2048];
+ size_t used = blob->serialize(SkSerialProcs(), storage, sizeof(storage));
+ sk_sp<SkTextBlob> copy = SkTextBlob::Deserialize(storage, used, SkDeserialProcs());
+ canvas->drawTextBlob(copy, 20, 20, SkPaint());
+ std::string usage = "size=" + std::to_string(sizeof(storage)) + " used=" + std::to_string(used);
+ canvas->drawString(usage.c_str(), 20, 40, SkPaint());
+##
+
+#SeeAlso Deserialize SkSerialProcs
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method sk_sp<SkData> serialize(const SkSerialProcs& procs) const
+#In Utility
+#Line # writes Text_Blob to Data ##
+Returns storage containing Data describing Text_Blob, using optional custom
+encoders.
+
+procs.fTypefaceProc permits supplying a custom function to encode Typeface.
+If procs.fTypefaceProc is nullptr, default encoding is used. procs.fTypefaceCtx
+may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc
+is called with a pointer to Typeface and user context.
+
+#Param procs custom serial data encoders; may be nullptr ##
+
+#Return storage containing serialized Text_Blob ##
+
+#Example
+#Height 24
+###$
+$Function
+#include "SkSerialProcs.h"
+$$
+$$$#
+ SkPaint blobPaint;
+ blobPaint.setTextSize(24);
+ sk_sp<SkTextBlob> blob = SkTextBlob::MakeAsDrawText("Hello World", 11, blobPaint);
+ sk_sp<SkData> data = blob->serialize(SkSerialProcs());
+ sk_sp<SkTextBlob> copy = SkTextBlob::Deserialize(data->data(), data->size(), SkDeserialProcs());
+ canvas->drawTextBlob(copy, 20, 20, SkPaint());
+##
+
+#SeeAlso Deserialize SkData SkSerialProcs
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size, const SkDeserialProcs& procs)
+#In Constructor
+#Line # constructs Text_Blob from memory ##
+
+Recreates Text_Blob that was serialized into data. Returns constructed Text_Blob
+if successful; otherwise, returns nullptr. Fails if size is smaller than
+required data length, or if data does not permit constructing valid Text_Blob.
+
+procs.fTypefaceProc permits supplying a custom function to decode Typeface.
+If procs.fTypefaceProc is nullptr, default decoding is used. procs.fTypefaceCtx
+may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc
+is called with a pointer to Typeface data, data byte length, and user context.
+
+#Param data pointer for serial data ##
+#Param size size of data ##
+#Param procs custom serial data decoders; may be nullptr ##
+
+#Return Text_Blob constructed from data in memory ##
+
+#Example
+#Height 24
+#Description
+Text "Hacker" replaces "World!", but does not update its metrics.
+When drawn, "Hacker" uses the spacing computed for "World!".
+##
+###$
+$Function
+#include "SkSerialProcs.h"
+$$
+$$$#
+ SkPaint blobPaint;
+ blobPaint.setTextSize(24);
+ sk_sp<SkTextBlob> blob = SkTextBlob::MakeAsDrawText("Hello World!", 12, blobPaint);
+ sk_sp<SkData> data = blob->serialize(SkSerialProcs());
+ uint16_t glyphs[6];
+ blobPaint.textToGlyphs("Hacker", 6, glyphs);
+ memcpy((char*)data->writable_data() + 0x54, glyphs, sizeof(glyphs));
+ sk_sp<SkTextBlob> copy = SkTextBlob::Deserialize(data->data(), data->size(), SkDeserialProcs());
+ canvas->drawTextBlob(copy, 20, 20, SkPaint());
+##
+
+#SeeAlso serialize SkDeserialProcs
+
+#Method ##
+
+#Class SkTextBlob ##
+
+#Topic Text_Blob ##
diff --git a/docs/SkWStream_Reference.bmh b/docs/SkWStream_Reference.bmh
new file mode 100644
index 0000000..77edc41
--- /dev/null
+++ b/docs/SkWStream_Reference.bmh
@@ -0,0 +1,362 @@
+#Topic WStream
+#Alias WStream_Reference ##
+
+#Class SkWStream
+
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constructor
+#Populate
+##
+
+#Subtopic Member_Function
+#Populate
+##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual ~SkWStream()
+#In Constructor
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkWStream()
+#In Constructor
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual bool write(const void* buffer, size_t size) = 0
+#In incomplete
+#Line # incomplete ##
+
+Called to write bytes to a SkWStream. Returns true on success
+
+#Param buffer the address of at least size bytes to be written to the stream
+##
+#Param size number of bytes in buffer to write to the stream
+##
+
+#Return true on success
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual void flush()
+#In incomplete
+#Line # incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method virtual size_t bytesWritten() const = 0
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool write8(U8CPU value)
+#In incomplete
+#Line # incomplete ##
+
+Helpers.
+
+#Param value incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool write16(U16CPU value)
+#In incomplete
+#Line # incomplete ##
+
+#Param value incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool write32(uint32_t v)
+#In incomplete
+#Line # incomplete ##
+
+#Param v incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeText(const char text[])
+#In incomplete
+#Line # incomplete ##
+
+#Param text incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool newline()
+#In incomplete
+#Line # incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeDecAsText(int32_t)
+#In incomplete
+#Line # incomplete ##
+
+#Param t incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeBigDecAsText(int64_t, int minDigits = 0)
+#In incomplete
+#Line # incomplete ##
+
+#Param t incomplete ##
+#Param minDigits incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeHexAsText(uint32_t, int minDigits = 0)
+#In incomplete
+#Line # incomplete ##
+
+#Param t incomplete ##
+#Param minDigits incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeScalarAsText(SkScalar)
+#In incomplete
+#Line # incomplete ##
+
+#Param SkScalar incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeBool(bool v)
+#In incomplete
+#Line # incomplete ##
+
+#Param v incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeScalar(SkScalar)
+#In incomplete
+#Line # incomplete ##
+
+#Param SkScalar incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writePackedUInt(size_t)
+#In incomplete
+#Line # incomplete ##
+
+#Param t incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool writeStream(SkStream* input, size_t length)
+#In incomplete
+#Line # incomplete ##
+
+#Param input incomplete ##
+#Param length incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static int SizeOfPackedUInt(size_t value)
+#In incomplete
+#Line # incomplete ##
+
+This returns the number of bytes in the stream required to store
+'value'.
+
+#Param value incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Class SkWStream ##
+
+#Topic WStream ##
diff --git a/docs/status.json b/docs/status.json
index 6814f9c..e5ef788 100644
--- a/docs/status.json
+++ b/docs/status.json
@@ -16,7 +16,9 @@
"SkPoint.h",
"SkRRect.h",
"SkRect.h",
- "SkSurface.h"
+ "SkRegion.h",
+ "SkSurface.h",
+ "SkTextBlob.h"
]
},
"docs": [
@@ -34,11 +36,14 @@
"SkPicture_Reference.bmh",
"SkRRect_Reference.bmh",
"SkRect_Reference.bmh",
+ "SkRegion_Reference.bmh",
"SkBitmap_Reference.bmh",
"SkIPoint_Reference.bmh",
"SkMatrix_Reference.bmh",
"SkPixmap_Reference.bmh",
"SkSurface_Reference.bmh",
+ "SkTextBlobBuilder_Reference.bmh",
+ "SkTextBlob_Reference.bmh",
"illustrations.bmh",
"undocumented.bmh"
]
@@ -46,9 +51,16 @@
"InProgress": {
"include": {
"core": [
+ "SkStream.h"
]
},
"docs": [
+ "SkDynamicMemoryWStream_Reference.bmh",
+ "SkFILEStream_Reference.bmh",
+ "SkFILEWStream_Reference.bmh",
+ "SkMemoryStream_Reference.bmh",
+ "SkStream_Reference.bmh",
+ "SkWStream_Reference.bmh",
"overview.bmh",
"usingBookmaker.bmh"
]
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index 490ebf0..6161398 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -11,8 +11,9 @@
PDF XPS
RFC
NaN NaNs
-
- C C++ SIZE_MAX
+ U16CPU
+
+ C C++ SIZE_MAX C_FILE
CSS HTML
Sa Da Sc Dc max min # temporary until figure out what to do
@@ -361,6 +362,8 @@
#Topic ##
#Topic Glyph
+#Subtopic ID
+##
#Alias Glyphs ##
##
@@ -470,6 +473,7 @@
#Typedef ##
#Topic Scalar
#Alias Scalar ##
+ #Alias Scalars ##
#Typedef float SkScalar
#Typedef ##
##
@@ -631,11 +635,6 @@
#Class ##
#Topic ##
-#Topic Region
-#Class SkRegion
-##
-#Topic ##
-
#Topic Render_Target
#Class GrRenderTarget
##
@@ -682,10 +681,10 @@
#Alias Sprites ##
#Topic ##
-#Topic Stream
-#Class SkStream
+#Topic Stream_Asset
+#Class SkStreamAsset
##
-##
+#Topic ##
#Topic String
#Class SkString
@@ -721,11 +720,6 @@
#Topic Text
#Topic ##
-#Topic Text_Blob
-#Class SkTextBlob
-#Class ##
-#Topic ##
-
#Topic Texture
#Class GrBackendTexture
#Method bool isValid() const
@@ -744,7 +738,13 @@
##
#Topic Typeface
+#Subtopic ID
+#Typedef uint32_t SkFontID
+##
+##
#Class SkTypeface
+ #Method SkFontID uniqueID() const
+ ##
#Class ##
#Topic ##
@@ -794,11 +794,6 @@
##
#Topic ##
-#Topic WStream
-#Class SkWStream
-##
-#Topic ##
-
#Topic Xfermode_Image_Filter
#Class SkXfermodeImageFilter
##