[includes] Prepare for moving SkColorSpace to forward declare

This updates all our callsites in preparation for removing
the #include "include/core/SkColorSpace.h" from SkImageInfo.h

According to go/chrome-includes [1], this will save ~150MB
(0.07%) from the compilation size. I think SkColorSpace is
a big include because it loads the skcms header, which is
big.

The follow-on CL will remove that link, once clients have
been updated as well.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/chrome_includes_2022-03-31_124042.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImageInfo%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImageInfo%5C.h%24&included=&limit=1000

Change-Id: I1b5ff491ac495317b0e5af3a2082b080d43697ae
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525639
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2022-03-31 15:07:44 -04:00 committed by SkCQ
parent 6b52f372c3
commit 5e8f45faf1
97 changed files with 374 additions and 105 deletions

View File

@ -8,8 +8,8 @@
#include <memory>
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrDirectContext.h"

View File

@ -7,6 +7,7 @@
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"
#include "include/core/SkSurface.h"

View File

@ -8,8 +8,8 @@
#include <memory>
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/utils/SkRandom.h"

View File

@ -7,6 +7,7 @@
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "src/core/SkMipmap.h"
class MipmapBench: public Benchmark {

View File

@ -6,6 +6,7 @@
*/
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPaint.h"
#include "include/core/SkString.h"
#include "include/core/SkVertices.h"

View File

@ -9,6 +9,7 @@
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkTypeface.h"
#include "include/private/chromium/SkChromeRemoteGlyphCache.h"

View File

@ -8,6 +8,7 @@
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkString.h"
// Time variants of write-pixels

View File

@ -11,6 +11,7 @@
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
class SkColorSpace;
class SkSurface;
class SkSurfaceProps;

View File

@ -289,6 +289,7 @@ generated_cc_atom(
"//experimental/graphite/include:Recorder_hdr",
"//experimental/graphite/src/geom:BoundsManager_hdr",
"//experimental/graphite/src/geom:Shape_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkPixmap_hdr",
"//include/private:SkColorData_hdr",
],
@ -503,6 +504,8 @@ generated_cc_atom(
":RecorderPriv_hdr",
":TextureUtils_hdr",
"//experimental/graphite/include:Recorder_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageInfo_hdr",
],
)
@ -649,6 +652,7 @@ generated_cc_atom(
"//experimental/graphite/include:Context_hdr",
"//experimental/graphite/include:Recorder_hdr",
"//experimental/graphite/include:SkStuff_hdr",
"//include/core:SkColorSpace_hdr",
],
)

View File

@ -7,6 +7,7 @@
#include "experimental/graphite/src/DrawContext.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPixmap.h"
#include "include/private/SkColorData.h"

View File

