@shopify/react-native-skia 0.1.196 → 0.1.199
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +32 -31
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +4 -2
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -0
- package/cpp/api/JsiSkImage.h +1 -1
- package/cpp/api/JsiSkShaderFactory.h +4 -4
- package/cpp/api/JsiSkSurface.h +0 -1
- package/cpp/api/JsiSkSurfaceFactory.h +2 -1
- package/cpp/rnskia/RNSkView.h +20 -40
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +2 -2
- package/cpp/rnskia/values/RNSkReadonlyValue.h +6 -7
- package/cpp/skia/include/android/SkCanvasAndroid.h +20 -0
- package/cpp/skia/include/android/SkHeifDecoder.h +43 -0
- package/cpp/skia/include/android/SkSurfaceAndroid.h +50 -0
- package/cpp/skia/include/codec/SkAvifDecoder.h +43 -0
- package/cpp/skia/include/codec/SkBmpDecoder.h +43 -0
- package/cpp/skia/include/codec/SkCodec.h +25 -1
- package/cpp/skia/include/codec/SkGifDecoder.h +43 -0
- package/cpp/skia/include/codec/SkIcoDecoder.h +43 -0
- package/cpp/skia/include/codec/SkJpegDecoder.h +43 -0
- package/cpp/skia/include/codec/SkJpegxlDecoder.h +43 -0
- package/cpp/skia/include/codec/SkPngDecoder.h +43 -0
- package/cpp/skia/include/codec/SkRawDecoder.h +49 -0
- package/cpp/skia/include/codec/SkWbmpDecoder.h +43 -0
- package/cpp/skia/include/codec/SkWebpDecoder.h +43 -0
- package/cpp/skia/include/core/SkBBHFactory.h +5 -1
- package/cpp/skia/include/core/SkBlender.h +0 -2
- package/cpp/skia/include/core/SkCanvas.h +4 -23
- package/cpp/skia/include/core/SkColorFilter.h +14 -1
- package/cpp/skia/include/core/SkColorTable.h +59 -0
- package/cpp/skia/include/core/SkContourMeasure.h +3 -0
- package/cpp/skia/include/core/SkDeferredDisplayList.h +8 -104
- package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +8 -91
- package/cpp/skia/include/core/SkDrawable.h +5 -2
- package/cpp/skia/include/core/SkGraphics.h +7 -19
- package/cpp/skia/include/core/SkImage.h +157 -249
- package/cpp/skia/include/core/SkImageGenerator.h +0 -31
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPathMeasure.h +3 -3
- package/cpp/skia/include/core/SkPictureRecorder.h +1 -1
- package/cpp/skia/include/core/SkPoint.h +5 -563
- package/cpp/skia/include/core/SkPoint3.h +1 -0
- package/cpp/skia/include/core/SkPromiseImageTexture.h +4 -30
- package/cpp/skia/include/core/SkRect.h +8 -8
- package/cpp/skia/include/core/SkSamplingOptions.h +4 -2
- package/cpp/skia/include/core/SkScalar.h +1 -1
- package/cpp/skia/include/core/SkSerialProcs.h +5 -1
- package/cpp/skia/include/core/SkShader.h +14 -21
- package/cpp/skia/include/core/SkString.h +2 -0
- package/cpp/skia/include/core/SkSurface.h +169 -701
- package/cpp/skia/include/core/SkSurfaceCharacterization.h +8 -256
- package/cpp/skia/include/core/SkTiledImageUtils.h +97 -0
- package/cpp/skia/include/core/SkTypes.h +4 -2
- package/cpp/skia/include/core/SkYUVAPixmaps.h +0 -5
- package/cpp/skia/include/effects/SkGradientShader.h +10 -1
- package/cpp/skia/include/effects/SkImageFilters.h +62 -37
- package/cpp/skia/include/effects/SkPerlinNoiseShader.h +28 -29
- package/cpp/skia/include/effects/SkRuntimeEffect.h +17 -12
- package/cpp/skia/include/gpu/GrBackendSurface.h +12 -39
- package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +6 -0
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +3 -3
- package/cpp/skia/include/gpu/GrDirectContext.h +103 -3
- package/cpp/skia/include/gpu/GrRecordingContext.h +10 -19
- package/cpp/skia/include/gpu/MutableTextureState.h +4 -0
- package/cpp/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +54 -0
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +20 -76
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +217 -0
- package/cpp/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +73 -0
- package/cpp/skia/include/gpu/gl/GrGLTypes.h +13 -2
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +78 -0
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +1 -0
- package/cpp/skia/include/gpu/graphite/Image.h +277 -0
- package/cpp/skia/include/gpu/graphite/ImageProvider.h +1 -1
- package/cpp/skia/include/gpu/graphite/Recording.h +1 -4
- package/cpp/skia/include/gpu/graphite/Surface.h +81 -0
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +5 -7
- package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +2 -2
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +23 -8
- package/cpp/skia/include/ports/SkTypeface_fontations.h +21 -0
- package/cpp/skia/include/private/SkGainmapInfo.h +2 -0
- package/cpp/skia/include/private/SkGainmapShader.h +1 -0
- package/cpp/skia/include/private/SkJpegMetadataDecoder.h +19 -1
- package/cpp/skia/include/private/SkPathRef.h +13 -15
- package/cpp/skia/include/private/SkXmp.h +53 -0
- package/cpp/skia/include/private/base/SkFeatures.h +0 -4
- package/cpp/skia/include/private/base/SkFloatingPoint.h +11 -5
- package/cpp/skia/include/private/base/SkPoint_impl.h +569 -0
- package/cpp/skia/include/private/base/SkSpan_impl.h +3 -7
- package/cpp/skia/include/private/base/SkTArray.h +11 -11
- package/cpp/skia/include/private/chromium/GrDeferredDisplayList.h +120 -0
- package/cpp/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +98 -0
- package/cpp/skia/include/private/chromium/GrPromiseImageTexture.h +43 -0
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +215 -0
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +6 -6
- package/cpp/skia/include/private/chromium/SkImageChromium.h +104 -0
- package/cpp/skia/include/private/chromium/Slug.h +7 -3
- package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +7 -3
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +2 -0
- package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +3 -2
- package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +10 -2
- package/cpp/skia/include/{gpu → private/gpu}/ganesh/GrTextureGenerator.h +2 -13
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +7 -0
- package/cpp/skia/include/private/gpu/graphite/MtlGraphiteTypesPriv.h +19 -6
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +13 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +0 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +14 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +999 -79
- package/cpp/skia/modules/skcms/src/Transform_inl.h +36 -236
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -0
- package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +16 -0
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +6 -2
- package/cpp/skia/modules/skresources/include/SkResources.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGClipPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGDefs.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGEllipse.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFe.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeBlend.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeColorMatrix.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeComposite.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeDisplacementMap.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeFlood.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeGaussianBlur.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeImage.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeOffset.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeTurbulence.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFilter.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGG.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGGradient.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGHiddenContainer.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGImage.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGLine.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGLinearGradient.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGMask.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGNode.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPattern.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGStop.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTypes.h +21 -21
- package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGValue.h +2 -2
- package/cpp/skia/{include/private → src/core}/SkChecksum.h +32 -17
- package/cpp/skia/src/core/SkTHash.h +1 -1
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +3 -1
- package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +3 -1
- package/lib/commonjs/renderer/Canvas.js +24 -13
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +2 -2
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js +5 -1
- package/lib/commonjs/skia/core/RRect.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.js +32 -6
- package/lib/commonjs/skia/core/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/Color.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +2 -4
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/renderer/Canvas.js +25 -14
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -2
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/RRect.js +5 -1
- package/lib/module/skia/core/RRect.js.map +1 -1
- package/lib/module/skia/core/Rect.js +32 -6
- package/lib/module/skia/core/Rect.js.map +1 -1
- package/lib/module/skia/types/Color.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +2 -4
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +2 -4
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libsksg.xcframework/Info.plist +5 -5
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +3 -4
- package/src/renderer/Canvas.tsx +25 -19
- package/src/skia/core/Data.ts +3 -3
- package/src/skia/core/RRect.tsx +4 -2
- package/src/skia/core/Rect.ts +29 -12
- package/src/skia/types/Color.ts +1 -1
- package/src/skia/types/JsiInstance.ts +2 -5
- package/cpp/skia/include/effects/SkTableColorFilter.h +0 -29
- package/cpp/skia/include/private/SkOpts_spi.h +0 -23
- package/cpp/skia/include/private/SkSpinlock.h +0 -57
- package/cpp/skia/include/private/chromium/GrSlug.h +0 -16
- package/scripts/install-npm.js +0 -33
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkJpegDecoder_DEFINED
|
8
|
+
#define SkJpegDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkJpegDecoder {
|
19
|
+
|
20
|
+
/** Returns true if this data claims to be a JPEG image. */
|
21
|
+
SK_API bool IsJpeg(const void*, size_t);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Attempts to decode the given bytes as a JPEG.
|
25
|
+
*
|
26
|
+
* If the bytes are not a JPEG, returns nullptr.
|
27
|
+
*
|
28
|
+
* DecodeContext is ignored
|
29
|
+
*/
|
30
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
31
|
+
SkCodec::Result*,
|
32
|
+
SkCodecs::DecodeContext = nullptr);
|
33
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
34
|
+
SkCodec::Result*,
|
35
|
+
SkCodecs::DecodeContext = nullptr);
|
36
|
+
|
37
|
+
inline SkCodecs::Decoder Decoder() {
|
38
|
+
return { "jpeg", IsJpeg, Decode };
|
39
|
+
}
|
40
|
+
|
41
|
+
} // namespace SkJpegDecoder
|
42
|
+
|
43
|
+
#endif // SkJpegDecoder_DEFINED
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkJpegxlDecoder_DEFINED
|
8
|
+
#define SkJpegxlDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkJpegxlDecoder {
|
19
|
+
|
20
|
+
/** Returns true if this data claims to be a JPEGXL image. */
|
21
|
+
SK_API bool IsJpegxl(const void*, size_t);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Attempts to decode the given bytes as a JPEGXL.
|
25
|
+
*
|
26
|
+
* If the bytes are not a JPEGXL, returns nullptr.
|
27
|
+
*
|
28
|
+
* DecodeContext is ignored
|
29
|
+
*/
|
30
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
31
|
+
SkCodec::Result*,
|
32
|
+
SkCodecs::DecodeContext = nullptr);
|
33
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
34
|
+
SkCodec::Result*,
|
35
|
+
SkCodecs::DecodeContext = nullptr);
|
36
|
+
|
37
|
+
inline SkCodecs::Decoder Decoder() {
|
38
|
+
return { "jpegxl", IsJpegxl, Decode };
|
39
|
+
}
|
40
|
+
|
41
|
+
} // namespace SkJpegxlDecoder
|
42
|
+
|
43
|
+
#endif // SkJpegxlDecoder_DEFINED
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkPngDecoder_DEFINED
|
8
|
+
#define SkPngDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkPngDecoder {
|
19
|
+
|
20
|
+
/** Returns true if this data claims to be a PNG image. */
|
21
|
+
SK_API bool IsPng(const void*, size_t);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Attempts to decode the given bytes as a PNG.
|
25
|
+
*
|
26
|
+
* If the bytes are not a PNG, returns nullptr.
|
27
|
+
*
|
28
|
+
* DecodeContext, if non-null, is expected to be a SkPngChunkReader*
|
29
|
+
*/
|
30
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
31
|
+
SkCodec::Result*,
|
32
|
+
SkCodecs::DecodeContext = nullptr);
|
33
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
34
|
+
SkCodec::Result*,
|
35
|
+
SkCodecs::DecodeContext = nullptr);
|
36
|
+
|
37
|
+
inline SkCodecs::Decoder Decoder() {
|
38
|
+
return { "png", IsPng, Decode };
|
39
|
+
}
|
40
|
+
|
41
|
+
} // namespace SkPngDecoder
|
42
|
+
|
43
|
+
#endif // SkPngDecoder_DEFINED
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkRawDecoder_DEFINED
|
8
|
+
#define SkRawDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkRawDecoder {
|
19
|
+
|
20
|
+
inline bool IsRaw(const void*, size_t) {
|
21
|
+
// Raw formats are tricky to detect just by reading in the first several bytes.
|
22
|
+
// For example, PIEX might need to read 10k bytes to detect Sony's arw format
|
23
|
+
// https://github.com/google/piex/blob/f1e15dd837c04347504149f71db67a78fbeddc73/src/image_type_recognition/image_type_recognition_lite.cc#L152
|
24
|
+
// Thus, we just assume everything might be a RAW file and check it last.
|
25
|
+
return true;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Attempts to decode the given bytes as a raw image.
|
30
|
+
*
|
31
|
+
* If the bytes are not a raw, returns nullptr.
|
32
|
+
*
|
33
|
+
* DecodeContext is ignored
|
34
|
+
*/
|
35
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
36
|
+
SkCodec::Result*,
|
37
|
+
SkCodecs::DecodeContext = nullptr);
|
38
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
39
|
+
SkCodec::Result*,
|
40
|
+
SkCodecs::DecodeContext = nullptr);
|
41
|
+
|
42
|
+
// This decoder will always be checked last, no matter when it is registered.
|
43
|
+
inline SkCodecs::Decoder Decoder() {
|
44
|
+
return { "raw", IsRaw, Decode };
|
45
|
+
}
|
46
|
+
|
47
|
+
} // namespace SkRawDecoder
|
48
|
+
|
49
|
+
#endif // SkRawDecoder_DEFINED
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkWbmpDecoder_DEFINED
|
8
|
+
#define SkWbmpDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkWbmpDecoder {
|
19
|
+
|
20
|
+
/** Returns true if this data claims to be a WBMP image. */
|
21
|
+
SK_API bool IsWbmp(const void*, size_t);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Attempts to decode the given bytes as a WBMP.
|
25
|
+
*
|
26
|
+
* If the bytes are not a WBMP, returns nullptr.
|
27
|
+
*
|
28
|
+
* DecodeContext is ignored
|
29
|
+
*/
|
30
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
31
|
+
SkCodec::Result*,
|
32
|
+
SkCodecs::DecodeContext = nullptr);
|
33
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
34
|
+
SkCodec::Result*,
|
35
|
+
SkCodecs::DecodeContext = nullptr);
|
36
|
+
|
37
|
+
inline SkCodecs::Decoder Decoder() {
|
38
|
+
return { "wbmp", IsWbmp, Decode };
|
39
|
+
}
|
40
|
+
|
41
|
+
} // namespace SkWbmpDecoder
|
42
|
+
|
43
|
+
#endif // SkWbmpDecoder_DEFINED
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#ifndef SkWebpDecoder_DEFINED
|
8
|
+
#define SkWebpDecoder_DEFINED
|
9
|
+
|
10
|
+
#include "include/codec/SkCodec.h"
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
|
13
|
+
class SkData;
|
14
|
+
class SkStream;
|
15
|
+
|
16
|
+
#include <memory>
|
17
|
+
|
18
|
+
namespace SkWebpDecoder {
|
19
|
+
|
20
|
+
/** Returns true if this data claims to be a WEBP image. */
|
21
|
+
SK_API bool IsWebp(const void*, size_t);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Attempts to decode the given bytes as a WEBP.
|
25
|
+
*
|
26
|
+
* If the bytes are not a WEBP, returns nullptr.
|
27
|
+
*
|
28
|
+
* DecodeContext is ignored
|
29
|
+
*/
|
30
|
+
SK_API std::unique_ptr<SkCodec> Decode(std::unique_ptr<SkStream>,
|
31
|
+
SkCodec::Result*,
|
32
|
+
SkCodecs::DecodeContext = nullptr);
|
33
|
+
SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
|
34
|
+
SkCodec::Result*,
|
35
|
+
SkCodecs::DecodeContext = nullptr);
|
36
|
+
|
37
|
+
inline SkCodecs::Decoder Decoder() {
|
38
|
+
return { "webp", IsWebp, Decode };
|
39
|
+
}
|
40
|
+
|
41
|
+
} // namespace SkWebpDecoder
|
42
|
+
|
43
|
+
#endif // SkWebpDecoder_DEFINED
|
@@ -8,9 +8,13 @@
|
|
8
8
|
#ifndef SkBBHFactory_DEFINED
|
9
9
|
#define SkBBHFactory_DEFINED
|
10
10
|
|
11
|
-
#include "include/core/SkRect.h"
|
12
11
|
#include "include/core/SkRefCnt.h"
|
13
12
|
#include "include/core/SkTypes.h"
|
13
|
+
|
14
|
+
// TODO(kjlubick) fix client users and then make this a forward declare
|
15
|
+
#include "include/core/SkRect.h" // IWYU pragma: keep
|
16
|
+
|
17
|
+
#include <cstddef>
|
14
18
|
#include <vector>
|
15
19
|
|
16
20
|
class SkBBoxHierarchy : public SkRefCnt {
|
@@ -74,15 +74,6 @@ namespace skgpu::graphite { class Recorder; }
|
|
74
74
|
namespace sktext::gpu { class Slug; }
|
75
75
|
namespace SkRecords { class Draw; }
|
76
76
|
|
77
|
-
#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_GANESH)
|
78
|
-
class GrBackendRenderTarget;
|
79
|
-
#endif
|
80
|
-
|
81
|
-
// TODO:
|
82
|
-
// This is not ideal but Chrome is depending on a forward decl of GrSlug here.
|
83
|
-
// It should be removed once Chrome has migrated to sktext::gpu::Slug.
|
84
|
-
using GrSlug = sktext::gpu::Slug;
|
85
|
-
|
86
77
|
/** \class SkCanvas
|
87
78
|
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
|
88
79
|
SkCanvas contains a stack of SkMatrix and clip values.
|
@@ -2183,12 +2174,6 @@ public:
|
|
2183
2174
|
|
2184
2175
|
///////////////////////////////////////////////////////////////////////////
|
2185
2176
|
|
2186
|
-
#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_GANESH)
|
2187
|
-
// These methods exist to support WebView in Android Framework.
|
2188
|
-
SkIRect topLayerBounds() const;
|
2189
|
-
GrBackendRenderTarget topLayerBackendRenderTarget() const;
|
2190
|
-
#endif
|
2191
|
-
|
2192
2177
|
/**
|
2193
2178
|
* Returns the global clip as a region. If the clip contains AA, then only the bounds
|
2194
2179
|
* of the clip may be returned.
|
@@ -2300,16 +2285,14 @@ protected:
|
|
2300
2285
|
|
2301
2286
|
virtual void onDiscard();
|
2302
2287
|
|
2303
|
-
|
2304
|
-
/** Experimental
|
2288
|
+
/**
|
2305
2289
|
*/
|
2306
2290
|
virtual sk_sp<sktext::gpu::Slug> onConvertGlyphRunListToSlug(
|
2307
2291
|
const sktext::GlyphRunList& glyphRunList, const SkPaint& paint);
|
2308
2292
|
|
2309
|
-
/**
|
2293
|
+
/**
|
2310
2294
|
*/
|
2311
2295
|
virtual void onDrawSlug(const sktext::gpu::Slug* slug);
|
2312
|
-
#endif
|
2313
2296
|
|
2314
2297
|
private:
|
2315
2298
|
|
@@ -2457,19 +2440,17 @@ private:
|
|
2457
2440
|
SkCanvas& operator=(SkCanvas&&) = delete;
|
2458
2441
|
SkCanvas& operator=(const SkCanvas&) = delete;
|
2459
2442
|
|
2460
|
-
#if (defined(SK_GANESH) || defined(SK_GRAPHITE))
|
2461
2443
|
friend class sktext::gpu::Slug;
|
2462
|
-
/**
|
2444
|
+
/**
|
2463
2445
|
* Convert a SkTextBlob to a sktext::gpu::Slug using the current canvas state.
|
2464
2446
|
*/
|
2465
2447
|
sk_sp<sktext::gpu::Slug> convertBlobToSlug(const SkTextBlob& blob, SkPoint origin,
|
2466
2448
|
const SkPaint& paint);
|
2467
2449
|
|
2468
|
-
/**
|
2450
|
+
/**
|
2469
2451
|
* Draw an sktext::gpu::Slug given the current canvas state.
|
2470
2452
|
*/
|
2471
2453
|
void drawSlug(const sktext::gpu::Slug* slug);
|
2472
|
-
#endif
|
2473
2454
|
|
2474
2455
|
/** Experimental
|
2475
2456
|
* Saves the specified subset of the current pixels in the current layer,
|
@@ -8,12 +8,20 @@
|
|
8
8
|
#ifndef SkColorFilter_DEFINED
|
9
9
|
#define SkColorFilter_DEFINED
|
10
10
|
|
11
|
-
#include "include/core/SkBlendMode.h"
|
12
11
|
#include "include/core/SkColor.h"
|
13
12
|
#include "include/core/SkFlattenable.h"
|
13
|
+
#include "include/core/SkRefCnt.h"
|
14
|
+
#include "include/private/base/SkAPI.h"
|
15
|
+
|
16
|
+
#include <cstddef>
|
17
|
+
#include <cstdint>
|
14
18
|
|
15
19
|
class SkColorMatrix;
|
16
20
|
class SkColorSpace;
|
21
|
+
class SkColorTable;
|
22
|
+
|
23
|
+
enum class SkBlendMode;
|
24
|
+
struct SkDeserialProcs;
|
17
25
|
|
18
26
|
/**
|
19
27
|
* ColorFilters are optional objects in the drawing pipeline. When present in
|
@@ -113,6 +121,11 @@ public:
|
|
113
121
|
const uint8_t tableG[256],
|
114
122
|
const uint8_t tableB[256]);
|
115
123
|
|
124
|
+
/**
|
125
|
+
* Create a table colorfilter that holds a ref to the shared color table.
|
126
|
+
*/
|
127
|
+
static sk_sp<SkColorFilter> Table(sk_sp<SkColorTable> table);
|
128
|
+
|
116
129
|
/**
|
117
130
|
* Create a colorfilter that multiplies the RGB channels by one color, and
|
118
131
|
* then adds a second color, pinning the result for each component to
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef SkColorTable_DEFINED
|
9
|
+
#define SkColorTable_DEFINED
|
10
|
+
|
11
|
+
#include "include/core/SkBitmap.h"
|
12
|
+
#include "include/core/SkRefCnt.h"
|
13
|
+
|
14
|
+
class SkReadBuffer;
|
15
|
+
class SkWriteBuffer;
|
16
|
+
|
17
|
+
/**
|
18
|
+
* SkColorTable holds the lookup tables for each channel (ARGB) used to define the filter behavior
|
19
|
+
* of `SkColorFilters::Table`, and provides a way to share the table data between client code and
|
20
|
+
* the returned SkColorFilter. Once created, an SkColorTable is immutable.
|
21
|
+
*/
|
22
|
+
class SkColorTable : public SkRefCnt {
|
23
|
+
public:
|
24
|
+
// Creates a new SkColorTable with 'table' used for all four channels. The table is copied into
|
25
|
+
// the SkColorTable.
|
26
|
+
static sk_sp<SkColorTable> Make(const uint8_t table[256]) {
|
27
|
+
return Make(table, table, table, table);
|
28
|
+
}
|
29
|
+
|
30
|
+
// Creates a new SkColorTable with the per-channel lookup tables. Each non-null table is copied
|
31
|
+
// into the SkColorTable. Null parameters are interpreted as the identity table.
|
32
|
+
static sk_sp<SkColorTable> Make(const uint8_t tableA[256],
|
33
|
+
const uint8_t tableR[256],
|
34
|
+
const uint8_t tableG[256],
|
35
|
+
const uint8_t tableB[256]);
|
36
|
+
|
37
|
+
// Per-channel constant value lookup (0-255).
|
38
|
+
const uint8_t* alphaTable() const { return fTable.getAddr8(0, 0); }
|
39
|
+
const uint8_t* redTable() const { return fTable.getAddr8(0, 1); }
|
40
|
+
const uint8_t* greenTable() const { return fTable.getAddr8(0, 2); }
|
41
|
+
const uint8_t* blueTable() const { return fTable.getAddr8(0, 3); }
|
42
|
+
|
43
|
+
void flatten(SkWriteBuffer& buffer) const;
|
44
|
+
|
45
|
+
static sk_sp<SkColorTable> Deserialize(SkReadBuffer& buffer);
|
46
|
+
|
47
|
+
private:
|
48
|
+
friend class SkTableColorFilter; // for bitmap()
|
49
|
+
|
50
|
+
SkColorTable(const SkBitmap& table) : fTable(table) {}
|
51
|
+
|
52
|
+
// The returned SkBitmap is immutable; attempting to modify its pixel data will trigger asserts
|
53
|
+
// in debug builds and cause undefined behavior in release builds.
|
54
|
+
const SkBitmap& bitmap() const { return fTable; }
|
55
|
+
|
56
|
+
SkBitmap fTable; // A 256x4 A8 image
|
57
|
+
};
|
58
|
+
|
59
|
+
#endif // SkColorTable_DEFINED
|
@@ -102,6 +102,9 @@ public:
|
|
102
102
|
SkContourMeasureIter(const SkPath& path, bool forceClosed, SkScalar resScale = 1);
|
103
103
|
~SkContourMeasureIter();
|
104
104
|
|
105
|
+
SkContourMeasureIter(SkContourMeasureIter&&);
|
106
|
+
SkContourMeasureIter& operator=(SkContourMeasureIter&&);
|
107
|
+
|
105
108
|
/**
|
106
109
|
* Reset the Iter with a path.
|
107
110
|
* The parts of the path that are needed are copied, so the client is free to modify/delete
|
@@ -5,107 +5,11 @@
|
|
5
5
|
* found in the LICENSE file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
class SkPromiseImageTexture;
|
17
|
-
|
18
|
-
#if defined(SK_GANESH)
|
19
|
-
#include "include/gpu/GrRecordingContext.h"
|
20
|
-
#include "include/private/base/SkTArray.h"
|
21
|
-
#include <map>
|
22
|
-
class GrRenderTask;
|
23
|
-
class GrRenderTargetProxy;
|
24
|
-
#else
|
25
|
-
using GrRenderTargetProxy = SkRefCnt;
|
26
|
-
#endif
|
27
|
-
|
28
|
-
/*
|
29
|
-
* This class contains pre-processed gpu operations that can be replayed into
|
30
|
-
* an SkSurface via SkSurface::draw(SkDeferredDisplayList*).
|
31
|
-
*/
|
32
|
-
class SkDeferredDisplayList : public SkNVRefCnt<SkDeferredDisplayList> {
|
33
|
-
public:
|
34
|
-
SK_API ~SkDeferredDisplayList();
|
35
|
-
|
36
|
-
SK_API const SkSurfaceCharacterization& characterization() const {
|
37
|
-
return fCharacterization;
|
38
|
-
}
|
39
|
-
|
40
|
-
#if defined(SK_GANESH)
|
41
|
-
/**
|
42
|
-
* Iterate through the programs required by the DDL.
|
43
|
-
*/
|
44
|
-
class SK_API ProgramIterator {
|
45
|
-
public:
|
46
|
-
ProgramIterator(GrDirectContext*, SkDeferredDisplayList*);
|
47
|
-
~ProgramIterator();
|
48
|
-
|
49
|
-
// This returns true if any work was done. Getting a cache hit does not count as work.
|
50
|
-
bool compile();
|
51
|
-
bool done() const;
|
52
|
-
void next();
|
53
|
-
|
54
|
-
private:
|
55
|
-
GrDirectContext* fDContext;
|
56
|
-
const skia_private::TArray<GrRecordingContext::ProgramData>& fProgramData;
|
57
|
-
int fIndex;
|
58
|
-
};
|
59
|
-
#endif
|
60
|
-
|
61
|
-
// Provides access to functions that aren't part of the public API.
|
62
|
-
SkDeferredDisplayListPriv priv();
|
63
|
-
const SkDeferredDisplayListPriv priv() const; // NOLINT(readability-const-return-type)
|
64
|
-
|
65
|
-
private:
|
66
|
-
friend class GrDrawingManager; // for access to 'fRenderTasks', 'fLazyProxyData', 'fArenas'
|
67
|
-
friend class SkDeferredDisplayListRecorder; // for access to 'fLazyProxyData'
|
68
|
-
friend class SkDeferredDisplayListPriv;
|
69
|
-
|
70
|
-
// This object is the source from which the lazy proxy backing the DDL will pull its backing
|
71
|
-
// texture when the DDL is replayed. It has to be separately ref counted bc the lazy proxy
|
72
|
-
// can outlive the DDL.
|
73
|
-
class LazyProxyData : public SkRefCnt {
|
74
|
-
#if defined(SK_GANESH)
|
75
|
-
public:
|
76
|
-
// Upon being replayed - this field will be filled in (by the DrawingManager) with the
|
77
|
-
// proxy backing the destination SkSurface. Note that, since there is no good place to
|
78
|
-
// clear it, it can become a dangling pointer. Additionally, since the renderTargetProxy
|
79
|
-
// doesn't get a ref here, the SkSurface that owns it must remain alive until the DDL
|
80
|
-
// is flushed.
|
81
|
-
// TODO: the drawing manager could ref the renderTargetProxy for the DDL and then add
|
82
|
-
// a renderingTask to unref it after the DDL's ops have been executed.
|
83
|
-
GrRenderTargetProxy* fReplayDest = nullptr;
|
84
|
-
#endif
|
85
|
-
};
|
86
|
-
|
87
|
-
SK_API SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
|
88
|
-
sk_sp<GrRenderTargetProxy> fTargetProxy,
|
89
|
-
sk_sp<LazyProxyData>);
|
90
|
-
|
91
|
-
#if defined(SK_GANESH)
|
92
|
-
const skia_private::TArray<GrRecordingContext::ProgramData>& programData() const {
|
93
|
-
return fProgramData;
|
94
|
-
}
|
95
|
-
#endif
|
96
|
-
|
97
|
-
const SkSurfaceCharacterization fCharacterization;
|
98
|
-
|
99
|
-
#if defined(SK_GANESH)
|
100
|
-
// These are ordered such that the destructor cleans op tasks up first (which may refer back
|
101
|
-
// to the arena and memory pool in their destructors).
|
102
|
-
GrRecordingContext::OwnedArenas fArenas;
|
103
|
-
skia_private::TArray<sk_sp<GrRenderTask>> fRenderTasks;
|
104
|
-
|
105
|
-
skia_private::TArray<GrRecordingContext::ProgramData> fProgramData;
|
106
|
-
sk_sp<GrRenderTargetProxy> fTargetProxy;
|
107
|
-
sk_sp<LazyProxyData> fLazyProxyData;
|
108
|
-
#endif
|
109
|
-
};
|
110
|
-
|
111
|
-
#endif
|
8
|
+
// TODO(kjlubick, robertphillips) migrate Chromium to use the new location and name
|
9
|
+
#include "include/private/chromium/GrDeferredDisplayList.h" // IWYU pragma: export
|
10
|
+
|
11
|
+
class GrDeferredDisplayListRecorder;
|
12
|
+
class GrSurfaceCharacterization;
|
13
|
+
using SkDeferredDisplayList = GrDeferredDisplayList;
|
14
|
+
using SkDeferredDisplayListRecorder = GrDeferredDisplayListRecorder;
|
15
|
+
using SkSurfaceCharacterization = GrSurfaceCharacterization;
|