blob: a5ae8d056075bb5136e1abb5fc99414311d450c1 [file] [log] [blame]
/*
* Copyright 2009 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkImageEncoderPriv.h"
template SkImageEncoder_EncodeReg* SkImageEncoder_EncodeReg::gHead;
SkImageEncoder* SkImageEncoder::Create(SkImageEncoder::Type t) {
SkImageEncoder* codec = nullptr;
const SkImageEncoder_EncodeReg* curr = SkImageEncoder_EncodeReg::Head();
while (curr) {
if ((codec = curr->factory()(t)) != nullptr) {
return codec;
}
curr = curr->next();
}
return nullptr;
}