From: reed@android.com Date: Thu, 18 Jun 2009 17:53:12 +0000 (+0000) Subject: add registrar for gif movie X-Git-Tag: submit/tizen/20180928.044319~19535 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8540a79396e9fd2d3dbc1c409b4e5cd1b95f018e;p=platform%2Fupstream%2FlibSkiaSharp.git add registrar for gif movie git-svn-id: http://skia.googlecode.com/svn/trunk@221 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/src/images/SkMovie_gif.cpp b/src/images/SkMovie_gif.cpp index ca9c812712..253c242499 100644 --- a/src/images/SkMovie_gif.cpp +++ b/src/images/SkMovie_gif.cpp @@ -38,19 +38,6 @@ private: SavedImage* fCurrSavedImage; }; -SkMovie* SkMovie_GIF_Factory(SkStream* stream) { - char buf[GIF_STAMP_LEN]; - if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { - if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || - memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 || - memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) { - stream->rewind(); - return SkNEW_ARGS(SkGIFMovie, (stream)); - } - } - return NULL; -} - static int Decode(GifFileType* fileType, GifByteType* out, int size) { SkStream* stream = (SkStream*) fileType->UserData; return (int) stream->read(out, size); @@ -222,3 +209,22 @@ bool SkGIFMovie::onGetBitmap(SkBitmap* bm) } return true; } + +/////////////////////////////////////////////////////////////////////////////// + +#include "SkTRegistry.h" + +SkMovie* Factory(SkStream* stream) { + char buf[GIF_STAMP_LEN]; + if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { + if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || + memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 || + memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) { + stream->rewind(); + return SkNEW_ARGS(SkGIFMovie, (stream)); + } + } + return NULL; +} + +static SkTRegistry gReg(Factory);