aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/SkIRect_Reference.bmh106
-rw-r--r--docs/SkRect_Reference.bmh182
-rw-r--r--experimental/sksg/SkSGNode.cpp4
-rw-r--r--include/core/SkRect.h87
-rw-r--r--include/gpu/GrRenderTarget.h2
-rw-r--r--public.bzl1
-rw-r--r--samplecode/SampleCCPRGeometry.cpp3
-rw-r--r--src/core/SkDraw.cpp3
-rw-r--r--src/core/SkMiniRecorder.cpp5
-rw-r--r--src/core/SkRectPriv.h24
-rw-r--r--src/core/SkScan_Path.cpp5
-rw-r--r--src/core/SkThreadedBMPDevice.cpp21
-rw-r--r--src/gpu/GrRenderTarget.cpp11
-rw-r--r--src/gpu/GrTestUtils.cpp3
-rw-r--r--src/gpu/GrTextureProducer.cpp3
-rw-r--r--src/gpu/ops/GrDrawAtlasOp.cpp4
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h3
-rw-r--r--tests/LazyProxyTest.cpp3
-rw-r--r--tests/PictureBBHTest.cpp3
-rw-r--r--tests/PictureTest.cpp15
-rw-r--r--tests/SGTest.cpp5
-rw-r--r--tests/WindowRectanglesTest.cpp5
-rw-r--r--tools/debugger/SkDebugCanvas.cpp3
23 files changed, 105 insertions, 396 deletions
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index fec57a9d9a..a3963b2029 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -40,7 +40,6 @@ its top, it is considered empty.
# IntersectsNoEmptyCheck # Returns true if areas overlap. Skips empty check. ##
# MakeEmpty # Returns bounds of (0, 0, 0, 0). ##
# MakeLTRB # Constructs from int left, top, right, bottom. ##
-# MakeLargest # Constructs from (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32). ##
# MakeSize # Constructs from ISize returning (0, 0, width, height). ##
# MakeWH # Constructs from int input returning (0, 0, width, height). ##
# MakeXYWH # Constructs from int input returning (x, y, width, height). ##
@@ -55,7 +54,6 @@ its top, it is considered empty.
# intersectNoEmptyCheck # Sets to shared area; returns true if not empty. Skips empty check. ##
# is16Bit # Returns true if members fit in 16-bit word. ##
# isEmpty # Returns true if width or height are zero or negative. ##
-# isLargest # Returns true if equal to (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32). ##
# join() # Sets to union of bounds. ##
# left() # Returns smaller bounds in x, if sorted. ##
# makeInset # Constructs from sides moved symmetrically about the center. ##
@@ -70,8 +68,6 @@ its top, it is considered empty.
# set() # Sets to (left, top, right, bottom). ##
# setEmpty # Sets to (0, 0, 0, 0). ##
# setLTRB # Sets to SkScalar input (left, top, right, bottom). ##
-# setLargest # Sets to (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32). ##
-# setLargestInverted # Sets to (SK_MaxS32, SK_MaxS32, SK_MinS32, SK_MinS32). ##
# setXYWH # Sets to (x, y, width, height). ##
# size() # Returns ISize (width, height). ##
# sort() # Orders sides from smaller to larger. ##
@@ -132,35 +128,7 @@ outset rect isEmpty: false
##
##
-#SeeAlso EmptyIRect isEmpty setEmpty setLargestInverted SkRect::MakeEmpty
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method static SkIRect SK_WARN_UNUSED_RESULT MakeLargest()
-
-Returns constructed IRect setting left and top to most negative value, and
-setting right and bottom to most positive value.
-
-#Return bounds (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32) ##
-
-#Example
- SkIRect rect = SkIRect::MakeLargest();
- SkDebugf("MakeLargest isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("MakeLargest isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
- rect.outset(1, 1);
- SkDebugf("outset isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
-#StdOut
-MakeLargest isLargest: true
-MakeLargest isEmpty: false
-outset isLargest: false
-outset isEmpty: true
-##
-##
-
-#SeeAlso isLargest setLargest SkRect::MakeLargest
+#SeeAlso EmptyIRect isEmpty setEmpty SkRect::MakeEmpty
##
@@ -599,34 +567,6 @@ sorted: {20, 40, 20, 50} is empty
# ------------------------------------------------------------------------------
-#Method bool isLargest() const
-
-Returns true if IRect encloses largest possible area.
-
-#Return true if equal to (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32) ##
-
-#Example
-#Description
-Note that the width is not negative, yet it cannot be represented as a 32-bit
-signed integer.
-##
- SkIRect large = SkIRect::MakeLargest();
- SkDebugf("large is largest: %s\n" ,large.isLargest() ? "true" : "false");
- SkDebugf("large width %d\n", large.width());
- SkDebugf("large is empty: %s\n", large.isEmpty() ? "true" : "false");
-#StdOut
-large is largest: true
-large width -2
-large is empty: false
-##
-##
-
-#SeeAlso MakeLargest SkRect::isLargest
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method bool operator==(const SkIRect& a, const SkIRect& b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
@@ -821,50 +761,6 @@ rect: -10, 35, 5, 60 isEmpty: false
# ------------------------------------------------------------------------------
-#Method void setLargest()
-
-Sets rectangle left and top to most negative value, and sets
-right and bottom to most positive value.
-
-#Example
- SkIRect rect;
- rect.setLargest();
- SkDebugf("MakeLargest isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("MakeLargest isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
- rect.outset(1, 1);
- SkDebugf("outset isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
-#StdOut
-MakeLargest isLargest: true
-MakeLargest isEmpty: false
-outset isLargest: false
-outset isEmpty: true
-##
-##
-
-#SeeAlso MakeLargest isLargest setLargestInverted SK_MinS32 SK_MaxS32
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method void setLargestInverted()
-#ToDo move this to private
-##
-
-Sets rectangle left and top to most positive value, and sets
-right and bottom to most negative value. This is used internally to
-flag that a condition is met, but otherwise has no special purpose.
-
-#NoExample
-##
-
-#SeeAlso setEmpty setLargest
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method SkIRect makeOffset(int32_t dx, int32_t dy) const
Returns IRect offset by (dx, dy).
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index d803c9373a..120191957a 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -46,8 +46,6 @@ integer input cannot convert to SkScalar without loss of precision.
# MakeFromIRect # Deprecated. ##
# 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). ##
@@ -65,7 +63,6 @@ integer input cannot convert to SkScalar without loss of precision.
# intersects() # Returns true if areas overlap. ##
# isEmpty # Returns true if width or height are zero or negative. ##
# isFinite # Returns true if no member is infinite or NaN. ##
-# isLargest # Returns equal to (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax). ##
# isSorted # Returns true if width or height are zero or positive. ##
# iset() # Sets to int input (left, top, right, bottom). ##
# isetWH # Sets to int input (0, 0, width, height). ##
@@ -89,8 +86,6 @@ integer input cannot convert to SkScalar without loss of precision.
# setBoundsCheck # Sets to upper and lower limits of Point array. ##
# setEmpty # Sets to (0, 0, 0, 0). ##
# setLTRB # Sets to SkScalar input (left, top, right, bottom). ##
-# setLargest # Sets to (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax). ##
-# setLargestInverted # Sets to (SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_ScalarMin). ##
# setWH # Sets to SkScalar input (0, 0, width, height). ##
# setXYWH # Sets to SkScalar input (x, y, width, height). ##
# sort() # Orders sides from smaller to larger. ##
@@ -152,69 +147,7 @@ outset rect isEmpty: false
##
##
-#SeeAlso isEmpty setEmpty setLargestInverted SkIRect::MakeEmpty
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method static SkRect SK_WARN_UNUSED_RESULT MakeLargest()
-
-Returns constructed Rect setting left and top to most negative finite value, and
-setting right and bottom to most positive finite value.
-
-#Return bounds (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax) ##
-
-#Example
- SkRect rect = SkRect::MakeLargest();
- SkDebugf("MakeLargest isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("MakeLargest isFinite: %s\n", rect.isFinite() ? "true" : "false");
- rect.outset(1e31, 1e31);
- SkDebugf("outset a little isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset a little isFinite: %s\n", rect.isFinite() ? "true" : "false");
- rect.outset(1e32, 1e32);
- SkDebugf("outset a little more isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset a little more isFinite: %s\n", rect.isFinite() ? "true" : "false");
-#StdOut
-MakeLargest isLargest: true
-MakeLargest isFinite: true
-outset a little isLargest: true
-outset a little isFinite: true
-outset a little more isLargest: false
-outset a little more isFinite: false
-##
-##
-
-#SeeAlso MakeLargestS32 isLargest setLargest SkIRect::MakeLargest
-
-##
-
-# ------------------------------------------------------------------------------
-
-#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
+#SeeAlso isEmpty setEmpty SkIRect::MakeEmpty
##
@@ -509,37 +442,6 @@ sorted: {20, 40, 20, 50} is sorted
# ------------------------------------------------------------------------------
-#Method bool isLargest() const
-
-Returns true if Rect encloses largest possible area.
-
-#Return true if equal to (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax) ##
-
-#Example
-#Description
-Note that the width cannot be represented as a 32-bit finite value.
-##
- SkRect large = SkRect::MakeLargest();
- SkDebugf("large is largest: %s\n" ,large.isLargest() ? "true" : "false");
- SkDebugf("large width %g\n", large.width());
- SkDebugf("large is empty: %s\n", large.isEmpty() ? "true" : "false");
- SkDebugf("large is sorted: %s\n", large.isSorted() ? "true" : "false");
- SkDebugf("large is finite: %s\n", large.isFinite() ? "true" : "false");
-#StdOut
-large is largest: true
-large width inf
-large is empty: false
-large is sorted: true
-large is finite: true
-##
-##
-
-#SeeAlso MakeLargest SkIRect::isLargest
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method bool isFinite() const
Returns true if all values in the rectangle are finite: SK_ScalarMin or larger,
@@ -548,7 +450,7 @@ and SK_ScalarMax or smaller.
#Return true if no member is infinite or NaN ##
#Example
- SkRect largest = SkRect::MakeLargest();
+SkRect largest = { SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax };
SkDebugf("largest is finite: %s\n", largest.isFinite() ? "true" : "false");
SkDebugf("large width %g\n", largest.width());
SkRect widest = SkRect::MakeWH(largest.width(), largest.height());
@@ -1293,68 +1195,6 @@ rect: -15, 0, 0, 25 isEmpty: false
# ------------------------------------------------------------------------------
-#Method void setLargest()
-
-Sets rectangle left and top to most negative finite value, and sets
-right and bottom to most positive finite value.
-
-#Example
- SkRect rect;
- rect.setLargest();
- SkDebugf("MakeLargest isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("MakeLargest isFinite: %s\n", rect.isFinite() ? "true" : "false");
- rect.outset(1e31, 1e31);
- SkDebugf("outset a little isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset a little isFinite: %s\n", rect.isFinite() ? "true" : "false");
- rect.outset(1e32, 1e32);
- SkDebugf("outset a little more isLargest: %s\n", rect.isLargest() ? "true" : "false");
- SkDebugf("outset a little more isFinite: %s\n", rect.isFinite() ? "true" : "false");
-#StdOut
-MakeLargest isLargest: true
-MakeLargest isFinite: true
-outset a little isLargest: true
-outset a little isFinite: true
-outset a little more isLargest: false
-outset a little more isFinite: false
-##
-##
-
-#SeeAlso MakeLargest isLargest setLargestInverted SK_ScalarMin SK_ScalarMax
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method void setLargestInverted()
-
-Sets rectangle left and top to most positive finite value, and sets
-right and bottom to most negative finite value.
-
-Use to initial Rect before one or more calls to growToInclude.
-
-#Example
- auto debugster = [](const char* prefix, const SkRect& rect) -> void {
- SkDebugf("%s ", prefix);
- SkDebugf("rect: %g, %g, %g, %g ", rect.left(), rect.top(), rect.right(), rect.bottom());
- SkDebugf("isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
- };
- SkRect ptBounds;
- ptBounds.setLargestInverted();
- debugster("original", ptBounds);
- ptBounds.growToInclude( { 42, 24 } );
- debugster("grown", ptBounds);
-#StdOut
-original rect: 3.40282e+38, 3.40282e+38, -3.40282e+38, -3.40282e+38 isEmpty: true
-grown rect: 42, 24, 42, 24 isEmpty: true
-##
-##
-
-#SeeAlso growToInclude setEmpty setLargest
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method SkRect makeOffset(SkScalar dx, SkScalar dy) const
Returns Rect offset by (dx, dy).
@@ -1905,14 +1745,13 @@ fLeft <= pt.fX <= fRight && fTop <= pt.fY <= fBottom
##
.
-If Rect is initialized with setLargestInverted, then Rect will contain bounds of
+If Rect is inverted, then Rect will contain bounds of
Points after one or more calls. In this case, Rect is empty after first call.
#Param pt Point to include ##
#Example
- SkRect rect;
- rect.setLargestInverted();
+ SkRect rect = { 1, 1, 0, 0 };
rect.growToInclude( { 42, 24 } );
SkDebugf("rect: %g, %g, %g, %g ", rect.left(), rect.top(), rect.right(), rect.bottom());
SkDebugf("isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
@@ -1921,7 +1760,7 @@ rect: 42, 24, 42, 24 isEmpty: true
##
##
-#SeeAlso setLargestInverted join
+#SeeAlso join
##
@@ -1936,7 +1775,7 @@ fLeft <= pt.fX <= fRight && fTop <= pt.fY <= fBottom
##
.
-If Rect is initialized with setLargestInverted, then Rect will contain bounds of
+If Rect is inverted, then Rect will contain bounds of
Points after one or more calls. In this case, Rect is empty after first call.
#Param pts Point array ##
@@ -1953,7 +1792,7 @@ rect: 30, 50, 40, 60
##
##
-#SeeAlso setLargestInverted join
+#SeeAlso join
##
@@ -1972,7 +1811,7 @@ Point may be followed with other data in each array element. stride is number
of bytes in element; the interval to skip to advance from one Point to
the next.
-If Rect is initialized with setLargestInverted, then Rect will contain bounds of
+If Rect is inverted, then Rect will contain bounds of
Points after one or more calls. In this case, Rect is empty after first call.
#Param pts array of elements beginning with Point ##
@@ -1982,8 +1821,7 @@ Points after one or more calls. In this case, Rect is empty after first call.
#Bug 7142 ##
#Example
SkPoint3 pts[] = { { 30, 50, -1 }, { 40, 50, -1 }, { 30, 60, -1 } };
- SkRect rect;
- rect.setLargestInverted();
+ SkRect rect = { 1, 1, 0, 0 };
rect.growToInclude((SkPoint* ) &pts[0].fX, sizeof(SkPoint3), SK_ARRAY_COUNT(pts));
SkDebugf("rect: %g, %g, %g, %g ", rect.left(), rect.top(), rect.right(), rect.bottom());
#StdOut
@@ -1992,7 +1830,7 @@ rect: 30, 50, 40, 60
##
##
-#SeeAlso setLargestInverted join
+#SeeAlso join
##
diff --git a/experimental/sksg/SkSGNode.cpp b/experimental/sksg/SkSGNode.cpp
index 768fdfa7b6..b634175b21 100644
--- a/experimental/sksg/SkSGNode.cpp
+++ b/experimental/sksg/SkSGNode.cpp
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
+#include "SkRectPriv.h"
#include "SkSGNode.h"
-
#include "SkSGInvalidationController.h"
namespace sksg {
@@ -40,7 +40,7 @@ private:
Node::Node(uint32_t invalTraits)
: fInvalReceiver(nullptr)
- , fBounds(SkRect::MakeLargestS32())
+ , fBounds(SkRectPriv::MakeLargestS32())
, fInvalTraits(invalTraits)
, fFlags(kInvalidated_Flag) {}
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index f4c700b34b..dcb8615350 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -55,16 +55,16 @@ struct SK_API SkIRect {
return SkIRect{0, 0, 0, 0};
}
+#ifdef SK_SUPPORT_LEGACY_RECTMAKELARGEST
/** Returns constructed SkIRect setting left and top to most negative value, and
setting right and bottom to most positive value.
@return bounds (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32)
*/
static SkIRect SK_WARN_UNUSED_RESULT MakeLargest() {
- SkIRect r;
- r.setLargest();
- return r;
+ return { SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32 };
}
+#endif
/** Returns constructed SkIRect set to (0, 0, w, h). Does not validate input; w or h
may be negative.
@@ -202,14 +202,6 @@ struct SK_API SkIRect {
*/
bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
- /** Returns true if SkIRect encloses largest possible area.
-
- @return true if equal to (SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32)
- */
- bool isLargest() const { return SK_MinS32 == fLeft &&
- SK_MinS32 == fTop &&
- SK_MaxS32 == fRight &&
- SK_MaxS32 == fBottom; }
/** Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
identical to corresponding members in b.
@@ -295,23 +287,6 @@ struct SK_API SkIRect {
fBottom = y + height;
}
- /** Sets rectangle left and top to most negative value, and sets
- right and bottom to most positive value.
- */
- void setLargest() {
- fLeft = fTop = SK_MinS32;
- fRight = fBottom = SK_MaxS32;
- }
-
- /** Sets rectangle left and top to most positive value, and sets
- right and bottom to most negative value. This is used internally to
- flag that a condition is met, but otherwise has no special purpose.
- */
- void setLargestInverted() {
- fLeft = fTop = SK_MaxS32;
- fRight = fBottom = SK_MinS32;
- }
-
/** Returns SkIRect offset by (dx, dy).
If dx is negative, SkIRect returned is moved to the left.
@@ -748,33 +723,16 @@ struct SK_API SkRect {
return SkRect{0, 0, 0, 0};
}
+#ifdef SK_SUPPORT_LEGACY_RECTMAKELARGEST
/** Returns constructed SkRect setting left and top to most negative finite value, and
setting right and bottom to most positive finite value.
@return bounds (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax)
*/
static SkRect SK_WARN_UNUSED_RESULT MakeLargest() {
- SkRect r;
- r.setLargest();
- return r;
- }
-
- /** Returns constructed SkRect that can be represented exactly with SkIRect. 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)
- */
- static SkRect SK_WARN_UNUSED_RESULT MakeLargestS32() {
- const SkRect r = MakeLTRB(SK_MinS32FitsInFloat, SK_MinS32FitsInFloat,
- SK_MaxS32FitsInFloat, SK_MaxS32FitsInFloat);
- SkASSERT(r == Make(r.roundOut()));
- return r;
+ return { SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax };
}
+#endif
/** Returns constructed SkRect set to SkScalar values (0, 0, w, h). Does not
validate input; w or h may be negative.
@@ -900,15 +858,6 @@ struct SK_API SkRect {
*/
bool isSorted() const { return fLeft <= fRight && fTop <= fBottom; }
- /** Returns true if SkRect encloses largest possible area.
-
- @return true if equal to (SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax)
- */
- bool isLargest() const { return SK_ScalarMin == fLeft &&
- SK_ScalarMin == fTop &&
- SK_ScalarMax == fRight &&
- SK_ScalarMax == fBottom; }
-
/** Returns true if all values in the rectangle are finite: SK_ScalarMin or larger,
and SK_ScalarMax or smaller.
@@ -1197,24 +1146,6 @@ struct SK_API SkRect {
fBottom = height;
}
- /** Sets rectangle left and top to most negative finite value, and sets
- right and bottom to most positive finite value.
- */
- void setLargest() {
- fLeft = fTop = SK_ScalarMin;
- fRight = fBottom = SK_ScalarMax;
- }
-
- /** Sets rectangle left and top to most positive finite value, and sets
- right and bottom to most negative finite value.
-
- Use to initial SkRect before one or more calls to growToInclude().
- */
- void setLargestInverted() {
- fLeft = fTop = SK_ScalarMax;
- fRight = fBottom = SK_ScalarMin;
- }
-
/** Returns SkRect offset by (dx, dy).
If dx is negative, SkRect returned is moved to the left.
@@ -1483,7 +1414,7 @@ public:
/** Grows SkRect to include (pt.fX, pt.fY), modifying it so that:
fLeft <= pt.fX <= fRight && fTop <= pt.fY <= fBottom.
- If SkRect is initialized with setLargestInverted(), then SkRect will contain bounds of
+ If SkRect is inverted, then SkRect will contain bounds of
points after one or more calls. In this case, SkRect is empty after first call.
@param pt SkPoint to include
@@ -1498,7 +1429,7 @@ public:
/** For each of count SkPoint in pts, grows SkRect to include (pt.fX, pt.fY), modifying
it so that: fLeft <= pt.fX <= fRight && fTop <= pt.fY <= fBottom.
- If SkRect is initialized with setLargestInverted(), then SkRect will contain bounds of
+ If SkRect is inverted, then SkRect will contain bounds of
points after one or more calls. In this case, SkRect is empty after first call.
@param pts SkPoint array
@@ -1515,7 +1446,7 @@ public:
of bytes in element; the interval to skip to advance from one SkPoint to
the next.
- If SkRect is initialized with setLargestInverted(), then SkRect will contain bounds of
+ If SkRect is inverted, then SkRect will contain bounds of
points after one or more calls. In this case, SkRect is empty after first call.
@param pts array of elements beginning with SkPoint
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 93501db9af..4eee7f63ce 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -77,7 +77,7 @@ public:
* Call to indicate that GrRenderTarget was externally resolved. This may
* allow Gr to skip a redundant resolve step.
*/
- void flagAsResolved() { fResolveRect.setLargestInverted(); }
+ void flagAsResolved();
/**
* @return true if the GrRenderTarget requires MSAA resolving
diff --git a/public.bzl b/public.bzl
index 1e2894058a..4b740bf092 100644
--- a/public.bzl
+++ b/public.bzl
@@ -586,6 +586,7 @@ def base_defines(os_conditions):
"SK_JUMPER_DISABLE_8BIT",
# JPEG is in codec_limited
"SK_HAS_JPEG_LIBRARY",
+ "SK_SUPPORT_LEGACY_RECTMAKELARGEST",
] + skia_select(
os_conditions,
[
diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp
index 2efb0e6b14..67fd94ebe7 100644
--- a/samplecode/SampleCCPRGeometry.cpp
+++ b/samplecode/SampleCCPRGeometry.cpp
@@ -19,6 +19,7 @@
#include "SkMakeUnique.h"
#include "SkPaint.h"
#include "SkPath.h"
+#include "SkRectPriv.h"
#include "SkView.h"
#include "ccpr/GrCCPRCoverageProcessor.h"
#include "ccpr/GrCCPRGeometry.h"
@@ -84,7 +85,7 @@ public:
Op(CCPRGeometryView* view)
: INHERITED(ClassID())
, fView(view) {
- this->setBounds(SkRect::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo);
+ this->setBounds(SkRectPriv::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo);
}
const char* name() const override { return "[Testing/Sample code] CCPRGeometryView::Op"; }
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 39b684356a..5068fb0151 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -25,6 +25,7 @@
#include "SkPathEffect.h"
#include "SkRasterClip.h"
#include "SkRasterizer.h"
+#include "SkRectPriv.h"
#include "SkRRect.h"
#include "SkScan.h"
#include "SkShader.h"
@@ -781,7 +782,7 @@ void SkDraw::drawRect(const SkRect& prePaintRect, const SkPaint& paint,
}
}
- if (!SkRect::MakeLargestS32().contains(bbox)) {
+ if (!SkRectPriv::MakeLargestS32().contains(bbox)) {
// bbox.roundOut() is undefined; use slow path.
draw_rect_as_path(*this, prePaintRect, paint, matrix);
return;
diff --git a/src/core/SkMiniRecorder.cpp b/src/core/SkMiniRecorder.cpp
index ec089373e1..6a2edf1f12 100644
--- a/src/core/SkMiniRecorder.cpp
+++ b/src/core/SkMiniRecorder.cpp
@@ -12,6 +12,7 @@
#include "SkPicture.h"
#include "SkPictureCommon.h"
#include "SkRecordDraw.h"
+#include "SkRectPriv.h"
#include "SkTextBlob.h"
using namespace SkRecords;
@@ -29,13 +30,13 @@ public:
// These are fairly easy because we know they can't be affected by any matrix or saveLayers.
static SkRect adjust_for_paint(SkRect bounds, const SkPaint& paint) {
return paint.canComputeFastBounds() ? paint.computeFastBounds(bounds, &bounds)
- : SkRect::MakeLargest();
+ : SkRectPriv::MakeLargest();
}
static SkRect bounds(const DrawRect& op) {
return adjust_for_paint(op.rect, op.paint);
}
static SkRect bounds(const DrawPath& op) {
- return op.path.isInverseFillType() ? SkRect::MakeLargest()
+ return op.path.isInverseFillType() ? SkRectPriv::MakeLargest()
: adjust_for_paint(op.path.getBounds(), op.paint);
}
static SkRect bounds(const DrawTextBlob& op) {
diff --git a/src/core/SkRectPriv.h b/src/core/SkRectPriv.h
index 4dcc4c56ce..422037f4a1 100644
--- a/src/core/SkRectPriv.h
+++ b/src/core/SkRectPriv.h
@@ -19,6 +19,30 @@ public:
static bool PositiveDimensions(const SkIRect& r) {
return r.width() > 0 && r.height() > 0;
}
+
+ static SkRect MakeLargestS32() {
+ const int32_t ihalf = SK_MaxS32 >> 1;
+ const SkScalar half = SkIntToScalar(ihalf);
+
+ return { -half, -half, half, half };
+ }
+
+ static SkRect MakeLargest() {
+ return { SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax };
+ }
+
+ static SkIRect MakeILargest() {
+ return { SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32 };
+ }
+
+ static SkRect MakeLargestInverted() {
+ return { SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_ScalarMin };
+ }
+
+ static SkIRect MakeILargestInverted() {
+ return { SK_MaxS32, SK_MaxS32, SK_MinS32, SK_MinS32 };
+ }
};
+
#endif
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 408815672c..21e2ecbf55 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -13,6 +13,7 @@
#include "SkPath.h"
#include "SkQuadClipper.h"
#include "SkRasterClip.h"
+#include "SkRectPriv.h"
#include "SkRegion.h"
#include "SkTemplates.h"
#include "SkTSort.h"
@@ -643,8 +644,8 @@ void SkScan::FillPath(const SkPath& path, const SkRegion& origClip,
SkRect bounds = path.getBounds();
bool irPreClipped = false;
- if (!SkRect::MakeLargestS32().contains(bounds)) {
- if (!bounds.intersect(SkRect::MakeLargestS32())) {
+ if (!SkRectPriv::MakeLargestS32().contains(bounds)) {
+ if (!bounds.intersect(SkRectPriv::MakeLargestS32())) {
bounds.setEmpty();
}
irPreClipped = true;
diff --git a/src/core/SkThreadedBMPDevice.cpp b/src/core/SkThreadedBMPDevice.cpp
index 098c7216e8..d0f427b64f 100644
--- a/src/core/SkThreadedBMPDevice.cpp
+++ b/src/core/SkThreadedBMPDevice.cpp
@@ -8,6 +8,7 @@
#include "SkThreadedBMPDevice.h"
#include "SkPath.h"
+#include "SkRectPriv.h"
#include "SkTaskGroup.h"
#include "SkVertices.h"
@@ -89,11 +90,11 @@ struct SkThreadedBMPDevice::DrawState {
};
SkIRect SkThreadedBMPDevice::transformDrawBounds(const SkRect& drawBounds) const {
- if (drawBounds.isLargest()) {
- return SkIRect::MakeLargest();
- }
SkRect transformedBounds;
this->ctm().mapRect(&transformedBounds, drawBounds);
+ if (!transformedBounds.isFinite()) {
+ transformedBounds = SkRectPriv::MakeLargestS32();
+ }
return transformedBounds.roundOut();
}
@@ -116,19 +117,19 @@ static inline SkRect get_fast_bounds(const SkRect& r, const SkPaint& p) {
if (p.canComputeFastBounds()) {
result = p.computeFastBounds(r, &result);
} else {
- result = SkRect::MakeLargest();
+ result = SkRectPriv::MakeLargest();
}
return result;
}
void SkThreadedBMPDevice::drawPaint(const SkPaint& paint) {
- THREADED_DRAW(SkRect::MakeLargest(), drawPaint(paint));
+ THREADED_DRAW(SkRectPriv::MakeLargest(), drawPaint(paint));
}
void SkThreadedBMPDevice::drawPoints(SkCanvas::PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
// TODO tighter drawBounds
- SkRect drawBounds = SkRect::MakeLargest();
+ SkRect drawBounds = SkRectPriv::MakeLargest();
THREADED_DRAW(drawBounds, drawPoints(mode, count, pts, paint, nullptr));
}
@@ -153,7 +154,7 @@ void SkThreadedBMPDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint)
void SkThreadedBMPDevice::drawPath(const SkPath& path, const SkPaint& paint,
const SkMatrix* prePathMatrix, bool pathIsMutable) {
- SkRect drawBounds = path.isInverseFillType() ? SkRect::MakeLargest()
+ SkRect drawBounds = path.isInverseFillType() ? SkRectPriv::MakeLargest()
: get_fast_bounds(path.getBounds(), paint);
// For thread safety, make path imutable
THREADED_DRAW(drawBounds, drawPath(path, paint, prePathMatrix, false));
@@ -175,20 +176,20 @@ void SkThreadedBMPDevice::drawSprite(const SkBitmap& bitmap, int x, int y, const
void SkThreadedBMPDevice::drawText(const void* text, size_t len, SkScalar x, SkScalar y,
const SkPaint& paint) {
- SkRect drawBounds = SkRect::MakeLargest(); // TODO tighter drawBounds
+ SkRect drawBounds = SkRectPriv::MakeLargest(); // TODO tighter drawBounds
THREADED_DRAW(drawBounds, drawText((const char*)text, len, x, y, paint, &this->surfaceProps()));
}
void SkThreadedBMPDevice::drawPosText(const void* text, size_t len, const SkScalar xpos[],
int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) {
- SkRect drawBounds = SkRect::MakeLargest(); // TODO tighter drawBounds
+ SkRect drawBounds = SkRectPriv::MakeLargest(); // TODO tighter drawBounds
THREADED_DRAW(drawBounds, drawPosText((const char*)text, len, xpos, scalarsPerPos, offset,
paint, &surfaceProps()));
}
void SkThreadedBMPDevice::drawVertices(const SkVertices* vertices, SkBlendMode bmode,
const SkPaint& paint) {
- SkRect drawBounds = SkRect::MakeLargest(); // TODO tighter drawBounds
+ SkRect drawBounds = SkRectPriv::MakeLargest(); // TODO tighter drawBounds
THREADED_DRAW(drawBounds, drawVertices(vertices->mode(), vertices->vertexCount(),
vertices->positions(), vertices->texCoords(),
vertices->colors(), bmode, vertices->indices(),
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 585a5126a9..3090219751 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -16,6 +16,7 @@
#include "GrRenderTargetPriv.h"
#include "GrStencilAttachment.h"
#include "GrStencilSettings.h"
+#include "SkRectPriv.h"
GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc,
GrRenderTargetFlags flags,
@@ -29,7 +30,7 @@ GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc,
SkASSERT(!(fFlags & GrRenderTargetFlags::kMixedSampled) || fSampleCnt > 0);
SkASSERT(!(fFlags & GrRenderTargetFlags::kWindowRectsSupport) ||
gpu->caps()->maxWindowRectangles() > 0);
- fResolveRect.setLargestInverted();
+ fResolveRect = SkRectPriv::MakeILargestInverted();
}
void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
@@ -48,14 +49,18 @@ void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
void GrRenderTarget::overrideResolveRect(const SkIRect rect) {
fResolveRect = rect;
if (fResolveRect.isEmpty()) {
- fResolveRect.setLargestInverted();
+ fResolveRect = SkRectPriv::MakeILargestInverted();
} else {
if (!fResolveRect.intersect(0, 0, this->width(), this->height())) {
- fResolveRect.setLargestInverted();
+ fResolveRect = SkRectPriv::MakeILargestInverted();
}
}
}
+void GrRenderTarget::flagAsResolved() {
+ fResolveRect = SkRectPriv::MakeILargestInverted();
+}
+
void GrRenderTarget::onRelease() {
SkSafeSetNull(fStencilAttachment);
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index 4c35264643..d5565ca828 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -14,6 +14,7 @@
#include "SkMakeUnique.h"
#include "SkMatrix.h"
#include "SkPath.h"
+#include "SkRectPriv.h"
#include "SkRRect.h"
#if GR_TEST_UTILS
@@ -125,7 +126,7 @@ const SkRect& TestRect(SkRandom* random) {
gRects[0] = SkRect::MakeWH(1.f, 1.f);
gRects[1] = SkRect::MakeWH(1.0f, 256.0f);
gRects[2] = SkRect::MakeWH(256.0f, 1.0f);
- gRects[3] = SkRect::MakeLargest();
+ gRects[3] = SkRectPriv::MakeLargest();
gRects[4] = SkRect::MakeLTRB(-65535.0f, -65535.0f, 65535.0f, 65535.0f);
gRects[5] = SkRect::MakeLTRB(-10.0f, -10.0f, 10.0f, 10.0f);
}
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index c99ee081ac..9593cb6873 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -10,6 +10,7 @@
#include "GrProxyProvider.h"
#include "GrRenderTargetContext.h"
#include "GrTextureProxy.h"
+#include "SkRectPriv.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
#include "effects/GrTextureDomain.h"
@@ -141,7 +142,7 @@ GrTextureProducer::DomainMode GrTextureProducer::DetermineDomainMode(
// we check whether the filter would reach across the edge of the proxy.
// We will only set the sides that are required.
- domainRect->setLargest();
+ *domainRect = SkRectPriv::MakeLargest();
if (coordsLimitedToConstraintRect) {
// We may be able to use the fact that the texture coords are limited to the constraint
// rect in order to avoid having to add a domain.
diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp
index 950acae2d1..2c6f162c64 100644
--- a/src/gpu/ops/GrDrawAtlasOp.cpp
+++ b/src/gpu/ops/GrDrawAtlasOp.cpp
@@ -11,6 +11,7 @@
#include "SkGr.h"
#include "SkRSXform.h"
#include "SkRandom.h"
+#include "SkRectPriv.h"
static sk_sp<GrGeometryProcessor> make_gp(bool hasColors,
GrColor color,
@@ -52,8 +53,7 @@ GrDrawAtlasOp::GrDrawAtlasOp(const Helper::MakeArgs& helperArgs, GrColor color,
installedGeo.fVerts.reset(allocSize);
uint8_t* currVertex = installedGeo.fVerts.begin();
- SkRect bounds;
- bounds.setLargestInverted();
+ SkRect bounds = SkRectPriv::MakeLargestInverted();
int paintAlpha = GrColorUnpackA(installedGeo.fColor);
for (int spriteIndex = 0; spriteIndex < spriteCount; ++spriteIndex) {
// Transform rect
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 282fa98141..1b8a264440 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -19,6 +19,7 @@
#include "SkPathEffect.h"
#include "SkPoint3.h"
#include "SkRasterizer.h"
+#include "SkRectPriv.h"
#include "SkSurfaceProps.h"
#include "SkTInternalLList.h"
@@ -363,7 +364,7 @@ private:
, fColor(GrColor_ILLEGAL)
, fMaskFormat(kA8_GrMaskFormat)
, fFlags(0) {
- fVertexBounds.setLargestInverted();
+ fVertexBounds = SkRectPriv::MakeLargestInverted();
}
SubRunInfo(const SubRunInfo& that)
: fBulkUseToken(that.fBulkUseToken)
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 8a620b6a38..a5cda4edcf 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -19,6 +19,7 @@
#include "GrTextureProxy.h"
#include "GrTextureProxyPriv.h"
#include "SkMakeUnique.h"
+#include "SkRectPriv.h"
#include "mock/GrMockTypes.h"
// This test verifies that lazy proxy callbacks get invoked during flush, after onFlush callbacks,
@@ -71,7 +72,7 @@ public:
return texture;
}
}, GrSurfaceProxy::Renderable::kNo, kRGB_565_GrPixelConfig);
- this->setBounds(SkRect::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo);
+ this->setBounds(SkRectPriv::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo);
}
void visitProxies(const VisitProxyFunc& func) const override {
diff --git a/tests/PictureBBHTest.cpp b/tests/PictureBBHTest.cpp
index 0bc81c2934..6a4cd830c8 100644
--- a/tests/PictureBBHTest.cpp
+++ b/tests/PictureBBHTest.cpp
@@ -11,6 +11,7 @@
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
+#include "SkRectPriv.h"
#include "Test.h"
@@ -98,7 +99,7 @@ DEF_TEST(RTreeMakeLargest, r) {
// used to fall into an infinite loop.
SkRTreeFactory factory;
- std::unique_ptr<SkBBoxHierarchy> bbh{ factory(SkRect::MakeLargest()) };
+ std::unique_ptr<SkBBoxHierarchy> bbh{ factory(SkRectPriv::MakeLargest()) };
SkRect rects[] = { {0,0, 10,10}, {5,5,15,15} };
bbh->insert(rects, SK_ARRAY_COUNT(rects));
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 9ecb08224e..714338f9d1 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -17,11 +17,12 @@
#include "SkImageEncoder.h"
#include "SkImageGenerator.h"
#include "SkMD5.h"
+#include "SkMiniRecorder.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
#include "SkPixelRef.h"
-#include "SkMiniRecorder.h"
+#include "SkRectPriv.h"
#include "SkRRect.h"
#include "SkRandom.h"
#include "SkRecord.h"
@@ -784,32 +785,32 @@ DEF_TEST(Picture_UpdatedCull_1, r) {
SkRTreeFactory factory;
SkPictureRecorder recorder;
- auto canvas = recorder.beginRecording(SkRect::MakeLargest(), &factory);
+ auto canvas = recorder.beginRecording(SkRectPriv::MakeLargest(), &factory);
canvas->drawRect(SkRect::MakeWH(20,20), SkPaint{});
auto pic = recorder.finishRecordingAsPicture();
REPORTER_ASSERT(r, pic->cullRect() == SkRect::MakeWH(20,20));
- canvas = recorder.beginRecording(SkRect::MakeLargest());
+ canvas = recorder.beginRecording(SkRectPriv::MakeLargest());
canvas->drawRect(SkRect::MakeWH(20,20), SkPaint{});
pic = recorder.finishRecordingAsPicture();
- REPORTER_ASSERT(r, pic->cullRect() == SkRect::MakeLargest());
+ REPORTER_ASSERT(r, pic->cullRect() == SkRectPriv::MakeLargest());
}
DEF_TEST(Picture_UpdatedCull_2, r) {
// Testing >1 draw exercises SkBigPicture.
SkRTreeFactory factory;
SkPictureRecorder recorder;
- auto canvas = recorder.beginRecording(SkRect::MakeLargest(), &factory);
+ auto canvas = recorder.beginRecording(SkRectPriv::MakeLargest(), &factory);
canvas->drawRect(SkRect::MakeWH(20,20), SkPaint{});
canvas->drawRect(SkRect::MakeWH(10,40), SkPaint{});
auto pic = recorder.finishRecordingAsPicture();
REPORTER_ASSERT(r, pic->cullRect() == SkRect::MakeWH(20,40));
- canvas = recorder.beginRecording(SkRect::MakeLargest());
+ canvas = recorder.beginRecording(SkRectPriv::MakeLargest());
canvas->drawRect(SkRect::MakeWH(20,20), SkPaint{});
canvas->drawRect(SkRect::MakeWH(10,40), SkPaint{});
pic = recorder.finishRecordingAsPicture();
- REPORTER_ASSERT(r, pic->cullRect() == SkRect::MakeLargest());
+ REPORTER_ASSERT(r, pic->cullRect() == SkRectPriv::MakeLargest());
}
DEF_TEST(Picture_RecordsFlush, r) {
diff --git a/tests/SGTest.cpp b/tests/SGTest.cpp
index d51f70be59..b0101bc034 100644
--- a/tests/SGTest.cpp
+++ b/tests/SGTest.cpp
@@ -6,6 +6,7 @@
*/
#include "SkRect.h"
+#include "SkRectPriv.h"
#if !defined(SK_BUILD_FOR_GOOGLE3)
@@ -67,7 +68,7 @@ static void inval_test1(skiatest::Reporter* reporter) {
// Initial revalidation.
check_inval(reporter, root,
SkRect::MakeWH(100, 100),
- SkRect::MakeLargestS32(),
+ SkRectPriv::MakeLargestS32(),
nullptr);
}
@@ -137,7 +138,7 @@ static void inval_test2(skiatest::Reporter* reporter) {
// Initial revalidation.
check_inval(reporter, root,
SkRect::MakeWH(100, 100),
- SkRect::MakeLargestS32(),
+ SkRectPriv::MakeLargestS32(),
nullptr);
}
diff --git a/tests/WindowRectanglesTest.cpp b/tests/WindowRectanglesTest.cpp
index e9545651af..84fdca2237 100644
--- a/tests/WindowRectanglesTest.cpp
+++ b/tests/WindowRectanglesTest.cpp
@@ -11,6 +11,7 @@
#if SK_SUPPORT_GPU
#include "GrWindowRectangles.h"
+#include "SkRectPriv.h"
static SkIRect next_irect(SkRandom& r) {
return {r.nextS(), r.nextS(), r.nextS(), r.nextS()};
@@ -47,7 +48,7 @@ DEF_TEST(WindowRectangles, reporter) {
REPORTER_ASSERT(reporter, B.data() != A.data());
REPORTER_ASSERT(reporter, B != A);
- B.addWindow(SkIRect::MakeLargest());
+ B.addWindow(SkRectPriv::MakeILargest());
REPORTER_ASSERT(reporter, B != A);
REPORTER_ASSERT(reporter, !memcmp(A.data(), windowData,
@@ -55,7 +56,7 @@ DEF_TEST(WindowRectangles, reporter) {
REPORTER_ASSERT(reporter, !memcmp(B.data(), windowData,
(GrWindowRectangles::kMaxWindows - 1) * sizeof(SkIRect)));
REPORTER_ASSERT(reporter,
- B.data()[GrWindowRectangles::kMaxWindows - 1] == SkIRect::MakeLargest());
+ B.data()[GrWindowRectangles::kMaxWindows - 1] == SkRectPriv::MakeILargest());
}
{
GrWindowRectangles A(wr), B(wr);
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index 1fe4bc3db8..0b46439d33 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -10,6 +10,7 @@
#include "SkDebugCanvas.h"
#include "SkDrawCommand.h"
#include "SkPaintFilterCanvas.h"
+#include "SkRectPriv.h"
#include "SkTextBlob.h"
#include "SkClipOpPriv.h"
@@ -87,7 +88,7 @@ SkDebugCanvas::SkDebugCanvas(int width, int height)
// rounded out. The following code creates a nearly maximal rect that will
// not get collapsed by the coming conversions (Due to precision loss the
// inset has to be surprisingly large).
- SkIRect largeIRect = SkIRect::MakeLargest();
+ SkIRect largeIRect = SkRectPriv::MakeILargest();
largeIRect.inset(1024, 1024);
SkRect large = SkRect::Make(largeIRect);
#ifdef SK_DEBUG