[includes] Remove include link between SkPathRef.h and SkRRect.h

According to go/chrome-includes [1], this will save about
40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL

I'm not quite sure why the link is so expensive, but we can
forward declare it and move the implementation from the .h
to the .cpp file easily enough.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000

Canary-Chromium-CL: 3485346
Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Kevin Lubick 2022-02-23 12:17:12 -05:00
parent 96df1183ac
commit 37b8239bec
14 changed files with 30 additions and 16 deletions

View File

@ -6,6 +6,7 @@
*/
#include "bench/Benchmark.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkGeometry.h"

View File

@ -8,6 +8,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/utils/SkShadowUtils.h"
#include "src/core/SkDrawShadowInfo.h"

View File

@ -14,6 +14,7 @@
#include "include/core/SkFontTypes.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"

View File

@ -11,6 +11,7 @@
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"

View File

@ -10,6 +10,7 @@
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"

View File

@ -10,7 +10,6 @@
#include "include/core/SkMatrix.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/private/SkIDChangeListener.h"
@ -25,6 +24,7 @@
class SkRBuffer;
class SkWBuffer;
class SkRRect;
enum class SkPathConvexity {
kConvex,
@ -246,21 +246,7 @@ public:
return SkToBool(fIsOval);
}
bool isRRect(SkRRect* rrect, bool* isCCW, unsigned* start) const {
if (fIsRRect) {
if (rrect) {
*rrect = this->getRRect();
}
if (isCCW) {
*isCCW = SkToBool(fRRectOrOvalIsCCW);
}
if (start) {
*start = fRRectOrOvalStartIdx;
}
}
return SkToBool(fIsRRect);
}
bool isRRect(SkRRect* rrect, bool* isCCW, unsigned* start) const;
bool hasComputedBounds() const {
return !fBoundsIsDirty;

View File

@ -8,6 +8,7 @@
#include <tuple>
#include "include/core/SkCanvas.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"
#include "modules/svg/include/SkSVGRect.h"
#include "modules/svg/include/SkSVGRenderContext.h"

View File

@ -10,6 +10,7 @@
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRRect.h"
#include "include/utils/SkRandom.h"
#include "samplecode/Sample.h"
#include "src/core/SkPathPriv.h"

View File

@ -9,6 +9,7 @@
#include "include/core/SkImage.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRRect.h"
#include "include/utils/SkShadowUtils.h"
#include "samplecode/Sample.h"
#include "tools/Resources.h"

View File

@ -8,6 +8,7 @@
#include "include/private/SkPathRef.h"
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/private/SkNx.h"
#include "include/private/SkOnce.h"
#include "include/private/SkTo.h"
@ -541,6 +542,21 @@ SkRRect SkPathRef::getRRect() const {
return rrect;
}
bool SkPathRef::isRRect(SkRRect* rrect, bool* isCCW, unsigned* start) const {
if (fIsRRect) {
if (rrect) {
*rrect = this->getRRect();
}
if (isCCW) {
*isCCW = SkToBool(fRRectOrOvalIsCCW);
}
if (start) {
*start = fRRectOrOvalStartIdx;
}
}
return SkToBool(fIsRRect);
}
///////////////////////////////////////////////////////////////////////////////
SkPathRef::Iter::Iter() {

View File

@ -16,6 +16,7 @@
#include "include/core/SkImage.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkRRect.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTextBlob.h"

View File

@ -7,6 +7,7 @@
#include "include/core/SkPathBuilder.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkRRect.h"
#include "src/core/SkPathPriv.h"
#include "tests/Test.h"

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRegion.h"
#include "include/utils/SkRandom.h"
#include "src/core/SkAutoMalloc.h"

View File

@ -7,6 +7,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/core/SkVertices.h"
#include "include/utils/SkShadowUtils.h"
#include "src/core/SkDrawShadowInfo.h"