Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick upsteam bug fix to expose codec registration methods #132

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/codec/SkAvifDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkBmpDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
4 changes: 2 additions & 2 deletions include/codec/SkCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ using MakeFromStreamCallback = std::unique_ptr<SkCodec> (*)(std::unique_ptr<SkSt
SkCodec::Result*,
DecodeContext);

struct Decoder {
struct SK_API Decoder {
// By convention, we use all lowercase letters and go with the primary filename extension.
// For example "png", "jpg", "ico", "webp", etc
std::string id;
Expand All @@ -1033,7 +1033,7 @@ struct Decoder {
// SkCodec::MakeFromStream. If a decoder with the same id already exists, this new decoder
// will replace the existing one (in the same position). This is not thread-safe, so make sure all
// initialization is done before the first call.
void Register(Decoder d);
void SK_API Register(Decoder d);
}

#endif // SkCodec_DEFINED
1 change: 1 addition & 0 deletions include/codec/SkGifDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkIcoDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkJpegDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkJpegxlDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkPngDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkRawDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkWbmpDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions include/codec/SkWebpDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAPI.h"

class SkData;
class SkStream;
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkAvifCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "src/codec/SkAvifCodec.h"

#include "include/codec/SkAvifDecoder.h"
#include "include/codec/SkCodec.h"
#include "include/codec/SkCodecAnimation.h"
#include "include/core/SkColorType.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkBmpCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "src/codec/SkBmpCodec.h"

#include "include/codec/SkBmpDecoder.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkIcoCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "src/codec/SkIcoCodec.h"

#include "include/codec/SkIcoDecoder.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkJpegCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "src/codec/SkJpegCodec.h"

#include "include/codec/SkCodec.h"
#include "include/codec/SkJpegDecoder.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
Expand Down
3 changes: 2 additions & 1 deletion src/codec/SkJpegxlCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "src/codec/SkJpegxlCodec.h"

#include "include/codec/SkCodec.h"
#include "include/codec/SkJpegxlDecoder.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
Expand Down Expand Up @@ -465,7 +466,7 @@ const SkFrameHolder* SkJpegxlCodec::getFrameHolder() const {
// TODO(eustas): implement
// SkSampler* SkJpegxlCodec::getSampler(bool /*createIfNecessary*/) { return nullptr; }

namespace SkJpegDecoder {
namespace SkJpegxlDecoder {
bool IsJpegxl(const void* data, size_t len) {
return SkJpegxlCodec::IsJpegxl(data, len);
}
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkPngCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "src/codec/SkPngCodec.h"

#include "include/codec/SkPngChunkReader.h"
#include "include/codec/SkPngDecoder.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkRawCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "src/codec/SkRawCodec.h"

#include "include/codec/SkCodec.h"
#include "include/codec/SkRawDecoder.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkWbmpCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "src/codec/SkWbmpCodec.h"

#include "include/codec/SkCodec.h"
#include "include/codec/SkWbmpDecoder.h"
#include "include/codec/SkEncodedImageFormat.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkWebpCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "include/codec/SkCodec.h"
#include "include/codec/SkCodecAnimation.h"
#include "include/codec/SkWebpDecoder.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColorType.h"
Expand Down
1 change: 1 addition & 0 deletions src/codec/SkWuffsCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "include/codec/SkCodec.h"
#include "include/codec/SkCodecAnimation.h"
#include "include/codec/SkEncodedImageFormat.h"
#include "include/codec/SkGifDecoder.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkBlendMode.h"
Expand Down