| 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<Timer<BitmapImage>> frame_timer_; | 195 std::unique_ptr<TaskRunnerTimer<BitmapImage>> frame_timer_; |
| 196 int repetition_count_; // How many total animation loops we should do. This | 196 int repetition_count_; // How many total animation loops we should do. This |
| 197 // will be cAnimationNone if this image type is | 197 // will be cAnimationNone if this image type is |
| 198 // incapable of animation. | 198 // incapable of animation. |
| 199 RepetitionCountStatus repetition_count_status_; | 199 RepetitionCountStatus repetition_count_status_; |
| 200 int repetitions_complete_; // How many repetitions we've finished. | 200 int repetitions_complete_; // How many repetitions we've finished. |
| 201 double desired_frame_start_time_; // The system time at which we hope to see | 201 double desired_frame_start_time_; // The system time at which we hope to see |
| 202 // the next call to startAnimation(). | 202 // the next call to startAnimation(). |
| 203 | 203 |
| 204 size_t frame_count_; | 204 size_t frame_count_; |
| 205 | 205 |
| 206 ImageAnimationPolicy | 206 ImageAnimationPolicy |
| 207 animation_policy_; // Whether or not we can play animation. | 207 animation_policy_; // Whether or not we can play animation. |
| 208 | 208 |
| 209 bool animation_finished_ : 1; // Whether we've completed the entire | 209 bool animation_finished_ : 1; // Whether we've completed the entire |
| 210 // animation. | 210 // animation. |
| 211 | 211 |
| 212 bool all_data_received_ : 1; // Whether we've received all our data. | 212 bool all_data_received_ : 1; // Whether we've received all our data. |
| 213 mutable bool have_size_ : 1; // Whether our |m_size| member variable has the | 213 mutable bool have_size_ : 1; // Whether our |m_size| member variable has the |
| 214 // final overall image size yet. | 214 // final overall image size yet. |
| 215 bool size_available_ : 1; // Whether we can obtain the size of the first | 215 bool size_available_ : 1; // Whether we can obtain the size of the first |
| 216 // image frame from ImageIO yet. | 216 // image frame from ImageIO yet. |
| 217 mutable bool have_frame_count_ : 1; | 217 mutable bool have_frame_count_ : 1; |
| 218 |
| 219 RefPtr<WebTaskRunner> task_runner_; |
| 218 }; | 220 }; |
| 219 | 221 |
| 220 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); | 222 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); |
| 221 | 223 |
| 222 } // namespace blink | 224 } // namespace blink |
| 223 | 225 |
| 224 #endif | 226 #endif |
| OLD | NEW |