1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/images/SkImageEncoder_Factory.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2009 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 +#include "SkImageEncoder.h" 1.13 + 1.14 +template SkImageEncoder_EncodeReg* SkImageEncoder_EncodeReg::gHead; 1.15 + 1.16 +SkImageEncoder* SkImageEncoder::Create(Type t) { 1.17 + SkImageEncoder* codec = NULL; 1.18 + const SkImageEncoder_EncodeReg* curr = SkImageEncoder_EncodeReg::Head(); 1.19 + while (curr) { 1.20 + if ((codec = curr->factory()(t)) != NULL) { 1.21 + return codec; 1.22 + } 1.23 + curr = curr->next(); 1.24 + } 1.25 + return NULL; 1.26 +}