Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: src/images/SkMovie.cpp

Issue 2449213004: Remove SkMovie and giflib (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/images/SkGIFMovie.cpp ('k') | src/images/SkMovie_FactoryDefault.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkMovie.cpp
diff --git a/src/images/SkMovie.cpp b/src/images/SkMovie.cpp
deleted file mode 100644
index a0a37dcffa36abe038b4f43b28adb1bebce6ec65..0000000000000000000000000000000000000000
--- a/src/images/SkMovie.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "SkMovie.h"
-#include "SkCanvas.h"
-#include "SkPaint.h"
-
-// We should never see this in normal operation since our time values are
-// 0-based. So we use it as a sentinal.
-#define UNINITIALIZED_MSEC ((SkMSec)-1)
-
-SkMovie::SkMovie()
-{
- fInfo.fDuration = UNINITIALIZED_MSEC; // uninitialized
- fCurrTime = UNINITIALIZED_MSEC; // uninitialized
- fNeedBitmap = true;
-}
-
-void SkMovie::ensureInfo()
-{
- if (fInfo.fDuration == UNINITIALIZED_MSEC && !this->onGetInfo(&fInfo))
- memset(&fInfo, 0, sizeof(fInfo)); // failure
-}
-
-SkMSec SkMovie::duration()
-{
- this->ensureInfo();
- return fInfo.fDuration;
-}
-
-int SkMovie::width()
-{
- this->ensureInfo();
- return fInfo.fWidth;
-}
-
-int SkMovie::height()
-{
- this->ensureInfo();
- return fInfo.fHeight;
-}
-
-int SkMovie::isOpaque()
-{
- this->ensureInfo();
- return fInfo.fIsOpaque;
-}
-
-bool SkMovie::setTime(SkMSec time)
-{
- SkMSec dur = this->duration();
- if (time > dur)
- time = dur;
-
- bool changed = false;
- if (time != fCurrTime)
- {
- fCurrTime = time;
- changed = this->onSetTime(time);
- fNeedBitmap |= changed;
- }
- return changed;
-}
-
-const SkBitmap& SkMovie::bitmap()
-{
- if (fCurrTime == UNINITIALIZED_MSEC) // uninitialized
- this->setTime(0);
-
- if (fNeedBitmap)
- {
- if (!this->onGetBitmap(&fBitmap)) // failure
- fBitmap.reset();
- fNeedBitmap = false;
- }
- return fBitmap;
-}
-
-////////////////////////////////////////////////////////////////////
-
-#include "SkStream.h"
-
-SkMovie* SkMovie::DecodeMemory(const void* data, size_t length) {
- SkMemoryStream stream(data, length, false);
- return SkMovie::DecodeStream(&stream);
-}
-
-SkMovie* SkMovie::DecodeFile(const char path[]) {
- std::unique_ptr<SkStreamRewindable> stream = SkStream::MakeFromFile(path);
- return stream ? SkMovie::DecodeStream(stream.get()) : nullptr;
-}
« no previous file with comments | « src/images/SkGIFMovie.cpp ('k') | src/images/SkMovie_FactoryDefault.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698