| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 4 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 4 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 size_t current_frame_; // The index of the current frame of animation. | 186 size_t current_frame_; // The index of the current frame of animation. |
| 187 Vector<FrameData, 1> frames_; // An array of the cached frames of the | 187 Vector<FrameData, 1> frames_; // An array of the cached frames of the |
| 188 // animation. We have to ref frames to pin | 188 // animation. We have to ref frames to pin |
| 189 // them in the cache. | 189 // them in the cache. |
| 190 | 190 |
| 191 sk_sp<SkImage> | 191 sk_sp<SkImage> |
| 192 cached_frame_; // A cached copy of the most recently-accessed frame. | 192 cached_frame_; // A cached copy of the most recently-accessed frame. |
| 193 size_t cached_frame_index_; // Index of the frame that is cached. | 193 size_t cached_frame_index_; // Index of the frame that is cached. |
| 194 | 194 |
| 195 std::unique_ptr<TaskRunnerTimer<BitmapImage>> frame_timer_; | 195 std::unique_ptr<Timer<BitmapImage>> frame_timer_; |
| 196 | 196 |
| 197 ImageAnimationPolicy | 197 ImageAnimationPolicy |
| 198 animation_policy_; // Whether or not we can play animation. | 198 animation_policy_; // Whether or not we can play animation. |
| 199 | 199 |
| 200 bool animation_finished_ : 1; // Whether we've completed the entire | 200 bool animation_finished_ : 1; // Whether we've completed the entire |
| 201 // animation. | 201 // animation. |
| 202 | 202 |
| 203 bool all_data_received_ : 1; // Whether we've received all our data. | 203 bool all_data_received_ : 1; // Whether we've received all our data. |
| 204 mutable bool have_size_ : 1; // Whether our |m_size| member variable has the | 204 mutable bool have_size_ : 1; // Whether our |m_size| member variable has the |
| 205 // final overall image size yet. | 205 // final overall image size yet. |
| 206 bool size_available_ : 1; // Whether we can obtain the size of the first | 206 bool size_available_ : 1; // Whether we can obtain the size of the first |
| 207 // image frame from ImageIO yet. | 207 // image frame from ImageIO yet. |
| 208 mutable bool have_frame_count_ : 1; | 208 mutable bool have_frame_count_ : 1; |
| 209 | 209 |
| 210 RepetitionCountStatus repetition_count_status_; | 210 RepetitionCountStatus repetition_count_status_; |
| 211 int repetition_count_; // How many total animation loops we should do. This | 211 int repetition_count_; // How many total animation loops we should do. This |
| 212 // will be cAnimationNone if this image type is | 212 // will be cAnimationNone if this image type is |
| 213 // incapable of animation. | 213 // incapable of animation. |
| 214 int repetitions_complete_; // How many repetitions we've finished. | 214 int repetitions_complete_; // How many repetitions we've finished. |
| 215 | 215 |
| 216 double desired_frame_start_time_; // The system time at which we hope to see | 216 double desired_frame_start_time_; // The system time at which we hope to see |
| 217 // the next call to startAnimation(). | 217 // the next call to startAnimation(). |
| 218 | 218 |
| 219 size_t frame_count_; | 219 size_t frame_count_; |
| 220 | |
| 221 RefPtr<WebTaskRunner> task_runner_; | |
| 222 }; | 220 }; |
| 223 | 221 |
| 224 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); | 222 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); |
| 225 | 223 |
| 226 } // namespace blink | 224 } // namespace blink |
| 227 | 225 |
| 228 #endif | 226 #endif |
| OLD | NEW |