From 884dd7d428e3913efaead21af83a9d8848062c83 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 11 Oct 2017 10:37:52 -0400 Subject: 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 Commit-Queue: Cary Clark --- site/user/api/SkBitmap_Reference.md | 1 + site/user/api/SkCanvas_Reference.md | 74 +++++++++++++++++++++++++++++++++++ site/user/api/SkIRect_Reference.md | 32 +++++++-------- site/user/api/SkPath_Reference.md | 2 +- site/user/api/SkRect_Reference.md | 78 +++++++++++++++++++++++++++---------- site/user/api/undocumented.md | 6 +++ 6 files changed, 156 insertions(+), 37 deletions(-) (limited to 'site') diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 076cebac50..abff9ffbb1 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -211,6 +211,7 @@ true if pixels are allocated #### Example Output ~~~~ +#Volatile pixel address = (nil) pixel address = 0x560ddd0ac670 ~~~~ diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 1c5d804692..8d39ac47ed 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -5245,3 +5245,77 @@ clip is not rect --- +# Class SkAutoCanvasRestore +Stack helper class calls + + +## SkAutoCanvasRestore + +
+SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)
+
+ +Preserves Canvas save count. Optionally saves Canvas Clip and Matrix. + +### Parameters + + + + +
canvas +Canvas to guard
doSave +call SkCanvas::save()
+ +### Return Value + +utility to restore Canvas state on destructor + +### Example + +
+ +### See Also + +SkCanvas::save SkCanvas::restore + +--- + + +## ~SkAutoCanvasRestore + +
+~SkAutoCanvasRestore()
+
+ +Restores Canvas to saved state. + +### Example + +
+ +### See Also + +SkCanvas::save SkCanvas::restore + +--- + + +## restore + +
+void restore()
+
+ +Restores Canvas to saved state immediately. Subsequent calls and class +destructor have no effect. + +### Example + +
+ +### See Also + +SkCanvas::save SkCanvas::restore + +--- + diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md index c7c643103b..1982c5094d 100644 --- a/site/user/api/SkIRect_Reference.md +++ b/site/user/api/SkIRect_Reference.md @@ -21,8 +21,8 @@ its top, it is considered empty. | description | function | | --- | --- | -| 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. | ## Member Functions @@ -97,7 +97,7 @@ When equal to or less than fTop, IR ## MakeEmpty
-static SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
+static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
 
Returns constructed
IRect set to (0, 0, 0, 0). @@ -169,7 +169,7 @@ outset isEmpty: true ## MakeWH
-static SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
+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 @@ -210,7 +210,7 @@ all equal ## MakeSize
-static SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
+static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
 
Returns constructed IRect set to (0, 0, size.width, size.height). @@ -250,8 +250,8 @@ floor width: 25 height: 35 ## MakeLTRB
-static SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r,
-                                              int32_t b)
+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 @@ -297,8 +297,8 @@ rect: 5, 25, 15, 35 isEmpty: false ## MakeXYWH
-static SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w,
-                                              int32_t h)
+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(x, y, x + w, y + h). @@ -320,7 +320,7 @@ added to y and stored in fBo ### Return Value -bounds (x, y, x + w, y + h) +bounds at (x, y) with width w and height h ### Example @@ -783,7 +783,7 @@ large is empty: false ## operator==
-friend bool operator==(const SkIRect& a, const SkIRect& b)
+bool operator==(const SkIRect& a, const SkIRect& b)
 
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are @@ -824,7 +824,7 @@ test == sorted ## operator!=
-friend bool operator!=(const SkIRect& a, const SkIRect& b)
+bool operator!=(const SkIRect& a, const SkIRect& b)
 
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not @@ -1019,9 +1019,9 @@ rect2: {3, 4, 1, 2} void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height) -Sets IRect to(x, y, x + w, y + h). +Sets IRect to(x, y, x + width, y + height). Does not validate input; -w or h may be negative. +width or height may be negative. ### Parameters @@ -1174,7 +1174,7 @@ If dy is positive, IRectRect inset symetrically left and right, top and bottom +Rect inset symmetrically left and right, top and bottom ### Example @@ -1220,7 +1220,7 @@ If dy is positive, IRectRect outset symetrically left and right, top and bottom +Rect outset symmetrically left and right, top and bottom ### Example diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index 791dc17213..bb3634e373 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -843,7 +843,7 @@ unmodified by the original FillType. ## Enum SkPath::Convexity
-enum Convexity {
+enum Convexity : uint8_t {
 kUnknown Convexity, 
 kConvex Convexity,
 kConcave Convexity, 
diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md
index e067bf379c..4dd16b897e 100644
--- a/site/user/api/SkRect_Reference.md
+++ b/site/user/api/SkRect_Reference.md
@@ -24,8 +24,8 @@ integer input cannot convert to SkScalar wit
 
 | description | function |
 | --- | ---  |
-| 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. |
 
 ##  Member Functions
 
@@ -38,6 +38,7 @@ integer input cannot convert to SkScalar wit
 | 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). |
@@ -180,7 +181,44 @@ outset a little more isFinite: false
 
 ### See Also
 
-isLargest setLargest SkIRect::MakeLargest
+MakeLargestS32 isLargest setLargest SkIRect::MakeLargest
+
+---
+
+
+## MakeLargestS32
+
+
+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 Value + +bounds (SK MinS32FitsInFloat, SK MinS32FitsInFloat, +SK MaxS32FitsInFloat, SK MaxS32FitsInFloat) + +### Example + +
+ +#### Example Output + +~~~~ +f_rect == r_rect +~~~~ + +
+ +### See Also + +MakeLargest isLargest setLargest SkIRect::MakeLargest --- @@ -188,7 +226,7 @@ outset a little more isFinite: false ## MakeWH
-static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
+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 @@ -277,7 +315,7 @@ i_rect width: 125000111 f_rect width:125000112 ## MakeSize
-static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
+static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
 
Returns constructed Rect set to (0, 0, size.width, size.height). Does not @@ -364,8 +402,8 @@ rect: 5, 25, 15, 35 isEmpty: false ## MakeXYWH
-static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w,
-                                             SkScalar h)
+static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y,
+                                                       SkScalar w, SkScalar h)
 
