Loading core/jni/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -128,7 +128,6 @@ LOCAL_SRC_FILES:= \ android/graphics/Matrix.cpp \ android/graphics/Matrix.cpp \ android/graphics/Movie.cpp \ android/graphics/Movie.cpp \ android/graphics/MovieImpl.cpp \ android/graphics/MovieImpl.cpp \ android/graphics/Movie_FactoryDefault.cpp \ android/graphics/NinePatch.cpp \ android/graphics/NinePatch.cpp \ android/graphics/NinePatchPeeker.cpp \ android/graphics/NinePatchPeeker.cpp \ android/graphics/Paint.cpp \ android/graphics/Paint.cpp \ Loading core/jni/android/graphics/GIFMovie.cpp +1 −5 Original line number Original line Diff line number Diff line Loading @@ -432,9 +432,7 @@ bool GIFMovie::onGetBitmap(SkBitmap* bm) /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// #include "SkTRegistry.h" Movie* Movie::DecodeStream(SkStreamRewindable* stream) { Movie* Factory(SkStreamRewindable* stream) { char buf[GIF_STAMP_LEN]; char buf[GIF_STAMP_LEN]; if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || Loading @@ -447,5 +445,3 @@ Movie* Factory(SkStreamRewindable* stream) { } } return nullptr; return nullptr; } } static SkTRegistry<Movie*(*)(SkStreamRewindable*)> gReg(Factory); core/jni/android/graphics/Movie_FactoryDefault.cppdeleted 100644 → 0 +0 −27 Original line number Original line Diff line number Diff line /* * Copyright 2006 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 "Movie.h" #include "SkStream.h" #include "SkTRegistry.h" typedef SkTRegistry<Movie*(*)(SkStreamRewindable*)> MovieReg; Movie* Movie::DecodeStream(SkStreamRewindable* stream) { const MovieReg* curr = MovieReg::Head(); while (curr) { Movie* movie = curr->factory()(stream); if (movie) { return movie; } // we must rewind only if we got nullptr, since we gave the stream to the // movie, who may have already started reading from it stream->rewind(); curr = curr->next(); } return nullptr; } Loading
core/jni/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -128,7 +128,6 @@ LOCAL_SRC_FILES:= \ android/graphics/Matrix.cpp \ android/graphics/Matrix.cpp \ android/graphics/Movie.cpp \ android/graphics/Movie.cpp \ android/graphics/MovieImpl.cpp \ android/graphics/MovieImpl.cpp \ android/graphics/Movie_FactoryDefault.cpp \ android/graphics/NinePatch.cpp \ android/graphics/NinePatch.cpp \ android/graphics/NinePatchPeeker.cpp \ android/graphics/NinePatchPeeker.cpp \ android/graphics/Paint.cpp \ android/graphics/Paint.cpp \ Loading
core/jni/android/graphics/GIFMovie.cpp +1 −5 Original line number Original line Diff line number Diff line Loading @@ -432,9 +432,7 @@ bool GIFMovie::onGetBitmap(SkBitmap* bm) /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// #include "SkTRegistry.h" Movie* Movie::DecodeStream(SkStreamRewindable* stream) { Movie* Factory(SkStreamRewindable* stream) { char buf[GIF_STAMP_LEN]; char buf[GIF_STAMP_LEN]; if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || Loading @@ -447,5 +445,3 @@ Movie* Factory(SkStreamRewindable* stream) { } } return nullptr; return nullptr; } } static SkTRegistry<Movie*(*)(SkStreamRewindable*)> gReg(Factory);
core/jni/android/graphics/Movie_FactoryDefault.cppdeleted 100644 → 0 +0 −27 Original line number Original line Diff line number Diff line /* * Copyright 2006 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 "Movie.h" #include "SkStream.h" #include "SkTRegistry.h" typedef SkTRegistry<Movie*(*)(SkStreamRewindable*)> MovieReg; Movie* Movie::DecodeStream(SkStreamRewindable* stream) { const MovieReg* curr = MovieReg::Head(); while (curr) { Movie* movie = curr->factory()(stream); if (movie) { return movie; } // we must rewind only if we got nullptr, since we gave the stream to the // movie, who may have already started reading from it stream->rewind(); curr = curr->next(); } return nullptr; }