@ -11,6 +11,8 @@
#include "experimental/graphite/src/Caps.h"
#include "experimental/graphite/src/RecorderPriv.h"
#include "experimental/graphite/src/TextureUtils.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
namespace skgpu {

View File

@ -19,6 +19,7 @@
#include "experimental/graphite/src/Surface_Graphite.h"
#include "experimental/graphite/src/Texture.h"
#include "experimental/graphite/src/TextureProxy.h"
#include "include/core/SkColorSpace.h"
sk_sp<SkSurface> MakeGraphite(skgpu::Recorder* recorder, const SkImageInfo& ii) {
sk_sp<skgpu::Device> device = skgpu::Device::Make(recorder, ii);

View File

@ -9,6 +9,8 @@
#include "tools/skottie_ios_app/SkMetalViewBridge.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPaint.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTime.h"

View File

@ -8,11 +8,11 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"
#include "include/effects/SkGradientShader.h"
//------------------------------------------------------------------------------------------------
SortKey SaveCmd::getKey() {
SkASSERT(0);

View File

@ -2268,6 +2268,7 @@ generated_cc_atom(
deps = [
":gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkSurface_hdr",
"//tools:Resources_hdr",
@ -3646,6 +3647,7 @@ generated_cc_atom(
"//include/core:SkBlendMode_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkImage_hdr",
@ -3977,6 +3979,7 @@ generated_cc_atom(
deps = [
":gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkEncodedImageFormat_hdr",
"//include/core:SkImageInfo_hdr",
@ -4842,6 +4845,7 @@ generated_cc_atom(
":gm_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPaint_hdr",
"//include/effects:SkGradientShader_hdr",
@ -6084,6 +6088,7 @@ generated_cc_atom(
"//include/core:SkBlendMode_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkFontTypes_hdr",
"//include/core:SkFont_hdr",
@ -7552,6 +7557,7 @@ generated_cc_atom(
":gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPaint_hdr",
@ -8172,6 +8178,7 @@ generated_cc_atom(
":gm_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
],
)
@ -9578,6 +9585,7 @@ generated_cc_atom(
deps = [
":gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkSize_hdr",

View File

@ -7,6 +7,7 @@
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkFont.h"
#include "include/core/SkSurface.h"
#include "tools/Resources.h"

View File

@ -10,6 +10,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"

View File

@ -7,6 +7,7 @@
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkEncodedImageFormat.h"
#include "include/core/SkImage.h"

View File

@ -8,6 +8,7 @@
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"
#include "include/effects/SkGradientShader.h"

View File

@ -10,6 +10,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkFont.h"
#include "include/core/SkFontTypes.h"
#include "include/core/SkPaint.h"

View File

@ -8,6 +8,7 @@
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"

View File

@ -8,6 +8,7 @@
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
// This GM should draw two yellow boxes; the bug drew one in cyan.

View File

@ -20,6 +20,7 @@ generated_cc_atom(
"//gm:gm_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkSurface_hdr",
"//include/effects:SkImageFilters_hdr",
"//include/encode:SkPngEncoder_hdr",

View File

@ -9,6 +9,7 @@
#include "gm/verifiers/gmverifier.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkImageFilters.h"
#include "include/encode/SkPngEncoder.h"

View File

@ -11,6 +11,7 @@
#ifdef SK_VULKAN
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"
#include "include/core/SkSize.h"

View File

@ -395,6 +395,7 @@ generated_cc_atom(
":SkColorType_hdr",
":SkMath_hdr",
":SkRect_hdr",
":SkRefCnt_hdr",
":SkSize_hdr",
"//include/private:SkTFitsIn_hdr",
"//include/private:SkTo_hdr",

View File

@ -18,6 +18,7 @@
#include "include/core/SkTileMode.h"
class SkBitmap;
class SkColorSpace;
struct SkMask;
class SkMipmap;
struct SkIRect;
@ -158,7 +159,7 @@ public:
@return SkColorSpace in SkImageInfo, or nullptr
*/
SkColorSpace* colorSpace() const { return fPixmap.colorSpace(); }
SkColorSpace* colorSpace() const;
/** Returns smart pointer to SkColorSpace, the range of colors, associated with
SkImageInfo. The smart pointer tracks the number of objects sharing this
@ -168,7 +169,7 @@ public:
@return SkColorSpace in SkImageInfo wrapped in a smart pointer
*/
sk_sp<SkColorSpace> refColorSpace() const { return fPixmap.info().refColorSpace(); }
sk_sp<SkColorSpace> refColorSpace() const;
/** Returns number of bytes per pixel required by SkColorType.
Returns zero if colorType( is kUnknown_SkColorType.

View File

@ -9,10 +9,11 @@
#define SkImageInfo_DEFINED
#include "include/core/SkAlphaType.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorSpace.h" // TODO(kjlubick) Remove this after clients fixed
#include "include/core/SkColorType.h"
#include "include/core/SkMath.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/private/SkTFitsIn.h"
@ -20,7 +21,7 @@
class SkReadBuffer;
class SkWriteBuffer;
class SkColorSpace;
/** Returns the number of bytes required to store a pixel, including unused padding.
Returns zero if ct is kUnknown_SkColorType or invalid.
@ -99,7 +100,8 @@ public:
@return empty SkImageInfo
*/
SkColorInfo() = default;
SkColorInfo();
~SkColorInfo();
/** Creates SkColorInfo from SkColorType ct, SkAlphaType at, and optionally SkColorSpace cs.
@ -110,17 +112,16 @@ public:
combination is supported.
@return created SkColorInfo
*/
SkColorInfo(SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs)
: fColorSpace(std::move(cs)), fColorType(ct), fAlphaType(at) {}
SkColorInfo(SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs);
SkColorInfo(const SkColorInfo&) = default;
SkColorInfo(SkColorInfo&&) = default;
SkColorInfo(const SkColorInfo&);
SkColorInfo(SkColorInfo&&);
SkColorInfo& operator=(const SkColorInfo&) = default;
SkColorInfo& operator=(SkColorInfo&&) = default;
SkColorInfo& operator=(const SkColorInfo&);
SkColorInfo& operator=(SkColorInfo&&);
SkColorSpace* colorSpace() const { return fColorSpace.get(); }
sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; }
SkColorSpace* colorSpace() const;
sk_sp<SkColorSpace> refColorSpace() const;
SkColorType colorType() const { return fColorType; }
SkAlphaType alphaType() const { return fAlphaType; }
@ -129,16 +130,13 @@ public:
|| SkColorTypeIsAlwaysOpaque(fColorType);
}
bool gammaCloseToSRGB() const { return fColorSpace && fColorSpace->gammaCloseToSRGB(); }
bool gammaCloseToSRGB() const;
/** Does other represent the same color type, alpha type, and color space? */
bool operator==(const SkColorInfo& other) const {
return fColorType == other.fColorType && fAlphaType == other.fAlphaType &&
SkColorSpace::Equals(fColorSpace.get(), other.fColorSpace.get());
}
bool operator==(const SkColorInfo& other) const;
/** Does other represent a different color type, alpha type, or color space? */
bool operator!=(const SkColorInfo& other) const { return !(*this == other); }
bool operator!=(const SkColorInfo& other) const;
/** Creates SkColorInfo with same SkColorType, SkColorSpace, with SkAlphaType set
to newAlphaType.
@ -146,23 +144,17 @@ public:
Created SkColorInfo contains newAlphaType even if it is incompatible with
SkColorType, in which case SkAlphaType in SkColorInfo is ignored.
*/
SkColorInfo makeAlphaType(SkAlphaType newAlphaType) const {
return SkColorInfo(this->colorType(), newAlphaType, this->refColorSpace());
}
SkColorInfo makeAlphaType(SkAlphaType newAlphaType) const;
/** Creates new SkColorInfo with same SkAlphaType, SkColorSpace, with SkColorType
set to newColorType.
*/
SkColorInfo makeColorType(SkColorType newColorType) const {
return SkColorInfo(newColorType, this->alphaType(), this->refColorSpace());
}
SkColorInfo makeColorType(SkColorType newColorType) const;
/** Creates SkColorInfo with same SkAlphaType, SkColorType, with SkColorSpace
set to cs. cs may be nullptr.
*/
SkColorInfo makeColorSpace(sk_sp<SkColorSpace> cs) const {
return SkColorInfo(this->colorType(), this->alphaType(), std::move(cs));
}
SkColorInfo makeColorSpace(sk_sp<SkColorSpace> cs) const;
/** Returns number of bytes per pixel required by SkColorType.
Returns zero if colorType() is kUnknown_SkColorType.
@ -222,14 +214,12 @@ public:
@param cs range of colors; may be nullptr
@return created SkImageInfo
*/
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at);
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
sk_sp<SkColorSpace> cs = nullptr) {
return SkImageInfo({width, height}, {ct, at, std::move(cs)});
}
sk_sp<SkColorSpace> cs);
static SkImageInfo Make(SkISize dimensions, SkColorType ct, SkAlphaType at);
static SkImageInfo Make(SkISize dimensions, SkColorType ct, SkAlphaType at,
sk_sp<SkColorSpace> cs = nullptr) {
return SkImageInfo(dimensions, {ct, at, std::move(cs)});
}
sk_sp<SkColorSpace> cs);
/** Creates SkImageInfo from integral dimensions and SkColorInfo colorInfo,
@ -263,10 +253,8 @@ public:
@param cs range of colors; may be nullptr
@return created SkImageInfo
*/
static SkImageInfo MakeN32(int width, int height, SkAlphaType at,
sk_sp<SkColorSpace> cs = nullptr) {
return Make({width, height}, kN32_SkColorType, at, std::move(cs));
}
static SkImageInfo MakeN32(int width, int height, SkAlphaType at);
static SkImageInfo MakeN32(int width, int height, SkAlphaType at, sk_sp<SkColorSpace> cs);
/** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
SkAlphaType at, with sRGB SkColorSpace.
@ -296,9 +284,8 @@ public:
@param cs range of colors; may be nullptr
@return created SkImageInfo
*/
static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr) {
return Make({width, height}, kN32_SkColorType, kPremul_SkAlphaType, std::move(cs));
}
static SkImageInfo MakeN32Premul(int width, int height);
static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs);
/** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
kPremul_SkAlphaType, with SkColorSpace set to nullptr.
@ -313,9 +300,8 @@ public:
@param cs range of colors; may be nullptr
@return created SkImageInfo
*/
static SkImageInfo MakeN32Premul(SkISize dimensions, sk_sp<SkColorSpace> cs = nullptr) {
return Make(dimensions, kN32_SkColorType, kPremul_SkAlphaType, std::move(cs));
}
static SkImageInfo MakeN32Premul(SkISize dimensions);
static SkImageInfo MakeN32Premul(SkISize dimensions, sk_sp<SkColorSpace> cs);
/** Creates SkImageInfo from integral dimensions width and height, kAlpha_8_SkColorType,
kPremul_SkAlphaType, with SkColorSpace set to nullptr.
@ -324,18 +310,14 @@ public:
@param height pixel row count; must be zero or greater
@return created SkImageInfo
*/
static SkImageInfo MakeA8(int width, int height) {
return Make({width, height}, kAlpha_8_SkColorType, kPremul_SkAlphaType, nullptr);
}
static SkImageInfo MakeA8(int width, int height);
/** Creates SkImageInfo from integral dimensions, kAlpha_8_SkColorType,
kPremul_SkAlphaType, with SkColorSpace set to nullptr.
@param dimensions pixel row and column count; must be zero or greater
@return created SkImageInfo
*/
static SkImageInfo MakeA8(SkISize dimensions) {
return Make(dimensions, kAlpha_8_SkColorType, kPremul_SkAlphaType, nullptr);
}
static SkImageInfo MakeA8(SkISize dimensions);
/** Creates SkImageInfo from integral dimensions width and height, kUnknown_SkColorType,
kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
@ -347,9 +329,7 @@ public:
@param height pixel row count; must be zero or greater
@return created SkImageInfo
*/
static SkImageInfo MakeUnknown(int width, int height) {
return Make({width, height}, kUnknown_SkColorType, kUnknown_SkAlphaType, nullptr);
}
static SkImageInfo MakeUnknown(int width, int height);
/** Creates SkImageInfo from integral dimensions width and height set to zero,
kUnknown_SkColorType, kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
@ -384,7 +364,7 @@ public:
@return SkColorSpace, or nullptr
*/
SkColorSpace* colorSpace() const { return fColorInfo.colorSpace(); }
SkColorSpace* colorSpace() const;
/** Returns smart pointer to SkColorSpace, the range of colors. The smart pointer
tracks the number of objects sharing this SkColorSpace reference so the memory
@ -394,7 +374,7 @@ public:
@return SkColorSpace wrapped in a smart pointer
*/
sk_sp<SkColorSpace> refColorSpace() const { return fColorInfo.refColorSpace(); }
sk_sp<SkColorSpace> refColorSpace() const;
/** Returns if SkImageInfo describes an empty area of pixels by checking if either
width or height is zero or smaller.
@ -487,9 +467,7 @@ public:
@param cs range of colors; may be nullptr
@return created SkImageInfo
*/
SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const {
return Make(fDimensions, fColorInfo.makeColorSpace(std::move(cs)));
}
SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const;
/** Returns number of bytes per pixel required by SkColorType.
Returns zero if colorType( is kUnknown_SkColorType.

View File

@ -12,6 +12,7 @@
#include "include/core/SkImageInfo.h"
#include "include/core/SkSamplingOptions.h"
class SkColorSpace;
class SkData;
struct SkMask;
@ -170,7 +171,7 @@ public:
@return SkColorSpace in SkImageInfo, or nullptr
*/
SkColorSpace* colorSpace() const { return fInfo.colorSpace(); }
SkColorSpace* colorSpace() const;
/** Returns smart pointer to SkColorSpace, the range of colors, associated with
SkImageInfo. The smart pointer tracks the number of objects sharing this
@ -180,7 +181,7 @@ public:
@return SkColorSpace in SkImageInfo wrapped in a smart pointer
*/
sk_sp<SkColorSpace> refColorSpace() const { return fInfo.refColorSpace(); }
sk_sp<SkColorSpace> refColorSpace() const;
/** Returns true if SkAlphaType is kOpaque_SkAlphaType.
Does not check if SkColorType allows alpha, or if any pixel value has

View File

@ -82,7 +82,11 @@ generated_cc_atom(
name = "SkGradientShader_hdr",
hdrs = ["SkGradientShader.h"],
visibility = ["//:__subpackages__"],
deps = ["//include/core:SkShader_hdr"],
deps = [
"//include/core:SkRefCnt_hdr",
"//include/core:SkShader_hdr",
"//include/core:SkTileMode_hdr",
],
)
generated_cc_atom(

View File

@ -8,7 +8,11 @@
#ifndef SkGradientShader_DEFINED
#define SkGradientShader_DEFINED
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkTileMode.h"
class SkColorSpace;
/** \class SkGradientShader
@ -100,9 +104,7 @@ public:
uint32_t flags, const SkMatrix* localMatrix);
static sk_sp<SkShader> MakeLinear(const SkPoint pts[2],
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count, SkTileMode mode) {
return MakeLinear(pts, colors, std::move(colorSpace), pos, count, mode, 0, nullptr);
}
const SkScalar pos[], int count, SkTileMode mode);
/** Returns a shader that generates a radial gradient given the center and radius.
<p />
@ -146,10 +148,7 @@ public:
uint32_t flags, const SkMatrix* localMatrix);
static sk_sp<SkShader> MakeRadial(const SkPoint& center, SkScalar radius,
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count, SkTileMode mode) {
return MakeRadial(center, radius, colors, std::move(colorSpace), pos, count, mode,
0, nullptr);
}
const SkScalar pos[], int count, SkTileMode mode);
/**
* Returns a shader that generates a conical gradient given two circles, or
@ -186,10 +185,7 @@ public:
const SkPoint& end, SkScalar endRadius,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace, const SkScalar pos[],
int count, SkTileMode mode) {
return MakeTwoPointConical(start, startRadius, end, endRadius, colors,
std::move(colorSpace), pos, count, mode, 0, nullptr);
}
int count, SkTileMode mode);
/** Returns a shader that generates a sweep gradient given a center.
<p />
@ -248,15 +244,10 @@ public:
static sk_sp<SkShader> MakeSweep(SkScalar cx, SkScalar cy,
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count,
uint32_t flags, const SkMatrix* localMatrix) {
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count,
SkTileMode::kClamp, 0, 360, flags, localMatrix);
}
uint32_t flags, const SkMatrix* localMatrix);
static sk_sp<SkShader> MakeSweep(SkScalar cx, SkScalar cy,
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count) {
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count, 0, nullptr);
}
const SkScalar pos[], int count);
static void RegisterFlattenables();
};

View File

@ -134,6 +134,7 @@ generated_cc_atom(
hdrs = ["SkEncodedInfo.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkImageInfo_hdr",
"//include/third_party/skcms:skcms_hdr",

View File

@ -10,6 +10,7 @@
#include <memory>
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/third_party/skcms/skcms.h"

View File

@ -7,6 +7,7 @@
#include <jni.h>
#include "include/core/SkColorSpace.h"
#include "include/core/SkM44.h"
#include "include/effects/SkGradientShader.h"
#include "modules/androidkit/src/Utils.h"

View File

@ -5,6 +5,7 @@ generated_cc_atom(
srcs = ["SkParticleBinding.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkContourMeasure_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPath_hdr",

View File

@ -7,6 +7,7 @@
#include "modules/particles/include/SkParticleBinding.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkContourMeasure.h"
#include "include/core/SkImage.h"
#include "include/core/SkPath.h"

View File

@ -80,6 +80,7 @@ generated_cc_atom(
srcs = ["SkSGGradient.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkPaint_hdr",
"//include/effects:SkGradientShader_hdr",
"//include/private:SkTPin_hdr",

View File

@ -7,6 +7,7 @@
#include "modules/sksg/include/SkSGGradient.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPaint.h"
#include "include/effects/SkGradientShader.h"
#include "include/private/SkTPin.h"

View File

@ -373,6 +373,7 @@ generated_cc_atom(
srcs = ["SkSVGLinearGradient.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/effects:SkGradientShader_hdr",
"//modules/svg/include:SkSVGLinearGradient_hdr",
"//modules/svg/include:SkSVGRenderContext_hdr",
@ -453,6 +454,7 @@ generated_cc_atom(
srcs = ["SkSVGRadialGradient.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/effects:SkGradientShader_hdr",
"//modules/svg/include:SkSVGRadialGradient_hdr",
"//modules/svg/include:SkSVGRenderContext_hdr",

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "include/core/SkColorSpace.h"
#include "include/effects/SkGradientShader.h"
#include "modules/svg/include/SkSVGLinearGradient.h"
#include "modules/svg/include/SkSVGRenderContext.h"

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "include/core/SkColorSpace.h"
#include "include/effects/SkGradientShader.h"
#include "modules/svg/include/SkSVGRadialGradient.h"
#include "modules/svg/include/SkSVGRenderContext.h"

View File

@ -9,6 +9,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkStream.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTime.h"

View File

@ -618,6 +618,7 @@ generated_cc_atom(
":SkWriteBuffer_hdr",
":SkWritePixelsRec_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkMallocPixelRef_hdr",
"//include/core:SkMaskFilter_hdr",
@ -1164,6 +1165,7 @@ generated_cc_atom(
"//include/effects:SkRuntimeEffect_hdr",
"//include/private:SkNx_hdr",
"//include/private:SkTDArray_hdr",
"//include/third_party/skcms:skcms_hdr",
"//src/gpu:GrColorInfo_hdr",
"//src/gpu:GrColorSpaceXform_hdr",
"//src/gpu:GrFragmentProcessor_hdr",
@ -1534,6 +1536,7 @@ generated_cc_atom(
":SkTextBlobPriv_hdr",
":SkUtils_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkDrawable_hdr",
"//include/core:SkImageFilter_hdr",
"//include/core:SkPathMeasure_hdr",
@ -1756,6 +1759,7 @@ generated_cc_atom(
":SkVM_hdr",
":SkVertState_hdr",
":SkVerticesPriv_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkString_hdr",
"//include/private:SkNx_hdr",
"//src/shaders:SkColorShader_hdr",
@ -2138,6 +2142,7 @@ generated_cc_atom(
":SkTraceEvent_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkMaskFilter_hdr",
"//include/core:SkPathEffect_hdr",
"//include/gpu:GrRecordingContext_hdr",
@ -2369,6 +2374,7 @@ generated_cc_atom(
deps = [
":SkSpecialImage_hdr",
":SkSpecialSurface_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkMatrix_hdr",
],
)
@ -2452,6 +2458,8 @@ generated_cc_atom(
":SkSafeMath_hdr",
":SkWriteBuffer_hdr",
":SkWritePixelsRec_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageInfo_hdr",
"//include/private:SkImageInfoPriv_hdr",
"//src/image:SkReadPixelsRec_hdr",
],
@ -3409,6 +3417,7 @@ generated_cc_atom(
deps = [
":SkTLazy_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageGenerator_hdr",
"//include/core:SkMatrix_hdr",
"//include/core:SkPaint_hdr",
@ -3587,6 +3596,7 @@ generated_cc_atom(
":SkRasterClip_hdr",
":SkUtils_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkPixmap_hdr",
"//include/core:SkSurface_hdr",
@ -3802,6 +3812,7 @@ generated_cc_atom(
"//include/private:SkImageInfoPriv_hdr",
"//include/private:SkNx_hdr",
"//include/private:SkTemplates_hdr",
"//include/third_party/skcms:skcms_hdr",
],
)
@ -4515,6 +4526,7 @@ generated_cc_atom(
":SkSurfacePriv_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkMatrix_hdr",
"//include/core:SkTileMode_hdr",

View File

@ -7,6 +7,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkMallocPixelRef.h"
#include "include/core/SkMath.h"
@ -102,6 +103,10 @@ void SkBitmap::getBounds(SkIRect* bounds) const {
*bounds = fPixmap.bounds();
}
SkColorSpace* SkBitmap::colorSpace() const { return fPixmap.colorSpace(); }
sk_sp<SkColorSpace> SkBitmap::refColorSpace() const { return fPixmap.info().refColorSpace(); }
///////////////////////////////////////////////////////////////////////////////
bool SkBitmap::setInfo(const SkImageInfo& info, size_t rowBytes) {

View File

@ -11,6 +11,7 @@
#include "include/effects/SkRuntimeEffect.h"
#include "include/private/SkNx.h"
#include "include/private/SkTDArray.h"
#include "include/third_party/skcms/skcms.h"
#include "src/core/SkArenaAlloc.h"
#include "src/core/SkColorFilterBase.h"
#include "src/core/SkColorFilterPriv.h"

View File

@ -10,6 +10,9 @@
#include "include/core/SkColorFilter.h"
struct skcms_Matrix3x3;
struct skcms_TransferFunction;
class SkColorFilterPriv {
public:
static sk_sp<SkColorFilter> MakeGaussian();

View File

@ -8,6 +8,7 @@
#include "src/core/SkDevice.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkPathMeasure.h"
@ -499,6 +500,20 @@ sk_sp<SkSurface> SkBaseDevice::makeSurface(SkImageInfo const&, SkSurfaceProps co
//////////////////////////////////////////////////////////////////////////////////////////
SkNoPixelsDevice::SkNoPixelsDevice(const SkIRect& bounds, const SkSurfaceProps& props)
: SkNoPixelsDevice(bounds, props, nullptr) {}
SkNoPixelsDevice::SkNoPixelsDevice(const SkIRect& bounds, const SkSurfaceProps& props,
sk_sp<SkColorSpace> colorSpace)
: SkBaseDevice(SkImageInfo::Make(bounds.size(), kUnknown_SkColorType, kUnknown_SkAlphaType,
std::move(colorSpace)), props) {
// this fails if we enable this assert: DiscardableImageMapTest.GetDiscardableImagesInRectMaxImage
//SkASSERT(bounds.width() >= 0 && bounds.height() >= 0);
this->setOrigin(SkM44(), bounds.left(), bounds.top());
this->resetClipStack();
}
void SkNoPixelsDevice::onSave() {
SkASSERT(!fClipStack.empty());
fClipStack.back().fDeferredSaveCount++;

View File

@ -23,6 +23,7 @@
#include "src/shaders/SkShaderBase.h"
class SkBitmap;
class SkColorSpace;
struct SkDrawShadowRec;
class SkGlyphRun;
class SkGlyphRunList;
@ -479,17 +480,9 @@ private:
class SkNoPixelsDevice : public SkBaseDevice {
public:
SkNoPixelsDevice(const SkIRect& bounds, const SkSurfaceProps& props);
SkNoPixelsDevice(const SkIRect& bounds, const SkSurfaceProps& props,
sk_sp<SkColorSpace> colorSpace = nullptr)
: SkBaseDevice(SkImageInfo::Make(bounds.size(), kUnknown_SkColorType,
kUnknown_SkAlphaType, std::move(colorSpace)),
props) {
// this fails if we enable this assert: DiscardableImageMapTest.GetDiscardableImagesInRectMaxImage
//SkASSERT(bounds.width() >= 0 && bounds.height() >= 0);
this->setOrigin(SkM44(), bounds.left(), bounds.top());
this->resetClipStack();
}
sk_sp<SkColorSpace> colorSpace);
void resetForNextPicture(const SkIRect& bounds) {
//SkASSERT(bounds.width() >= 0 && bounds.height() >= 0);

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "include/core/SkColorSpace.h"
#include "include/core/SkString.h"
#include "include/private/SkNx.h"
#include "src/core/SkArenaAlloc.h"

View File

@ -21,6 +21,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPathEffect.h"
#include "include/private/SkTDArray.h"

View File

@ -8,6 +8,7 @@
#ifndef SkImageFilterTypes_DEFINED
#define SkImageFilterTypes_DEFINED
#include "include/core/SkColorSpace.h"
#include "include/core/SkMatrix.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkSpecialSurface.h"

View File

@ -5,6 +5,9 @@
* found in the LICENSE file.
*/
#include "include/core/SkImageInfo.h"
#include "include/core/SkColorSpace.h"
#include "include/private/SkImageInfoPriv.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSafeMath.h"
@ -45,8 +48,46 @@ bool SkColorTypeIsAlwaysOpaque(SkColorType ct) {
///////////////////////////////////////////////////////////////////////////////////////////////////
SkColorInfo::SkColorInfo() = default;
SkColorInfo::~SkColorInfo() = default;
SkColorInfo::SkColorInfo(SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs)
: fColorSpace(std::move(cs)), fColorType(ct), fAlphaType(at) {}
SkColorInfo::SkColorInfo(const SkColorInfo&) = default;
SkColorInfo::SkColorInfo(SkColorInfo&&) = default;
SkColorInfo& SkColorInfo::operator=(const SkColorInfo&) = default;
SkColorInfo& SkColorInfo::operator=(SkColorInfo&&) = default;
SkColorSpace* SkColorInfo::colorSpace() const { return fColorSpace.get(); }
sk_sp<SkColorSpace> SkColorInfo::refColorSpace() const { return fColorSpace; }
bool SkColorInfo::operator==(const SkColorInfo& other) const {
return fColorType == other.fColorType && fAlphaType == other.fAlphaType &&
SkColorSpace::Equals(fColorSpace.get(), other.fColorSpace.get());
}
bool SkColorInfo::operator!=(const SkColorInfo& other) const { return !(*this == other); }
SkColorInfo SkColorInfo::makeAlphaType(SkAlphaType newAlphaType) const {
return SkColorInfo(this->colorType(), newAlphaType, this->refColorSpace());
}
SkColorInfo SkColorInfo::makeColorType(SkColorType newColorType) const {
return SkColorInfo(newColorType, this->alphaType(), this->refColorSpace());
}
SkColorInfo SkColorInfo::makeColorSpace(sk_sp<SkColorSpace> cs) const {
return SkColorInfo(this->colorType(), this->alphaType(), std::move(cs));
}
int SkColorInfo::bytesPerPixel() const { return SkColorTypeBytesPerPixel(fColorType); }
bool SkColorInfo::gammaCloseToSRGB() const {
return fColorSpace && fColorSpace->gammaCloseToSRGB();
}
int SkColorInfo::shiftPerPixel() const { return SkColorTypeShiftPerPixel(fColorType); }
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -72,10 +113,72 @@ size_t SkImageInfo::computeByteSize(size_t rowBytes) const {
return (safe.ok() && (bytes <= kMaxSigned32BitSize)) ? bytes : SIZE_MAX;
}
SkColorSpace* SkImageInfo::colorSpace() const { return fColorInfo.colorSpace(); }
sk_sp<SkColorSpace> SkImageInfo::refColorSpace() const { return fColorInfo.refColorSpace(); }
SkImageInfo SkImageInfo::makeColorSpace(sk_sp<SkColorSpace> cs) const {
return Make(fDimensions, fColorInfo.makeColorSpace(std::move(cs)));
}
SkImageInfo SkImageInfo::Make(int width, int height, SkColorType ct, SkAlphaType at) {
return Make(width, height, ct, at, nullptr);
}
SkImageInfo SkImageInfo::Make(int width, int height, SkColorType ct, SkAlphaType at,
sk_sp<SkColorSpace> cs) {
return SkImageInfo({width, height}, {ct, at, std::move(cs)});
}
SkImageInfo SkImageInfo::Make(SkISize dimensions, SkColorType ct, SkAlphaType at) {
return Make(dimensions, ct, at, nullptr);
}
SkImageInfo SkImageInfo::Make(SkISize dimensions, SkColorType ct, SkAlphaType at,
sk_sp<SkColorSpace> cs) {
return SkImageInfo(dimensions, {ct, at, std::move(cs)});
}
SkImageInfo SkImageInfo::MakeN32(int width, int height, SkAlphaType at) {
return MakeN32(width, height, at, nullptr);
}
SkImageInfo SkImageInfo::MakeN32(int width, int height, SkAlphaType at, sk_sp<SkColorSpace> cs) {
return Make({width, height}, kN32_SkColorType, at, std::move(cs));
}
SkImageInfo SkImageInfo::MakeS32(int width, int height, SkAlphaType at) {
return SkImageInfo({width, height}, {kN32_SkColorType, at, SkColorSpace::MakeSRGB()});
}
SkImageInfo SkImageInfo::MakeN32Premul(int width, int height) {
return MakeN32Premul(width, height, nullptr);
}
SkImageInfo SkImageInfo::MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs) {
return Make({width, height}, kN32_SkColorType, kPremul_SkAlphaType, std::move(cs));
}
SkImageInfo SkImageInfo::MakeN32Premul(SkISize dimensions) {
return MakeN32Premul(dimensions, nullptr);
}
SkImageInfo SkImageInfo::MakeN32Premul(SkISize dimensions, sk_sp<SkColorSpace> cs) {
return Make(dimensions, kN32_SkColorType, kPremul_SkAlphaType, std::move(cs));
}
SkImageInfo SkImageInfo::MakeA8(int width, int height) {
return Make({width, height}, kAlpha_8_SkColorType, kPremul_SkAlphaType, nullptr);
}
SkImageInfo SkImageInfo::MakeA8(SkISize dimensions) {
return Make(dimensions, kAlpha_8_SkColorType, kPremul_SkAlphaType, nullptr);
}
SkImageInfo SkImageInfo::MakeUnknown(int width, int height) {
return Make({width, height}, kUnknown_SkColorType, kUnknown_SkAlphaType, nullptr);
}
#ifdef SK_DEBUG
void SkImageInfo::validate() const {
SkASSERT(fDimensions.width() >= 0);

View File

@ -384,6 +384,11 @@ template <typename F> void downsample_3_3(void* dst, const void* src, size_t src
///////////////////////////////////////////////////////////////////////////////////////////////////
SkMipmap::SkMipmap(void* malloc, size_t size) : SkCachedData(malloc, size) {}
SkMipmap::SkMipmap(size_t size, SkDiscardableMemory* dm) : SkCachedData(size, dm) {}
SkMipmap::~SkMipmap() = default;
size_t SkMipmap::AllocLevelsSize(int levelCount, size_t pixelSize) {
if (levelCount < 0) {
return 0;

View File

@ -31,6 +31,7 @@ typedef SkDiscardableMemory* (*SkDiscardableFactoryProc)(size_t bytes);
*/
class SkMipmap : public SkCachedData {
public:
~SkMipmap() override;
// Allocate and fill-in a mipmap. If computeContents is false, we just allocated
// and compute the sizes/rowbytes, but leave the pixel-data uninitialized.
static SkMipmap* Build(const SkPixmap& src, SkDiscardableFactoryProc,
@ -86,12 +87,10 @@ private:
Level* fLevels; // managed by the baseclass, may be null due to onDataChanged.
int fCount;
SkMipmap(void* malloc, size_t size) : INHERITED(malloc, size) {}
SkMipmap(size_t size, SkDiscardableMemory* dm) : INHERITED(size, dm) {}
SkMipmap(void* malloc, size_t size);
SkMipmap(size_t size, SkDiscardableMemory* dm);
static size_t AllocLevelsSize(int levelCount, size_t pixelSize);
using INHERITED = SkCachedData;
};
#endif

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageGenerator.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"

View File

@ -8,6 +8,7 @@
#include "include/core/SkPixmap.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkSurface.h"
#include "include/core/SkUnPreMultiply.h"
@ -61,6 +62,10 @@ void SkPixmap::setColorSpace(sk_sp<SkColorSpace> cs) {
fInfo = fInfo.makeColorSpace(std::move(cs));
}
SkColorSpace* SkPixmap::colorSpace() const { return fInfo.colorSpace(); }
sk_sp<SkColorSpace> SkPixmap::refColorSpace() const { return fInfo.refColorSpace(); }
bool SkPixmap::extractSubset(SkPixmap* result, const SkIRect& subset) const {
SkIRect srcRect, r;
srcRect.setWH(this->width(), this->height());

View File

@ -8,9 +8,11 @@
#include "include/private/SkImageInfoPriv.h"
#include "include/private/SkNx.h"
#include "include/private/SkTemplates.h"
#include "include/third_party/skcms/skcms.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkOpts.h"
#include "src/core/SkRasterPipeline.h"
#include <algorithm>
bool gForceHighPrecisionRasterPipeline;

View File

@ -16,9 +16,11 @@
#include "include/core/SkTypes.h"
#include "include/private/SkTArray.h"
#include "src/core/SkArenaAlloc.h"
#include <functional>
class SkData;
struct skcms_TransferFunction;
/**
* SkRasterPipeline provides a cheap way to chain together a pixel processing pipeline.
@ -30,7 +32,7 @@ class SkData;
* at runtime, so we can scale this problem linearly rather than combinatorically.
*
* Each stage is represented by a function conforming to a common interface and by an
* arbitrary context pointer. The stage funciton arguments and calling convention are
* arbitrary context pointer. The stage function arguments and calling convention are
* designed to maximize the amount of data we can pass along the pipeline cheaply, and
* vary depending on CPU feature detection.
*/

View File

@ -9,6 +9,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkTileMode.h"

View File

@ -204,6 +204,7 @@ generated_cc_atom(
srcs = ["SkHighContrastFilter.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkString_hdr",
"//include/effects:SkHighContrastFilter_hdr",
"//include/effects:SkRuntimeEffect_hdr",

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "include/core/SkColorSpace.h"
#include "include/core/SkString.h"
#include "include/effects/SkHighContrastFilter.h"
#include "include/effects/SkRuntimeEffect.h"

View File

@ -1060,6 +1060,7 @@ generated_cc_atom(
visibility = ["//:__subpackages__"],
deps = [
":SmallPathShapeData_hdr",
"//include/private:SkFixed_hdr",
"//src/gpu/geometry:GrStyledShape_hdr",
],
)

View File

@ -7,6 +7,7 @@
#include "src/gpu/ops/SmallPathShapeData.h"
#include "include/private/SkFixed.h"
#include "src/gpu/geometry/GrStyledShape.h"
namespace skgpu::v1 {

View File

@ -206,6 +206,7 @@ generated_cc_atom(
deps = [
":SkImage_Lazy_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkImageGenerator_hdr",
"//include/gpu:GrDirectContext_hdr",
@ -247,6 +248,7 @@ generated_cc_atom(
"//experimental/graphite/src:UploadTask_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkPixelRef_hdr",
"//include/core:SkSurface_hdr",
@ -336,6 +338,7 @@ generated_cc_atom(
deps = [
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkRect_hdr",

View File

@ -8,6 +8,7 @@
#include "src/image/SkImage_Lazy.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImageGenerator.h"
#include "src/core/SkBitmapCache.h"

View File

@ -7,6 +7,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkPixelRef.h"
#include "include/core/SkSurface.h"

View File

@ -7,6 +7,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"

View File

@ -49,6 +49,7 @@ generated_cc_atom(
hdrs = ["SkImageEncoderFns.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkICC_hdr",
"//include/core:SkTypes_hdr",

View File

@ -9,6 +9,7 @@
#define SkImageEncoderFns_DEFINED
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkICC.h"
#include "include/core/SkTypes.h"
#include "include/private/SkColorData.h"

View File

@ -157,6 +157,7 @@ generated_cc_atom(
deps = [
"//include/core:SkData_hdr",
"//include/core:SkTypes_hdr",
"//include/third_party/skcms:skcms_hdr",
"//src/core:SkUtils_hdr",
],
)

View File

@ -10,6 +10,7 @@
#include "include/core/SkData.h"
#include "include/core/SkTypes.h"
#include "include/third_party/skcms/skcms.h"
#include "src/core/SkUtils.h" // unaligned_{load,store}
#include <cstdint>

View File

@ -86,6 +86,7 @@ generated_cc_atom(
":SkRadialGradient_hdr",
":SkSweepGradient_hdr",
":SkTwoPointConicalGradient_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkMallocPixelRef_hdr",
"//include/private:SkFloatBits_hdr",
"//include/private:SkHalf_hdr",

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include <algorithm>
#include "include/core/SkColorSpace.h"
#include "include/core/SkMallocPixelRef.h"
#include "include/private/SkFloatBits.h"
#include "include/private/SkHalf.h"
@ -24,6 +24,8 @@
#include "src/shaders/gradients/SkSweepGradient.h"
#include "src/shaders/gradients/SkTwoPointConicalGradient.h"
#include <algorithm>
enum GradientSerializationFlags {
// Bits 29:31 used for various boolean flags
kHasPosition_GSF = 0x80000000,
@ -41,6 +43,12 @@ enum GradientSerializationFlags {
kGradFlagsMask_GSF = 0xFF,
};
SkGradientShaderBase::Descriptor::Descriptor() {
sk_bzero(this, sizeof(*this));
fTileMode = SkTileMode::kClamp;
}
SkGradientShaderBase::Descriptor::~Descriptor() = default;
void SkGradientShaderBase::Descriptor::flatten(SkWriteBuffer& buffer) const {
uint32_t flags = 0;
if (fPos) {
@ -851,6 +859,13 @@ sk_sp<SkShader> SkGradientShader::MakeLinear(const SkPoint pts[2],
localMatrix);
}
sk_sp<SkShader> SkGradientShader::MakeLinear(const SkPoint pts[2],
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count, SkTileMode mode) {
return MakeLinear(pts, colors, std::move(colorSpace), pos, count, mode, 0, nullptr);
}
sk_sp<SkShader> SkGradientShader::MakeLinear(const SkPoint pts[2],
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
@ -898,6 +913,13 @@ sk_sp<SkShader> SkGradientShader::MakeRadial(const SkPoint& center, SkScalar rad
flags, localMatrix);
}
sk_sp<SkShader> SkGradientShader::MakeRadial(const SkPoint& center, SkScalar radius,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count, SkTileMode mode) {
return MakeRadial(center, radius, colors, std::move(colorSpace), pos, count, mode, 0, nullptr);
}
sk_sp<SkShader> SkGradientShader::MakeRadial(const SkPoint& center, SkScalar radius,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
@ -946,6 +968,18 @@ sk_sp<SkShader> SkGradientShader::MakeTwoPointConical(const SkPoint& start,
nullptr, pos, colorCount, mode, flags, localMatrix);
}
sk_sp<SkShader> SkGradientShader::MakeTwoPointConical(const SkPoint& start,
SkScalar startRadius,
const SkPoint& end,
SkScalar endRadius,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[],
int count, SkTileMode mode) {
return MakeTwoPointConical(start, startRadius, end, endRadius, colors,
std::move(colorSpace), pos, count, mode, 0, nullptr);
}
sk_sp<SkShader> SkGradientShader::MakeTwoPointConical(const SkPoint& start,
SkScalar startRadius,
const SkPoint& end,
@ -1021,6 +1055,21 @@ sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy,
mode, startAngle, endAngle, flags, localMatrix);
}
sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count,
uint32_t flags, const SkMatrix* localMatrix) {
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count,
SkTileMode::kClamp, 0, 360, flags, localMatrix);
}
sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,
const SkScalar pos[], int count) {
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count, 0, nullptr);
}
sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy,
const SkColor4f colors[],
sk_sp<SkColorSpace> colorSpace,

View File

@ -25,10 +25,8 @@ class SkWriteBuffer;
class SkGradientShaderBase : public SkShaderBase {
public:
struct Descriptor {
Descriptor() {
sk_bzero(this, sizeof(*this));
fTileMode = SkTileMode::kClamp;
}
Descriptor();
~Descriptor();
const SkMatrix* fLocalMatrix;
const SkColor4f* fColors;

View File

@ -773,6 +773,7 @@ generated_cc_atom(
deps = [
":Test_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkMallocPixelRef_hdr",
@ -2906,6 +2907,7 @@ generated_cc_atom(
deps = [
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkGraphics_hdr",
"//include/core:SkImageGenerator_hdr",
@ -3130,6 +3132,7 @@ generated_cc_atom(
deps = [
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkPath_hdr",
@ -4883,6 +4886,7 @@ generated_cc_atom(
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorPriv_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkSurface_hdr",
"//include/private:SkColorData_hdr",
@ -5652,6 +5656,7 @@ generated_cc_atom(
deps = [
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkGraphics_hdr",
"//include/core:SkPictureRecorder_hdr",
"//include/core:SkPicture_hdr",
@ -7010,6 +7015,7 @@ generated_cc_atom(
deps = [
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkSurface_hdr",
"//include/core:SkTypes_hdr",
@ -7191,6 +7197,7 @@ generated_cc_atom(
":TestUtils_hdr",
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkSurface_hdr",
"//include/gpu:GrDirectContext_hdr",
],

View File

@ -7,6 +7,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMallocPixelRef.h"
#include "include/core/SkPixelRef.h"

View File

@ -6,8 +6,8 @@
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkImageGenerator.h"
#include "include/private/SkImageInfoPriv.h"

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"

View File

@ -8,6 +8,7 @@
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/private/SkColorData.h"

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "tests/Test.h"

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"

View File

@ -10,6 +10,7 @@
#if SK_SUPPORT_GPU && defined(SK_VULKAN)
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrDirectContext.h"

View File

@ -13,6 +13,7 @@ generated_cc_atom(
"//experimental/graphite/src:ContextPriv_hdr",
"//experimental/graphite/src:Gpu_hdr",
"//experimental/graphite/src:ResourceTypes_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkSurface_hdr",
"//tests:Test_hdr",
],

View File

@ -16,6 +16,7 @@
#include "experimental/graphite/src/Gpu.h"
#include "experimental/graphite/src/ResourceTypes.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkSurface.h"
using namespace skgpu;

View File

@ -152,8 +152,10 @@ generated_cc_atom(
visibility = ["//:__subpackages__"],
deps = [
":HashAndEncode_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkICC_hdr",
"//include/core:SkString_hdr",
"//include/third_party/skcms:skcms_hdr",
"//third_party:libpng",
],
)
@ -255,6 +257,7 @@ generated_cc_atom(
":ResourceFactory_hdr",
":Resources_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkData_hdr",
"//include/core:SkImageGenerator_hdr",
"//include/core:SkImage_hdr",
@ -598,6 +601,7 @@ generated_cc_atom(
srcs = ["remote_demo.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkGraphics_hdr",
"//include/core:SkSurface_hdr",
"//include/private/chromium:SkChromeRemoteGlyphCache_hdr",

View File

@ -1,9 +1,12 @@
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "tools/HashAndEncode.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkICC.h"
#include "include/core/SkString.h"
#include "tools/HashAndEncode.h"
#include "include/third_party/skcms/skcms.h"
#include <png.h>

View File

@ -6,6 +6,7 @@
*/
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageGenerator.h"

View File

@ -39,6 +39,7 @@ generated_cc_atom(
hdrs = ["BackendSurfaceFactory.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkRefCnt_hdr",
"//include/core:SkSize_hdr",
"//include/gpu:GrTypes_hdr",
@ -79,6 +80,7 @@ generated_cc_atom(
deps = [
":BackendTextureImageFactory_hdr",
":ManagedBackendTexture_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPixmap_hdr",
"//include/gpu:GrBackendSurface_hdr",
@ -338,6 +340,7 @@ generated_cc_atom(
hdrs = ["YUVUtils.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkYUVAPixmaps_hdr",
"//include/gpu:GrBackendSurface_hdr",

View File

@ -8,13 +8,13 @@
#ifndef TestSurface_DEFINED
#define TestSurface_DEFINED
#include "include/core/SkColorSpace.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/gpu/GrTypes.h"
#include "include/private/SkColorData.h"
class GrDirectContext;
class SkColorSpace;
class SkSurface;
class SkSurfaceProps;
enum SkColorType : int;

View File

@ -7,6 +7,7 @@
#include "tools/gpu/BackendTextureImageFactory.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkPixmap.h"
#include "include/gpu/GrBackendSurface.h"

View File

@ -8,6 +8,7 @@
#ifndef YUVUtils_DEFINED
#define YUVUtils_DEFINED
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkYUVAPixmaps.h"
#include "include/gpu/GrBackendSurface.h"

View File

@ -16,6 +16,7 @@
#include <thread>
#include <unistd.h>
#include "include/core/SkColorSpace.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkSurface.h"
#include "include/private/chromium/SkChromeRemoteGlyphCache.h"

View File

@ -131,6 +131,7 @@ generated_cc_atom(
hdrs = ["DisplayParams.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColorSpace_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkSurfaceProps_hdr",
"//include/gpu:GrContextOptions_hdr",

View File

@ -7,6 +7,7 @@
#ifndef DisplayParams_DEFINED
#define DisplayParams_DEFINED
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkSurfaceProps.h"
#include "include/gpu/GrContextOptions.h"

View File

@ -22,6 +22,7 @@ generated_cc_atom(
deps = [
":Request_hdr",
"//include/core:SkBitmap_hdr",
"//include/core:SkColorSpace_hdr",
"//include/core:SkPictureRecorder_hdr",
"//include/gpu:GrDirectContext_hdr",
"//src/utils:SkJSONWriter_hdr",

View File

@ -10,6 +10,7 @@
#include <memory>
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPictureRecorder.h"
#include "include/gpu/GrDirectContext.h"
#include "src/utils/SkJSONWriter.h"

View File

@ -3,6 +3,8 @@
#include "tools/skottie_ios_app/SkMetalViewBridge.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrContextOptions.h"