From 71e1ac4b000ff9a7714323e21b800ec99d8bf048 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 8 Mar 2018 17:46:02 +0000 Subject: [PATCH 7/7] GCC: PlaybackImageProvider::Settings: explicitely set copy constructor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC fails to resolve the default copy constructor of the flat_map, so we add an explicit reference to use default copy constructor. Bug: 819294 Change-Id: Ie2d69bdbe60742e9253251c965cbf0a936037871 Reviewed-on: https://chromium-review.googlesource.com/944403 Reviewed-by: David Reveman Commit-Queue: José Dapena Paz Cr-Commit-Position: refs/heads/master@{#541827} --- cc/raster/playback_image_provider.cc | 7 +++++-- cc/raster/playback_image_provider.h | 6 ++++-- cc/raster/playback_image_provider_unittest.cc | 15 ++++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/cc/raster/playback_image_provider.cc b/cc/raster/playback_image_provider.cc index 557b421bbaef..b2ace4dc4fa8 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) + base::Optional&& settings) : cache_(cache), target_color_space_(target_color_space), settings_(std::move(settings)) { @@ -70,7 +70,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 67974f3f341d..a33092d2b5b4 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(const Settings&) = delete; + Settings(Settings&&); ~Settings(); + Settings& operator=(Settings&&); // The set of image ids to skip during raster. PaintImageIdFlatSet images_to_skip; @@ -34,7 +36,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); + base::Optional&& settings); ~PlaybackImageProvider() override; PlaybackImageProvider(PlaybackImageProvider&& other); diff --git a/cc/raster/playback_image_provider_unittest.cc b/cc/raster/playback_image_provider_unittest.cc index 0206999d6e4a..40036e87032d 100644 --- a/cc/raster/playback_image_provider_unittest.cc +++ b/cc/raster/playback_image_provider_unittest.cc @@ -85,7 +85,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)); SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I(); @@ -99,7 +100,8 @@ TEST(PlaybackImageProviderTest, RefAndUnrefDecode) { base::Optional settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkRect rect = SkRect::MakeWH(10, 10); @@ -127,7 +129,8 @@ TEST(PlaybackImageProviderTest, SwapsGivenFrames) { settings.emplace(); settings->image_to_current_frame_index = image_to_frame; - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I(); @@ -143,7 +146,8 @@ TEST(PlaybackImageProviderTest, BitmapImages) { base::Optional settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkIRect rect = SkIRect::MakeWH(10, 10); @@ -174,7 +178,8 @@ TEST(PlaybackImageProviderTest, TextureImages) { MockDecodeCache cache; base::Optional settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I(); -- 2.17.0