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, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const SkBitmap& bitmap, | 49 const SkBitmap& bitmap, |
50 ImageOrientation orientation) { | 50 ImageOrientation orientation) { |
51 if (bitmap.isNull()) { | 51 if (bitmap.isNull()) { |
52 return BitmapImage::Create(); | 52 return BitmapImage::Create(); |
53 } | 53 } |
54 | 54 |
55 RefPtr<BitmapImage> result = AdoptRef(new BitmapImage(bitmap)); | 55 RefPtr<BitmapImage> result = AdoptRef(new BitmapImage(bitmap)); |
56 result->frames_[0].orientation_ = orientation; | 56 result->frames_[0].orientation_ = orientation; |
57 if (orientation.UsesWidthAsHeight()) | 57 if (orientation.UsesWidthAsHeight()) |
58 result->size_respecting_orientation_ = result->size_.TransposedSize(); | 58 result->size_respecting_orientation_ = result->size_.TransposedSize(); |
59 return result.Release(); | 59 return result; |
60 } | 60 } |
61 | 61 |
62 BitmapImage::BitmapImage(ImageObserver* observer, bool is_multipart) | 62 BitmapImage::BitmapImage(ImageObserver* observer, bool is_multipart) |
63 : Image(observer, is_multipart), | 63 : Image(observer, is_multipart), |
64 current_frame_(0), | 64 current_frame_(0), |
65 cached_frame_index_(0), | 65 cached_frame_index_(0), |
66 animation_policy_(kImageAnimationPolicyAllowed), | 66 animation_policy_(kImageAnimationPolicyAllowed), |
67 animation_finished_(false), | 67 animation_finished_(false), |
68 all_data_received_(false), | 68 all_data_received_(false), |
69 have_size_(false), | 69 have_size_(false), |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 return true; | 644 return true; |
645 } | 645 } |
646 | 646 |
647 void BitmapImage::NotifyObserversOfAnimationAdvance(TimerBase*) { | 647 void BitmapImage::NotifyObserversOfAnimationAdvance(TimerBase*) { |
648 if (GetImageObserver()) | 648 if (GetImageObserver()) |
649 GetImageObserver()->AnimationAdvanced(this); | 649 GetImageObserver()->AnimationAdvanced(this); |
650 } | 650 } |
651 | 651 |
652 } // namespace blink | 652 } // namespace blink |
OLD | NEW |