OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/playback/discardable_image_map.h" | 5 #include "cc/playback/discardable_image_map.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
11 #include "cc/playback/raster_source.h" | |
12 #include "cc/test/fake_content_layer_client.h" | 11 #include "cc/test/fake_content_layer_client.h" |
13 #include "cc/test/fake_display_list_recording_source.h" | 12 #include "cc/test/fake_display_list_recording_source.h" |
14 #include "cc/test/skia_common.h" | 13 #include "cc/test/skia_common.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/skia/include/core/SkGraphics.h" | 15 #include "third_party/skia/include/core/SkGraphics.h" |
17 #include "third_party/skia/include/core/SkImageGenerator.h" | 16 #include "third_party/skia/include/core/SkImageGenerator.h" |
18 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
19 #include "ui/gfx/skia_util.h" | 18 #include "ui/gfx/skia_util.h" |
20 | 19 |
21 namespace cc { | 20 namespace cc { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 display_list->Raster(generator.canvas(), nullptr, visible_rect, 1.f); | 313 display_list->Raster(generator.canvas(), nullptr, visible_rect, 1.f); |
315 } | 314 } |
316 std::vector<PositionDrawImage> images = | 315 std::vector<PositionDrawImage> images = |
317 GetDiscardableImagesInRect(image_map, gfx::Rect(0, 0, 1, 1)); | 316 GetDiscardableImagesInRect(image_map, gfx::Rect(0, 0, 1, 1)); |
318 EXPECT_EQ(1u, images.size()); | 317 EXPECT_EQ(1u, images.size()); |
319 EXPECT_TRUE(images[0].image == discardable_image.get()); | 318 EXPECT_TRUE(images[0].image == discardable_image.get()); |
320 EXPECT_EQ(gfx::RectF(0, 0, 1 << 25, 1 << 25), images[0].image_rect); | 319 EXPECT_EQ(gfx::RectF(0, 0, 1 << 25, 1 << 25), images[0].image_rect); |
321 } | 320 } |
322 | 321 |
323 } // namespace cc | 322 } // namespace cc |
OLD | NEW |