Revert "manually register codecs in DM"

This reverts commit 9b2633e294.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> manually register codecs in DM
> 
> We'll want to do this when we've got Google3 refactored
> to slice out each of these four codecs into its own little target.
> 
> Small tweaks to make SkPngCodec match the pattern of the rest.
> 
> Should be harmless to have both the compile-time and runtime
> registration, right?
> 
> Change-Id: Ic72394764ac267758dc1023e85f3d0c4b655d420
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213872
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,scroggo@google.com,brianosman@google.com

Change-Id: If3272ef1985757a93ada229f833408d4bf83ddfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214108
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-05-15 22:02:52 +00:00
parent 4bf6fd68db
commit b3c0bf6426
3 changed files with 4 additions and 19 deletions

View File

@ -22,10 +22,6 @@
#include "include/private/SkMutex.h"
#include "include/private/SkSpinlock.h"
#include "include/private/SkTHash.h"
#include "src/codec/SkIcoCodec.h"
#include "src/codec/SkJpegCodec.h"
#include "src/codec/SkPngCodec.h"
#include "src/codec/SkWebpCodec.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkMD5.h"
#include "src/core/SkOSFile.h"
@ -1389,11 +1385,6 @@ int main(int argc, char** argv) {
#endif
CommandLineFlags::Parse(argc, argv);
SkCodec::Register( SkIcoCodec::IsIco , SkIcoCodec::MakeFromStream);
SkCodec::Register(SkJpegCodec::IsJpeg, SkJpegCodec::MakeFromStream);
SkCodec::Register( SkPngCodec::IsPng , SkPngCodec::MakeFromStream);
SkCodec::Register(SkWebpCodec::IsWebp, SkWebpCodec::MakeFromStream);
initializeEventTracingForTools();
#if !defined(SK_BUILD_FOR_GOOGLE3) && defined(SK_BUILD_FOR_IOS)

View File

@ -325,7 +325,7 @@ bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo) {
// Creation
///////////////////////////////////////////////////////////////////////////////
bool SkPngCodec::IsPng(const void* buf, size_t bytesRead) {
bool SkPngCodec::IsPng(const char* buf, size_t bytesRead) {
return !png_sig_cmp((png_bytep) buf, (png_size_t)0, bytesRead);
}

View File

@ -19,17 +19,11 @@ class SkStream;
class SkPngCodec : public SkCodec {
public:
static bool IsPng(const void*, size_t);
static bool IsPng(const char*, size_t);
// Assume IsPng was called and returned true.
static std::unique_ptr<SkCodec> MakeFromStream(std::unique_ptr<SkStream>,
Result*,
SkPngChunkReader*);
static std::unique_ptr<SkCodec> MakeFromStream(std::unique_ptr<SkStream> stream,
Result* result) {
return MakeFromStream(std::move(stream), result, nullptr);
}
static std::unique_ptr<SkCodec> MakeFromStream(std::unique_ptr<SkStream>, Result*,
SkPngChunkReader* = nullptr);
// FIXME (scroggo): Temporarily needed by AutoCleanPng.
void setIdatLength(size_t len) { fIdatLength = len; }