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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION}; | 1748 TileResolution resolutions[] = {HIGH_RESOLUTION, LOW_RESOLUTION}; |
1749 | 1749 |
1750 for (size_t i = 0; i < arraysize(resolutions); ++i) { | 1750 for (size_t i = 0; i < arraysize(resolutions); ++i) { |
1751 SCOPED_TRACE(resolutions[i]); | 1751 SCOPED_TRACE(resolutions[i]); |
1752 | 1752 |
1753 // Make a RasterSource that will draw a blue bitmap image. | 1753 // Make a RasterSource that will draw a blue bitmap image. |
1754 sk_sp<SkSurface> surface = | 1754 sk_sp<SkSurface> surface = |
1755 SkSurface::MakeRasterN32Premul(size.width(), size.height()); | 1755 SkSurface::MakeRasterN32Premul(size.width(), size.height()); |
1756 ASSERT_NE(surface, nullptr); | 1756 ASSERT_NE(surface, nullptr); |
1757 surface->getCanvas()->clear(SK_ColorBLUE); | 1757 surface->getCanvas()->clear(SK_ColorBLUE); |
1758 skia::RefPtr<SkImage> blue_image = | 1758 sk_sp<SkImage> blue_image = surface->makeImageSnapshot(); |
1759 skia::AdoptRef(surface->newImageSnapshot()); | |
1760 | 1759 |
1761 std::unique_ptr<FakeRecordingSource> recording_source = | 1760 std::unique_ptr<FakeRecordingSource> recording_source = |
1762 FakeRecordingSource::CreateFilledRecordingSource(size); | 1761 FakeRecordingSource::CreateFilledRecordingSource(size); |
1763 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT); | 1762 recording_source->SetBackgroundColor(SK_ColorTRANSPARENT); |
1764 recording_source->SetRequiresClear(true); | 1763 recording_source->SetRequiresClear(true); |
1765 recording_source->SetClearCanvasWithDebugColor(false); | 1764 recording_source->SetClearCanvasWithDebugColor(false); |
1766 SkPaint paint; | 1765 SkPaint paint; |
1767 paint.setColor(SK_ColorGREEN); | 1766 paint.setColor(SK_ColorGREEN); |
1768 recording_source->add_draw_rect_with_paint(gfx::Rect(size), paint); | 1767 recording_source->add_draw_rect_with_paint(gfx::Rect(size), paint); |
1769 recording_source->add_draw_image(blue_image.get(), gfx::Point()); | 1768 recording_source->add_draw_image(blue_image.get(), gfx::Point()); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 | 2028 |
2030 // Ensures that the tile manager does not attempt to reuse tiles when partial | 2029 // Ensures that the tile manager does not attempt to reuse tiles when partial |
2031 // raster is disabled. | 2030 // raster is disabled. |
2032 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 2031 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
2033 RunPartialRasterCheck(std::move(host_impl_), | 2032 RunPartialRasterCheck(std::move(host_impl_), |
2034 false /* partial_raster_enabled */); | 2033 false /* partial_raster_enabled */); |
2035 } | 2034 } |
2036 | 2035 |
2037 } // namespace | 2036 } // namespace |
2038 } // namespace cc | 2037 } // namespace cc |
OLD | NEW |