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

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: 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 if (m_actualDecoder)
Peter Kasting 2013/05/29 02:02:18 Nit: Simpler: return m_actualDecoder ? m_actu
Xianzhu 2013/05/29 18:37:01 Done.
179 m_actualDecoder->clearFrameBufferCache(clearBeforeFrame); 179 return m_actualDecoder->clearCacheExceptFrame(clearExceptFrame);
180 return 0;
180 } 181 }
181 182
182 bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const 183 bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const
183 { 184 {
184 return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : m_fr ameGenerator->hasAlpha(); 185 return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : m_fr ameGenerator->hasAlpha();
185 } 186 }
186 187
187 bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const 188 bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
188 { 189 {
189 // TODO: Implement this for deferred decoding. 190 // TODO: Implement this for deferred decoding.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 239
239 return bitmap; 240 return bitmap;
240 } 241 }
241 242
242 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const 243 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
243 { 244 {
244 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; 245 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
245 } 246 }
246 247
247 } // namespace WebCore 248 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698