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

Side by Side Diff: Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp

Issue 15350006: Decode GIF image frames on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 size_t DeferredImageDecoder::frameCount() 164 size_t DeferredImageDecoder::frameCount()
165 { 165 {
166 return m_actualDecoder ? m_actualDecoder->frameCount() : 1; 166 return m_actualDecoder ? m_actualDecoder->frameCount() : 1;
167 } 167 }
168 168
169 int DeferredImageDecoder::repetitionCount() const 169 int DeferredImageDecoder::repetitionCount() const
170 { 170 {
171 return m_actualDecoder ? m_actualDecoder->repetitionCount() : cAnimationNone ; 171 return m_actualDecoder ? m_actualDecoder->repetitionCount() : cAnimationNone ;
172 } 172 }
173 173
174 void DeferredImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame) 174 size_t DeferredImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
175 { 175 {
176 // If image decoding is deferred then frame buffer cache is managed by 176 // If image decoding is deferred then frame buffer cache is managed by
177 // the compositor and this call is ignored. 177 // the compositor and this call is ignored.
178 if (m_actualDecoder) 178 return m_actualDecoder ? m_actualDecoder->clearCacheExceptFrame(clearExceptF rame) : 0;
179 m_actualDecoder->clearFrameBufferCache(clearBeforeFrame);
180 } 179 }
181 180
182 bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const 181 bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const
183 { 182 {
184 return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : m_fr ameGenerator->hasAlpha(); 183 return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : m_fr ameGenerator->hasAlpha();
185 } 184 }
186 185
187 bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const 186 bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
188 { 187 {
189 // TODO: Implement this for deferred decoding. 188 // TODO: Implement this for deferred decoding.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 237
239 return bitmap; 238 return bitmap;
240 } 239 }
241 240
242 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const 241 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
243 { 242 {
244 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; 243 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
245 } 244 }
246 245
247 } // namespace WebCore 246 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/chromium/DeferredImageDecoder.h ('k') | Source/core/platform/image-decoders/ImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698