aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-10-11 10:37:52 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-11 15:26:37 +0000
commit884dd7d428e3913efaead21af83a9d8848062c83 (patch)
tree9b1884f4fdb2de27afd0cea90edbbc478051abe6 /docs
parent4815db5938afe88fa9a7f9ab0df38850b4c0093a (diff)
General clean up on bookmaker.
Command line runs without error for SkBitmap, SkPath, SkRect, SkIRect, SkPixmap, SkCanvas. Docs-Preview: https://skia.org/?cl=57112 TBR: caryclark@google.com Bug: skia:6898 Change-Id: I73b69ae8ffdf0a1e6bc187dc8a9dfb28f7766faa Reviewed-on: https://skia-review.googlesource.com/57112 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkBitmap_Reference.bmh1
-rw-r--r--docs/SkCanvas_Reference.bmh51
-rw-r--r--docs/SkIRect_Reference.bmh22
-rw-r--r--docs/SkMatrix_Reference.bmh90
-rw-r--r--docs/SkPath_Reference.bmh2
-rw-r--r--docs/SkRect_Reference.bmh52
-rw-r--r--docs/undocumented.bmh6
7 files changed, 158 insertions, 66 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 35f4de6dcb..27580233da 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -223,6 +223,7 @@ or setPixelRef was called.
SkDebugf("pixel address = %p\n", bitmap.getPixels());
}
#StdOut
+#Volatile
pixel address = (nil)
pixel address = 0x560ddd0ac670
##
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 3e7369176e..486fe46d71 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -6104,4 +6104,55 @@ Returns false if the clip is empty, or if it is not Rect.
##
#Class SkCanvas ##
+
+#Class SkAutoCanvasRestore
+
+Stack helper class calls SkCanvas::restoreToCount() when SkAutoCanvasRestore
+goes out of scope. Use this to guarantee that the canvas is restored to a known
+state.
+
+#Method SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)
+
+Preserves Canvas save count. Optionally saves Canvas Clip and Matrix.
+
+#Param canvas Canvas to guard ##
+#Param doSave call SkCanvas::save() ##
+
+#Return utility to restore Canvas state on destructor ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso SkCanvas::save SkCanvas::restore
+
+##
+
+#Method ~SkAutoCanvasRestore()
+
+Restores Canvas to saved state.
+
+#Example
+// incomplete
+##
+
+#SeeAlso SkCanvas::save SkCanvas::restore
+
+##
+
+#Method void restore()
+
+Restores Canvas to saved state immediately. Subsequent calls and class
+destructor have no effect.
+
+#Example
+// incomplete
+##
+
+#SeeAlso SkCanvas::save SkCanvas::restore
+
+##
+
+#Class SkAutoCanvasRestore ##
+
#Topic Canvas ##
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index 0a9ddf8bf4..d92c08715d 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -23,10 +23,10 @@ its top, it is considered empty.
#Subtopic Operators
#Table
#Legend
-# description # function ##
+# description # function ##
#Legend ##
-# friend bool operator!=(const SkIRect& a, const SkIRect& b) # Returns true if members are unequal. ##
-# friend bool operator==(const SkIRect& a, const SkIRect& b) # Returns true if members are equal. ##
+# bool operator!=(const SkIRect& a, const SkIRect& b) # Returns true if members are unequal. ##
+# bool operator==(const SkIRect& a, const SkIRect& b) # Returns true if members are equal. ##
#Table ##
#Subtopic ##
@@ -106,7 +106,7 @@ When equal to or less than fTop, IRect is empty.
# ------------------------------------------------------------------------------
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
+#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
Returns constructed IRect set to (0, 0, 0, 0).
Many other rectangles are empty; if left is equal to or greater than right,
@@ -166,7 +166,7 @@ outset isEmpty: true
# ------------------------------------------------------------------------------
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
+#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
Returns constructed IRect set to (0, 0, w, h). Does not validate input; w or h
may be negative.
@@ -194,7 +194,7 @@ all equal
# ------------------------------------------------------------------------------
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
+#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
Returns constructed IRect set to (0, 0, size.width(), size.height()).
Does not validate input; size.width() or size.height() may be negative.
@@ -221,7 +221,7 @@ floor width: 25 height: 35
# ------------------------------------------------------------------------------
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
+#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
Returns constructed IRect set to (l, t, r, b). Does not sort input; Rect may
result in fLeft greater than fRight, or fTop greater than fBottom.
@@ -252,7 +252,7 @@ rect: 5, 25, 15, 35 isEmpty: false
# ------------------------------------------------------------------------------
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
+#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Returns constructed IRect set to
#Formula
@@ -266,7 +266,7 @@ w or h may be negative.
#Param w added to x and stored in fRight ##
#Param h added to y and stored in fBottom ##
-#Return bounds (x, y, x + w, y + h) ##
+#Return bounds at (x, y) with width w and height h ##
#Example
SkIRect rect = SkIRect::MakeXYWH(5, 35, -15, 25);
@@ -627,7 +627,7 @@ large is empty: false
# ------------------------------------------------------------------------------
-#Method friend bool operator==(const SkIRect& a, const SkIRect& b)
+#Method bool operator==(const SkIRect& a, const SkIRect& b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
identical to corresponding members in b.
@@ -652,7 +652,7 @@ test == sorted
# ------------------------------------------------------------------------------
-#Method friend bool operator!=(const SkIRect& a, const SkIRect& b)
+#Method bool operator!=(const SkIRect& a, const SkIRect& b)
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
identical to the corresponding member in b.
diff --git a/docs/SkMatrix_Reference.bmh b/docs/SkMatrix_Reference.bmh
index db7e7c3c73..0db0fa881e 100644
--- a/docs/SkMatrix_Reference.bmh
+++ b/docs/SkMatrix_Reference.bmh
@@ -3,10 +3,13 @@
#Class SkMatrix
-The SkMatrix class holds a 3x3 matrix for transforming coordinates.
+Matrix holds a 3x3 matrix for transforming coordinates.
+Matrix elements are in column major order.
+
SkMatrix does not have a constructor, so it must be explicitly initialized
using either reset() - to construct an identity matrix, or one of the set
functions (e.g. setTranslate, setRotate, etc.).
+
SkMatrix is not thread safe unless getType is called first.
#Topic Overview
@@ -25,8 +28,10 @@ SkMatrix is not thread safe unless getType is called first.
#Legend
# description # function ##
#Legend ##
-# friend SK_API bool operator!=(const SkMatrix& a, const SkMatrix& b) # ##
-# friend SK_API bool operator==(const SkMatrix& a, const SkMatrix& b) # ##
+# friend SK_API bool operator!=(const SkMatrix& a, const SkMatrix& b) # Returns true if members are unequal. ##
+# friend SK_API bool operator==(const SkMatrix& a, const SkMatrix& b) # Returns true if members are equal. ##
+# SkScalar operator[](int index) const # Returns one of nine Matrix values. ##
+# SkScalar& operator[](int index) # Returns a writable reference to one of nine Matrix values. ##
#Table ##
#Subtopic ##
@@ -35,46 +40,45 @@ SkMatrix is not thread safe unless getType is called first.
#Legend
# description # function ##
#Legend ##
-# Concat # ##
-# GetMapPtsProc # ##
-# GetMapXYProc # ##
-# I # ##
-# InvalidMatrix # ##
-# MakeRectToRect # ##
-# MakeScale # ##
-# MakeTrans # ##
-# SetAffineIdentity # ##
-# [ # ##
-# asAffine # ##
-# cheapEqualTo # ##
-# decomposeScale # ##
-# dirtyMatrixTypeCache # ##
-# dump # ##
-# fixedStepInX # ##
-# get # ##
-# get9 # ##
-# getMapPtsProc # ##
-# getMapXYProc # ##
-# getMaxScale # ##
-# getMinMaxScales # ##
-# getMinScale # ##
-# getPerspX # ##
-# getPerspY # ##
-# getScaleX # ##
-# getScaleY # ##
-# getSkewX # ##
-# getSkewY # ##
-# getTranslateX # ##
-# getTranslateY # ##
-# getType # ##
-# hasPerspective # ##
-# invert # ##
-# isFinite # ##
-# isFixedStepInX # ##
-# isIdentity # ##
-# isScaleTranslate # ##
-# isSimilarity # ##
-# isTranslate # ##
+# Concat # Returns the concatenation of Matrix pair. ##
+# GetMapPtsProc # Returns optimal function to map Point array. ##
+# GetMapXYProc # Returns optimal function to map one Point. ##
+# I # Returns a reference to a const identity Matrix. ##
+# InvalidMatrix # Returns a reference to a const invalid Matrix. ##
+# MakeRectToRect # Constructs from source Rect to destination Rect. ##
+# MakeScale # Constructs from scale in x and y. ##
+# MakeTrans # Constructs from translate in x and y. ##
+# SetAffineIdentity # Sets 2x3 array to identity. ##
+# asAffine # Copies to 2x3 array. ##
+# cheapEqualTo # Compares Matrix pair using memcmp(). ##
+# decomposeScale # Separates scale if possible. ##
+# dirtyMatrixTypeCache # Private; used by testing. ##
+# dump # Sends text representation using floats to standard output. ##
+# fixedStepInX # Returns step in x for a position in y. ##
+# get # Returns one of nine Matrix values. ##
+# get9 # Returns all nine Matrix values. ##
+# getMapPtsProc # Returns optimal function to map Point array. ##
+# getMapXYProc # Returns optimal function to map one Point. ##
+# getMaxScale # Returns maximum scaling, if possible. ##
+# getMinMaxScales # Returns minimum and maximum scaling, if possible. ##
+# getMinScale # Returns minimum scaling, if possible. ##
+# getPerspX # Returns horizontal perspective factor. ##
+# getPerspY # Returns vertical perspective factor. ##
+# getScaleX # Returns horizontal scale factor. ##
+# getScaleY # Returns vertical scale factor.##
+# getSkewX # Returns horizontal skew factor. ##
+# getSkewY # Returns vertical skew factor. ##
+# getTranslateX # Returns horizontal translation factor. ##
+# getTranslateY # Returns vertical translation factor. ##
+# getType # Returns transform complexity. ##
+# hasPerspective # Returns if transform includes perspective. ##
+# invert # Returns inverse, if possible. ##
+# isFinite # Returns if all Matrix values are not infinity, NaN. ##
+# isFixedStepInX # Returns if transformation supports fixed step in x. ##
+# isIdentity # Returns if matrix equals the identity Matrix .##
+# isScaleTranslate # Returns if transform is limited to scale and translate. ##
+# isSimilarity # Returns if transform is limited to square scale and rotation. ##
+# isTranslate # Returns if transform is limited to translate. ##
# mapHomogeneousPoints # ##
# mapPoints # ##
# mapPointsWithStride # ##
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index 8eb00777b7..e38b30da77 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -1025,7 +1025,7 @@ canvas->drawPath(path, paint);
#Enum Convexity
#Code
- enum Convexity {
+ enum Convexity : uint8_t {
kUnknown_Convexity,
kConvex_Convexity,
kConcave_Convexity,
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index 57f3ec6b98..7dc1e3776a 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -28,10 +28,10 @@ integer input cannot convert to SkScalar without loss of precision.
#Subtopic Operators
#Table
#Legend
-# description # function ##
+# description # function ##
#Legend ##
-# friend bool operator!=(const SkRect& a, const SkRect& b) # Returns true if member bits are unequal. ##
-# friend bool operator==(const SkRect& a, const SkRect& b) # Returns true if member bits are equal. ##
+# bool operator!=(const SkRect& a, const SkRect& b) # Returns true if member bits are unequal. ##
+# bool operator==(const SkRect& a, const SkRect& b) # Returns true if member bits are equal. ##
#Table ##
#Subtopic ##
@@ -47,6 +47,7 @@ integer input cannot convert to SkScalar without loss of precision.
# MakeIWH # Constructs from int input returning (0, 0, width, height). ##
# MakeLTRB # Constructs from SkScalar left, top, right, bottom. ##
# MakeLargest # Constructs (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax). ##
+# MakeLargestS32 # Constructs largest signed integers that fit in 32-bit float. ##
# MakeSize # Constructs from Size returning (0, 0, width, height). ##
# MakeWH # Constructs from SkScalar input returning (0, 0, width, height). ##
# MakeXYWH # Constructs from SkScalar input returning (x, y, width, height). ##
@@ -184,13 +185,42 @@ outset a little more isFinite: false
##
##
-#SeeAlso isLargest setLargest SkIRect::MakeLargest
+#SeeAlso MakeLargestS32 isLargest setLargest SkIRect::MakeLargest
##
# ------------------------------------------------------------------------------
-#Method static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
+#Method static SkRect SK_WARN_UNUSED_RESULT MakeLargestS32()
+
+Returns constructed Rect that can be represented exactly with IRect. The left
+and top are set to the most negative integer value that fits in a 32-bit float,
+and the right and bottom are set to the most positive finite value that fits in
+a 32-bit float.
+
+These are the largest values for which round() is well defined.
+
+#Return bounds (SK_MinS32FitsInFloat, SK_MinS32FitsInFloat,
+ SK_MaxS32FitsInFloat, SK_MaxS32FitsInFloat)
+##
+
+#Example
+ SkRect f_rect = SkRect::MakeLargestS32();
+ SkIRect i_rect = f_rect.round();
+ SkRect r_rect = SkRect::Make(i_rect);
+ SkDebugf("f_rect %c= r_rect\n", f_rect == r_rect ? '=' : '!');
+#StdOut
+f_rect == r_rect
+##
+##
+
+#SeeAlso MakeLargest isLargest setLargest SkIRect::MakeLargest
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
Returns constructed Rect set to SkScalar values (0, 0, w, h). Does not
validate input; w or h may be negative.
@@ -253,7 +283,7 @@ i_rect width: 125000111 f_rect width:125000112
# ------------------------------------------------------------------------------
-#Method static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
+#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
Returns constructed Rect set to (0, 0, size.width(), size.height()). Does not
validate input; size.width() or size.height() may be negative.
@@ -313,7 +343,7 @@ rect: 5, 25, 15, 35 isEmpty: false
# ------------------------------------------------------------------------------
-#Method static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
+#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
Returns constructed Rect set to
#Formula
@@ -327,7 +357,7 @@ w or h may be negative.
#Param w added to x and stored in fRight ##
#Param h added to y and stored in fBottom ##
-#Return bounds (x, y, x + w, y + h) ##
+#Return bounds at (x, y) with width w and height h ##
#Example
SkRect rect = SkRect::MakeXYWH(5, 35, -15, 25);
@@ -784,7 +814,7 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38
# ------------------------------------------------------------------------------
-#Method friend bool operator==(const SkRect& a, const SkRect& b)
+#Method bool operator==(const SkRect& a, const SkRect& b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
equal to the corresponding members in b.
@@ -827,7 +857,7 @@ tests are equal
# ------------------------------------------------------------------------------
-#Method friend bool operator!=(const SkRect& a, const SkRect& b)
+#Method bool operator!=(const SkRect& a, const SkRect& b)
Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not
equal the corresponding members in b.
@@ -1962,7 +1992,7 @@ rect: 30, 50, 40, 60
# ------------------------------------------------------------------------------
-#Method bool contains(const SkRect& r) const {
+#Method bool contains(const SkRect& r) const
Returns true if Rect contains r.
Returns false if Rect is empty or r is empty.
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index d6a77b9743..0239034eec 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -443,6 +443,12 @@ FT_Load_Glyph
#Typedef SkScalar
#Typedef ##
##
+ #Const SK_MinS32FitsInFloat
+ to be written
+ ##
+ #Const SK_MaxS32FitsInFloat
+ to be written
+ ##
#Const SK_ScalarMin
to be written
##