Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2939243002: cc/blink: Veto checker-imaging for multipart image resources. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.Release();
60 } 60 }
61 61
62 BitmapImage::BitmapImage(ImageObserver* observer) 62 BitmapImage::BitmapImage(ImageObserver* observer, bool is_multi_part)
63 : Image(observer), 63 : Image(observer, is_multi_part),
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),
70 size_available_(false), 70 size_available_(false),
71 have_frame_count_(false), 71 have_frame_count_(false),
72 repetition_count_status_(kUnknown), 72 repetition_count_status_(kUnknown),
73 repetition_count_(kAnimationNone), 73 repetition_count_(kAnimationNone),
74 repetitions_complete_(0), 74 repetitions_complete_(0),
75 desired_frame_start_time_(0), 75 desired_frame_start_time_(0),
76 frame_count_(0), 76 frame_count_(0),
77 task_runner_(Platform::Current() 77 task_runner_(Platform::Current()
78 ->CurrentThread() 78 ->CurrentThread()
79 ->Scheduler() 79 ->Scheduler()
80 ->CompositorTaskRunner()) {} 80 ->CompositorTaskRunner()) {}
81 81
82 BitmapImage::BitmapImage(const SkBitmap& bitmap, ImageObserver* observer) 82 BitmapImage::BitmapImage(const SkBitmap& bitmap, ImageObserver* observer)
83 : Image(observer), 83 : Image(observer, false),
vmpstr 2017/06/16 17:35:37 this is the default, so you can omit it
Khushal 2017/06/16 18:26:33 Done.
84 size_(bitmap.width(), bitmap.height()), 84 size_(bitmap.width(), bitmap.height()),
85 current_frame_(0), 85 current_frame_(0),
86 cached_frame_(SkImage::MakeFromBitmap(bitmap)), 86 cached_frame_(SkImage::MakeFromBitmap(bitmap)),
87 cached_frame_index_(0), 87 cached_frame_index_(0),
88 animation_policy_(kImageAnimationPolicyAllowed), 88 animation_policy_(kImageAnimationPolicyAllowed),
89 animation_finished_(true), 89 animation_finished_(true),
90 all_data_received_(true), 90 all_data_received_(true),
91 have_size_(true), 91 have_size_(true),
92 size_available_(true), 92 size_available_(true),
93 have_frame_count_(true), 93 have_frame_count_(true),
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698