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