Returns constructed Rect set to(x, y, x + w, y + h). @@ -387,7 +425,7 @@ added to y and stored in fBott ### Return Value -bounds (x, y, x + w, y + h) +bounds at (x, y) with width w and height h ### Example @@ -978,7 +1016,7 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38 ## operator==
-friend bool operator==(const SkRect& a, const SkRect& b)
+bool operator==(const SkRect& a, const SkRect& b)
 
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are @@ -1025,7 +1063,7 @@ tests are equal ## operator!=
-friend bool operator!=(const SkRect& a, const SkRect& b)
+bool operator!=(const SkRect& a, const SkRect& b)
 
Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not @@ -1502,9 +1540,9 @@ corner to include void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height)
-Sets Rect to(x, y, x + w, y + h). +Sets Rect to(x, y, x + width, y + height). Does not validate input; -w or h may be negative. +width or height may be negative. ### Parameters @@ -1545,8 +1583,8 @@ rect: -10, 35, 5, 60 isEmpty: false void setWH(SkScalar width, SkScalar height) -Sets Rect to (0, 0, w, h). Does not validate input; -w or h may be negative. +Sets Rect to (0, 0, width, height). Does not validate input; +width or height may be negative. ### Parameters @@ -1711,7 +1749,7 @@ added to fTop and subtracted from Rect inset symetrically left and right, top and bottom +Rect inset symmetrically left and right, top and bottom ### Example @@ -1757,7 +1795,7 @@ subtracted to fTop and added from Rect outset symetrically left and right, top and bottom +Rect outset symmetrically left and right, top and bottom ### Example @@ -2330,7 +2368,7 @@ void joinNonEmptyArg(const SkRect& r) Sets Rect to the union of itself and r. Asserts if r is empty and SK DEBUG is defined. -If Rect is empty, sets rect to r. +If Rect is empty, sets Rect to r. May produce incorrect results if r is empty. @@ -2343,7 +2381,7 @@ expansion Rect ### Example -
Since rect is not sorted, first result is copy of toJoin.
+
Since Rect is not sorted, first result is copy of toJoin.
#### Example Output @@ -2380,7 +2418,7 @@ expansion Rect ### Example -
Since rect is not sorted, first result is not useful.
+
Since Rect is not sorted, first result is not useful.
#### Example Output @@ -2521,7 +2559,7 @@ rect: 30, 50, 40, 60 ## contains
-bool contains(const SkRect& r) const {
+bool contains(const SkRect& r) const
 
Returns true if Rect contains r. diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 721283cdd1..cd6cb5fbd1 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -736,6 +736,12 @@ template <typename D, typename S> inline bool SkTFitsIn(S s) ### Constants + + + + + + -- cgit v1.2.3
SK_MinS32FitsInFloat to be written
SK_MaxS32FitsInFloat to be written
SK_ScalarMin to be written