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

Side by Side Diff: cc/paint/paint_image.h

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
« no previous file with comments | « no previous file | cc/paint/paint_image.cc » ('j') | cc/tiles/checker_image_tracker.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_PAINT_PAINT_IMAGE_H_ 5 #ifndef CC_PAINT_PAINT_IMAGE_H_
6 #define CC_PAINT_PAINT_IMAGE_H_ 6 #define CC_PAINT_PAINT_IMAGE_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/paint/paint_export.h" 9 #include "cc/paint/paint_export.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
(...skipping 27 matching lines...) Expand all
38 // - id: stable id for this image; can be generated using GetNextId(). 38 // - id: stable id for this image; can be generated using GetNextId().
39 // - sk_image: the underlying skia image that this represents. 39 // - sk_image: the underlying skia image that this represents.
40 // - animation_type: the animation type of this paint image. 40 // - animation_type: the animation type of this paint image.
41 // - completion_state: indicates whether the image is completed loading. 41 // - completion_state: indicates whether the image is completed loading.
42 // - frame_count: the known number of frames in this image. E.g. number of GIF 42 // - frame_count: the known number of frames in this image. E.g. number of GIF
43 // frames in an animated GIF. 43 // frames in an animated GIF.
44 explicit PaintImage(Id id, 44 explicit PaintImage(Id id,
45 sk_sp<SkImage> sk_image, 45 sk_sp<SkImage> sk_image,
46 AnimationType animation_type = AnimationType::STATIC, 46 AnimationType animation_type = AnimationType::STATIC,
47 CompletionState completion_state = CompletionState::DONE, 47 CompletionState completion_state = CompletionState::DONE,
48 size_t frame_count = 0); 48 size_t frame_count = 0,
49 bool is_multi_part = false);
49 PaintImage(const PaintImage& other); 50 PaintImage(const PaintImage& other);
50 PaintImage(PaintImage&& other); 51 PaintImage(PaintImage&& other);
51 ~PaintImage(); 52 ~PaintImage();
52 53
53 PaintImage& operator=(const PaintImage& other); 54 PaintImage& operator=(const PaintImage& other);
54 PaintImage& operator=(PaintImage&& other); 55 PaintImage& operator=(PaintImage&& other);
55 56
56 bool operator==(const PaintImage& other) const; 57 bool operator==(const PaintImage& other) const;
57 explicit operator bool() const { return sk_image_; } 58 explicit operator bool() const { return sk_image_; }
58 59
59 Id stable_id() const { return id_; } 60 Id stable_id() const { return id_; }
60 const sk_sp<SkImage>& sk_image() const { return sk_image_; } 61 const sk_sp<SkImage>& sk_image() const { return sk_image_; }
61 AnimationType animation_type() const { return animation_type_; } 62 AnimationType animation_type() const { return animation_type_; }
62 CompletionState completion_state() const { return completion_state_; } 63 CompletionState completion_state() const { return completion_state_; }
63 size_t frame_count() const { return frame_count_; } 64 size_t frame_count() const { return frame_count_; }
65 bool is_multi_part() const { return is_multi_part_; }
64 66
65 private: 67 private:
66 Id id_ = kUnknownStableId; 68 Id id_ = kUnknownStableId;
67 sk_sp<SkImage> sk_image_; 69 sk_sp<SkImage> sk_image_;
68 AnimationType animation_type_ = AnimationType::UNKNOWN; 70 AnimationType animation_type_ = AnimationType::UNKNOWN;
69 CompletionState completion_state_ = CompletionState::UNKNOWN; 71 CompletionState completion_state_ = CompletionState::UNKNOWN;
70 // The number of frames known to exist in this image (eg number of GIF frames 72 // The number of frames known to exist in this image (eg number of GIF frames
71 // loaded). 0 indicates either unknown or only a single frame, both of which 73 // loaded). 0 indicates either unknown or only a single frame, both of which
72 // should be treated similarly. 74 // should be treated similarly.
73 size_t frame_count_ = 0; 75 size_t frame_count_ = 0;
76
77 // Whether the data fetched for this image is a part of a multpart response.
78 bool is_multi_part_ = false;
vmpstr 2017/06/16 17:35:36 nit: should this be is_multipart_?
Khushal 2017/06/16 18:26:32 Done.
74 }; 79 };
75 80
76 } // namespace cc 81 } // namespace cc
77 82
78 #endif // CC_PAINT_PAINT_IMAGE_H_ 83 #endif // CC_PAINT_PAINT_IMAGE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/paint/paint_image.cc » ('j') | cc/tiles/checker_image_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698