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

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 1855273002: Update new Surface callsites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "cc/playback/raster_source.h" 10 #include "cc/playback/raster_source.h"
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 } 1736 }
1737 1737
1738 TEST_F(TileManagerTest, LowResHasNoImage) { 1738 TEST_F(TileManagerTest, LowResHasNoImage) {
1739 gfx::Size size(10, 12); 1739 gfx::Size size(10, 12);
1740 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION}; 1740 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION};
1741 1741
1742 for (size_t i = 0; i < arraysize(resolutions); ++i) { 1742 for (size_t i = 0; i < arraysize(resolutions); ++i) {
1743 SCOPED_TRACE(resolutions[i]); 1743 SCOPED_TRACE(resolutions[i]);
1744 1744
1745 // Make a RasterSource that will draw a blue bitmap image. 1745 // Make a RasterSource that will draw a blue bitmap image.
1746 skia::RefPtr<SkSurface> surface = skia::AdoptRef( 1746 sk_sp<SkSurface> surface =
1747 SkSurface::NewRasterN32Premul(size.width(), size.height())); 1747 SkSurface::MakeRasterN32Premul(size.width(), size.height());
1748 ASSERT_NE(surface, nullptr); 1748 ASSERT_NE(surface, nullptr);
1749 surface->getCanvas()->clear(SK_ColorBLUE); 1749 surface->getCanvas()->clear(SK_ColorBLUE);
1750 skia::RefPtr<SkImage> blue_image = 1750 skia::RefPtr<SkImage> blue_image =
1751 skia::AdoptRef(surface->newImageSnapshot()); 1751 skia::AdoptRef(surface->newImageSnapshot());
1752 1752
1753 scoped_ptr<FakeRecordingSource> recording_source = 1753 scoped_ptr<FakeRecordingSource> recording_source =
1754 FakeRecordingSource::CreateFilledRecordingSource(size); 1754 FakeRecordingSource::CreateFilledRecordingSource(size);
1755 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT); 1755 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT);
1756 recording_source->SetRequiresClear(true); 1756 recording_source->SetRequiresClear(true);
1757 recording_source->SetClearCanvasWithDebugColor(false); 1757 recording_source->SetClearCanvasWithDebugColor(false);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 2021
2022 // Ensures that the tile manager does not attempt to reuse tiles when partial 2022 // Ensures that the tile manager does not attempt to reuse tiles when partial
2023 // raster is disabled. 2023 // raster is disabled.
2024 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 2024 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
2025 RunPartialRasterCheck(std::move(host_impl_), 2025 RunPartialRasterCheck(std::move(host_impl_),
2026 false /* partial_raster_enabled */); 2026 false /* partial_raster_enabled */);
2027 } 2027 }
2028 2028
2029 } // namespace 2029 } // namespace
2030 } // namespace cc 2030 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698