-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Import-Gentoo-patch-to-fix-playback_image_provider-c.patch
111 lines (96 loc) · 4.56 KB
/
0001-Import-Gentoo-patch-to-fix-playback_image_provider-c.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 104050c4446b1aea147311de92f7d9621708e9a2 Mon Sep 17 00:00:00 2001
From: Pietro Di Gennaro <[email protected]>
Date: Sun, 11 Mar 2018 12:40:57 +0100
Subject: [PATCH] Import Gentoo patch to fix playback_image_provider compile
errors.
---
cc/raster/playback_image_provider.cc | 7 +++++--
cc/raster/playback_image_provider.h | 8 +++++---
cc/raster/playback_image_provider_unittest.cc | 13 ++++++++-----
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/cc/raster/playback_image_provider.cc b/cc/raster/playback_image_provider.cc
index f2a6682ae183..dbf8530b50e9 100644
--- a/cc/raster/playback_image_provider.cc
+++ b/cc/raster/playback_image_provider.cc
@@ -20,7 +20,7 @@ void UnrefImageFromCache(DrawImage draw_image,
PlaybackImageProvider::PlaybackImageProvider(
ImageDecodeCache* cache,
const gfx::ColorSpace& target_color_space,
- base::Optional<Settings> settings)
+ base::Optional<Settings>&& settings)
: cache_(cache),
target_color_space_(target_color_space),
settings_(std::move(settings)) {
@@ -92,7 +92,10 @@ PlaybackImageProvider::GetDecodedDrawImage(const DrawImage& draw_image) {
}
PlaybackImageProvider::Settings::Settings() = default;
-PlaybackImageProvider::Settings::Settings(const Settings& other) = default;
+PlaybackImageProvider::Settings::Settings(PlaybackImageProvider::Settings&&) =
+ default;
PlaybackImageProvider::Settings::~Settings() = default;
+PlaybackImageProvider::Settings& PlaybackImageProvider::Settings::operator=(
+ PlaybackImageProvider::Settings&&) = default;
} // namespace cc
diff --git a/cc/raster/playback_image_provider.h b/cc/raster/playback_image_provider.h
index bae8c25bfd3e..ff15edaccd57 100644
--- a/cc/raster/playback_image_provider.h
+++ b/cc/raster/playback_image_provider.h
@@ -20,8 +20,10 @@ class CC_EXPORT PlaybackImageProvider : public ImageProvider {
public:
struct CC_EXPORT Settings {
Settings();
- Settings(const Settings& other);
- ~Settings();
+ Settings(const Settings&) = delete;
+ Settings(Settings&&);
+ ~Settings();
+ Settings& operator=(Settings&&);
// The set of image ids to skip during raster.
PaintImageIdFlatSet images_to_skip;
@@ -39,7 +41,7 @@ class CC_EXPORT PlaybackImageProvider : public ImageProvider {
// If no settings are provided, all images are skipped during rasterization.
PlaybackImageProvider(ImageDecodeCache* cache,
const gfx::ColorSpace& target_color_space,
- base::Optional<Settings> settings);
+ base::Optional<Settings>&& settings);
~PlaybackImageProvider() override;
void BeginRaster() override;
diff --git a/cc/raster/playback_image_provider_unittest.cc b/cc/raster/playback_image_provider_unittest.cc
index dde64a7b5b50..9d057eb4d50c 100644
--- a/cc/raster/playback_image_provider_unittest.cc
+++ b/cc/raster/playback_image_provider_unittest.cc
@@ -84,7 +84,8 @@ TEST(PlaybackImageProviderTest, SkipsSomeImages) {
settings.emplace();
settings->images_to_skip = {skip_image.stable_id()};
- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
provider.BeginRaster();
SkIRect rect = SkIRect::MakeWH(10, 10);
@@ -100,7 +101,8 @@ TEST(PlaybackImageProviderTest, RefAndUnrefDecode) {
base::Optional<PlaybackImageProvider::Settings> settings;
settings.emplace();
- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
provider.BeginRaster();
{
@@ -133,7 +135,8 @@ TEST(PlaybackImageProviderTest, AtRasterImages) {
settings.emplace();
settings->at_raster_images = {draw_image1, draw_image2};
- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
EXPECT_EQ(cache.refed_image_count(), 0);
provider.BeginRaster();
@@ -158,8 +161,8 @@ TEST(PlaybackImageProviderTest, SwapsGivenFrames) {
settings.emplace();
settings->image_to_current_frame_index = image_to_frame;
- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
- provider.BeginRaster();
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings)); provider.BeginRaster();
SkIRect rect = SkIRect::MakeWH(10, 10);
SkMatrix matrix = SkMatrix::I();
--
2.14.3