OLD | NEW |
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 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 } | 1737 } |
1738 | 1738 |
1739 TEST_F(TileManagerTest, LowResHasNoImage) { | 1739 TEST_F(TileManagerTest, LowResHasNoImage) { |
1740 gfx::Size size(10, 12); | 1740 gfx::Size size(10, 12); |
1741 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION}; | 1741 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION}; |
1742 | 1742 |
1743 for (size_t i = 0; i < arraysize(resolutions); ++i) { | 1743 for (size_t i = 0; i < arraysize(resolutions); ++i) { |
1744 SCOPED_TRACE(resolutions[i]); | 1744 SCOPED_TRACE(resolutions[i]); |
1745 | 1745 |
1746 // Make a RasterSource that will draw a blue bitmap image. | 1746 // Make a RasterSource that will draw a blue bitmap image. |
1747 skia::RefPtr<SkSurface> surface = skia::AdoptRef( | 1747 sk_sp<SkSurface> surface = |
1748 SkSurface::NewRasterN32Premul(size.width(), size.height())); | 1748 SkSurface::MakeRasterN32Premul(size.width(), size.height()); |
1749 ASSERT_NE(surface, nullptr); | 1749 ASSERT_NE(surface, nullptr); |
1750 surface->getCanvas()->clear(SK_ColorBLUE); | 1750 surface->getCanvas()->clear(SK_ColorBLUE); |
1751 skia::RefPtr<SkImage> blue_image = | 1751 skia::RefPtr<SkImage> blue_image = |
1752 skia::AdoptRef(surface->newImageSnapshot()); | 1752 skia::AdoptRef(surface->newImageSnapshot()); |
1753 | 1753 |
1754 scoped_ptr<FakeRecordingSource> recording_source = | 1754 scoped_ptr<FakeRecordingSource> recording_source = |
1755 FakeRecordingSource::CreateFilledRecordingSource(size); | 1755 FakeRecordingSource::CreateFilledRecordingSource(size); |
1756 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT); | 1756 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT); |
1757 recording_source->SetRequiresClear(true); | 1757 recording_source->SetRequiresClear(true); |
1758 recording_source->SetClearCanvasWithDebugColor(false); | 1758 recording_source->SetClearCanvasWithDebugColor(false); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 | 2022 |
2023 // Ensures that the tile manager does not attempt to reuse tiles when partial | 2023 // Ensures that the tile manager does not attempt to reuse tiles when partial |
2024 // raster is disabled. | 2024 // raster is disabled. |
2025 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 2025 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
2026 RunPartialRasterCheck(std::move(host_impl_), | 2026 RunPartialRasterCheck(std::move(host_impl_), |
2027 false /* partial_raster_enabled */); | 2027 false /* partial_raster_enabled */); |
2028 } | 2028 } |
2029 | 2029 |
2030 } // namespace | 2030 } // namespace |
2031 } // namespace cc | 2031 } // namespace cc |
OLD | NEW |