| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class PLATFORM_EXPORT BitmapImage final : public Image { | 46 class PLATFORM_EXPORT BitmapImage final : public Image { |
| 47 friend class BitmapImageTest; | 47 friend class BitmapImageTest; |
| 48 friend class CrossfadeGeneratedImage; | 48 friend class CrossfadeGeneratedImage; |
| 49 friend class GeneratedImage; | 49 friend class GeneratedImage; |
| 50 friend class GradientGeneratedImage; | 50 friend class GradientGeneratedImage; |
| 51 friend class GraphicsContext; | 51 friend class GraphicsContext; |
| 52 | 52 |
| 53 public: | 53 public: |
| 54 static PassRefPtr<BitmapImage> Create(ImageObserver* observer = 0) { | 54 static PassRefPtr<BitmapImage> Create(ImageObserver* observer = 0, |
| 55 return AdoptRef(new BitmapImage(observer)); | 55 bool is_multipart = false) { |
| 56 return AdoptRef(new BitmapImage(observer, is_multipart)); |
| 56 } | 57 } |
| 57 | 58 |
| 58 ~BitmapImage() override; | 59 ~BitmapImage() override; |
| 59 | 60 |
| 60 bool IsBitmapImage() const override { return true; } | 61 bool IsBitmapImage() const override { return true; } |
| 61 | 62 |
| 62 bool CurrentFrameHasSingleSecurityOrigin() const override; | 63 bool CurrentFrameHasSingleSecurityOrigin() const override; |
| 63 | 64 |
| 64 IntSize Size() const override; | 65 IntSize Size() const override; |
| 65 IntSize SizeRespectingOrientation() const; | 66 IntSize SizeRespectingOrientation() const; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 private: | 103 private: |
| 103 enum RepetitionCountStatus : uint8_t { | 104 enum RepetitionCountStatus : uint8_t { |
| 104 kUnknown, // We haven't checked the source's repetition count. | 105 kUnknown, // We haven't checked the source's repetition count. |
| 105 kUncertain, // We have a repetition count, but it might be wrong (some GIFs | 106 kUncertain, // We have a repetition count, but it might be wrong (some GIFs |
| 106 // have a count after the image data, and will report "loop | 107 // have a count after the image data, and will report "loop |
| 107 // once" until all data has been decoded). | 108 // once" until all data has been decoded). |
| 108 kCertain // The repetition count is known to be correct. | 109 kCertain // The repetition count is known to be correct. |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 BitmapImage(const SkBitmap&, ImageObserver* = 0); | 112 BitmapImage(const SkBitmap&, ImageObserver* = 0); |
| 112 BitmapImage(ImageObserver* = 0); | 113 BitmapImage(ImageObserver* = 0, bool is_multi_part = false); |
| 113 | 114 |
| 114 void Draw(PaintCanvas*, | 115 void Draw(PaintCanvas*, |
| 115 const PaintFlags&, | 116 const PaintFlags&, |
| 116 const FloatRect& dst_rect, | 117 const FloatRect& dst_rect, |
| 117 const FloatRect& src_rect, | 118 const FloatRect& src_rect, |
| 118 RespectImageOrientationEnum, | 119 RespectImageOrientationEnum, |
| 119 ImageClampingMode) override; | 120 ImageClampingMode) override; |
| 120 | 121 |
| 121 size_t CurrentFrame() const { return current_frame_; } | 122 size_t CurrentFrame() const { return current_frame_; } |
| 122 | 123 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 size_t frame_count_; | 220 size_t frame_count_; |
| 220 | 221 |
| 221 RefPtr<WebTaskRunner> task_runner_; | 222 RefPtr<WebTaskRunner> task_runner_; |
| 222 }; | 223 }; |
| 223 | 224 |
| 224 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); | 225 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); |
| 225 | 226 |
| 226 } // namespace blink | 227 } // namespace blink |
| 227 | 228 |
| 228 #endif | 229 #endif |
| OLD | NEW |