Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/BitmapImage.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h |
| index 4ee77dc5dd1ca98b323682b8e4b623957b784bda..1cc8b730296515e91d1b5fc4db054bfdf9d4fc07 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h |
| +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h |
| @@ -51,8 +51,13 @@ class PLATFORM_EXPORT BitmapImage final : public Image { |
| friend class GraphicsContext; |
| public: |
| - static PassRefPtr<BitmapImage> Create(ImageObserver* observer = 0) { |
| - return AdoptRef(new BitmapImage(observer)); |
| + static PassRefPtr<BitmapImage> CreateGlobal() { |
| + return AdoptRef(new BitmapImage()); |
| + } |
| + |
| + static PassRefPtr<BitmapImage> Create(RefPtr<WebTaskRunner> task_runner, |
| + ImageObserver* observer = 0) { |
| + return AdoptRef(new BitmapImage(task_runner, observer)); |
| } |
| ~BitmapImage() override; |
| @@ -93,6 +98,7 @@ class PLATFORM_EXPORT BitmapImage final : public Image { |
| // Construct a BitmapImage with the given orientation. |
| static PassRefPtr<BitmapImage> CreateWithOrientationForTesting( |
| + RefPtr<WebTaskRunner>, |
| const SkBitmap&, |
| ImageOrientation); |
| // Advance the image animation by one frame. |
| @@ -107,8 +113,10 @@ class PLATFORM_EXPORT BitmapImage final : public Image { |
| kCertain // The repetition count is known to be correct. |
| }; |
| - BitmapImage(const SkBitmap&, ImageObserver* = 0); |
| - BitmapImage(ImageObserver* = 0); |
| + BitmapImage(); |
| + |
| + BitmapImage(RefPtr<WebTaskRunner>, const SkBitmap&, ImageObserver* = 0); |
|
Sami
2017/04/27 17:38:17
Should we make these two explicit?
Dan Elphick
2017/05/03 09:41:06
no longer required
|
| + BitmapImage(RefPtr<WebTaskRunner>, ImageObserver* = 0); |
| void Draw(PaintCanvas*, |
| const PaintFlags&, |
| @@ -192,7 +200,7 @@ class PLATFORM_EXPORT BitmapImage final : public Image { |
| cached_frame_; // A cached copy of the most recently-accessed frame. |
| size_t cached_frame_index_; // Index of the frame that is cached. |
| - std::unique_ptr<Timer<BitmapImage>> frame_timer_; |
| + std::unique_ptr<TaskRunnerTimer<BitmapImage>> frame_timer_; |
| int repetition_count_; // How many total animation loops we should do. This |
| // will be cAnimationNone if this image type is |
| // incapable of animation. |
| @@ -215,6 +223,8 @@ class PLATFORM_EXPORT BitmapImage final : public Image { |
| bool size_available_ : 1; // Whether we can obtain the size of the first |
| // image frame from ImageIO yet. |
| mutable bool have_frame_count_ : 1; |
| + |
| + RefPtr<WebTaskRunner> task_runner_; |
| }; |
| DEFINE_IMAGE_TYPE_CASTS(BitmapImage); |