| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display_item_list.h" | 5 #include "cc/playback/display_item_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 // A single DrawingDisplayItem with a large AA concave path shouldn't trigger | 535 // A single DrawingDisplayItem with a large AA concave path shouldn't trigger |
| 536 // a veto. | 536 // a veto. |
| 537 EXPECT_TRUE(list->IsSuitableForGpuRasterization()); | 537 EXPECT_TRUE(list->IsSuitableForGpuRasterization()); |
| 538 | 538 |
| 539 // Now check the RasterIntoCanvas path. | 539 // Now check the RasterIntoCanvas path. |
| 540 list = DisplayItemList::Create(layer_rect, settings); | 540 list = DisplayItemList::Create(layer_rect, settings); |
| 541 DrawingDisplayItem suitable_item(suitable_picture); | 541 DrawingDisplayItem suitable_item(suitable_picture); |
| 542 list->RasterIntoCanvas(suitable_item); | 542 list->RasterIntoCanvas(suitable_item); |
| 543 list->Finalize(); | 543 list->Finalize(); |
| 544 EXPECT_TRUE(list->ApproximateOpCount()); |
| 544 EXPECT_TRUE(list->IsSuitableForGpuRasterization()); | 545 EXPECT_TRUE(list->IsSuitableForGpuRasterization()); |
| 545 | 546 |
| 546 list = DisplayItemList::Create(layer_rect, settings); | 547 list = DisplayItemList::Create(layer_rect, settings); |
| 547 canvas = sk_ref_sp(recorder.beginRecording(gfx::RectToSkRect(layer_rect))); | 548 canvas = sk_ref_sp(recorder.beginRecording(gfx::RectToSkRect(layer_rect))); |
| 548 for (int i = 0; i < 10; ++i) | 549 for (int i = 0; i < 10; ++i) |
| 549 canvas->drawPath(path, paint); | 550 canvas->drawPath(path, paint); |
| 550 sk_sp<SkPicture> unsuitable_picture = recorder.finishRecordingAsPicture(); | 551 sk_sp<SkPicture> unsuitable_picture = recorder.finishRecordingAsPicture(); |
| 551 list->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect, | 552 list->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect, |
| 552 unsuitable_picture); | 553 unsuitable_picture); |
| 553 list->Finalize(); | 554 list->Finalize(); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 | 746 |
| 746 value = list->AsValue(false)->ToString(); | 747 value = list->AsValue(false)->ToString(); |
| 747 EXPECT_EQ(value.find("\"items\":"), std::string::npos); | 748 EXPECT_EQ(value.find("\"items\":"), std::string::npos); |
| 748 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos); | 749 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos); |
| 749 // There should be no skp64 entry present as the items aren't included and the | 750 // There should be no skp64 entry present as the items aren't included and the |
| 750 // layer rect is empty. | 751 // layer rect is empty. |
| 751 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos); | 752 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos); |
| 752 } | 753 } |
| 753 | 754 |
| 754 } // namespace cc | 755 } // namespace cc |
| OLD | NEW |